Complex Flat File

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sarat.srinivas@tcs.com
Participant
Posts: 26
Joined: Fri Jul 13, 2007 6:33 am

Complex Flat File

Post by sarat.srinivas@tcs.com »

We are using Information Server 8.0.1 Parallel Extender. We have a requirement of loading the rows with same RECORD_ID into single table,i.e., Records with ABCDEF (RECORD_ID) should be loaded into table ABCDEF & GHIJKL should be loaded into the table GHIJKL & so on.

The INPUT FILE is FIXED WIDTH that has spaces right padded. All records are of same length with 250 characters in total with no field delimeter. Also, input file contains records of varying metadata across different RECORD_IDs. Records are identified by first 6 digit word RECORD_ID.

*********************************** FILE LAYOUT ***********************************
ABCDEF1617029211081283942348328
GIJKLM4545237534853483896389068386954905349
ABCDEF8779079808088070788088988
NOPQRS98909797908890
*********************************** FILE LAYOUT ***********************************

In the above FILE LAYOUT sample, ABCDEF, GIJKLM, NOPQRS are the RECORD_IDs through which the record can be identified. These records will have different metadata.All the records starting with same record-id will have the same metadata, so needs to be loaded to the same table.

For this, we have used a complex flat file. We defined the record constraints in the job as 'ABCDEF', 'GHIJKL', 'NOPQRS'. When we tried to view the data, the same recordid ( ABCDEF ) for all the output links of the complex flat file. But, we need to see only the data related to 'ABCDEF' if we specify the RECORD_ID constraint as 'ABCDEF' & so on. Request someone to point out in case we did anything wrongly & suggest a way to correct the same using a CFF.
V.Sarat Srinivas
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have already been provided with a solution to this problem using a Sequential File stage. If you insist upon using a Complex Flat File stage please post the record schema that you are using. You will need more than one level of definition.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aruna Gutti
Premium Member
Premium Member
Posts: 145
Joined: Fri Sep 21, 2007 9:35 am
Location: Boston

Post by Aruna Gutti »

How did you defined your 3 types of records ? Are you seeing 3 records in your CFF Stage, Stage---> Records tab ?

If you view the data in CFF stage you see all the columns from all the record types.

If you want to see only a particular type you need to pass this data through a transformer and map it to respective output layouts.

Atleast that is how I got my multirecord COBOL file mapped properly in my job.

Regards,

Atuna.
Post Reply