Page 1 of 1

Multi-format file & Complex Flat File Stage

Posted: Tue Mar 21, 2006 10:51 am
by sri1dhar
I am designing a Server job. I have a flat file with muli-format records. The first charcter in the record indicates the type of record. Depending on the record type the format changes.

Example data: '|' is the field seperator

A|2SK1531|DOOB|276708|2767
N|78751|ACON|DonG. Auch
C|87228|COMA|C001|314864
B|31392|PACT|Sherman

I realized Comple Flat File stage can be used to handle this type of file by having multiple output links by record_type.
The issue I have with CFF stage is I need to define the source file format on every output link. That means technically every output link is processed as indepent stage by repetedly reading the same file. Is there way I can specifiy one source & have multiple output links from a CFF stage in serve jobs.

Regards
Sri

Re: Multi-format file & Complex Flat File Stage

Posted: Tue Mar 21, 2006 11:09 am
by THEDSKID
I have not used the CFF stage however I am "Old School" and I would just use a Seq File and read the record in as Fixed length 2048 then use a Constraint for each link specifying i.e. your example... linkname.fieldname[1,1]='A' for each first character. On the output links you will have one link for each different type of record and you will need to edit your metadata to match each different format.

Hope this helps!
sri1dhar wrote:I am designing a Server job. I have a flat file with muli-format records. The first charcter in the record indicates the type of record. Depending on the record type the format changes.

Example data: '|' is the field seperator

A|2SK1531|DOOB|276708|2767
N|78751|ACON|DonG. Auch
C|87228|COMA|C001|314864
B|31392|PACT|Sherman

I realized Comple Flat File stage can be used to handle this type of file by having multiple output links by record_type.
The issue I have with CFF stage is I need to define the source file format on every output link. That means technically every output link is processed as indepent stage by repetedly reading the same file. Is there way I can specifiy one source & have multiple output links from a CFF stage in serve jobs.

Regards
Sri