Multi-format file & Complex Flat File Stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sri1dhar
Charter Member
Charter Member
Posts: 54
Joined: Mon Nov 03, 2003 3:57 pm

Multi-format file & Complex Flat File Stage

Post 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
THEDSKID
Premium Member
Premium Member
Posts: 11
Joined: Thu Apr 29, 2004 10:51 am
Location: DALLAS TX
Contact:

Re: Multi-format file & Complex Flat File Stage

Post 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
-Chris
Post Reply