Page 1 of 1

Processing different record types - cobol source files.

Posted: Tue Jul 04, 2006 4:11 pm
by alnico_blue
Hello,

Hoping somebody can help. I'm working with cobol source files for the first time - so I have to deal with the fact that there are different record types within the file (header, detail and trailers). Just wondering how everybody else has dealt with this before.

I've searched the threads and can see that others have initially split the records by type, then processed the records accordingly. If there are elements within one record type (say the trailer), which can be joined to another type (detail record), one type is used as a lookup further on in the processing. I too have taken this approach - but would like to know if there is another way.

Is this typical of how cobol source files are treated in DataStage?

Posted: Tue Jul 04, 2006 8:31 pm
by ray.wurlod
Welcome aboard. :D

Read on-line help about importing table definitions from COBOL file definitions. If there are multiple "table" definitions in an FD, then more than one table definition will be imported.

The most usual ways to work with these kinds of data is to use a Complex Flat File (CFF) stage.

Posted: Tue Jul 04, 2006 11:27 pm
by kumar_s
You can explain you need to get the more suitable approach for yours.
CFF is more suitable to read and write the record sets with header, detail and trailer. Inorder to process or validate the data, it is always forced to split the records accordingly. It is possible go carry the whole set without spliting, if the datatype of detail column match with the other trailer and header. Where in most of the case it wont. And more over you need to have additional check for this Header and Trailer on row wise before transformation, which may be ineffecient.