Multiple record types into CFF stage (EBCIDIC)

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
fridge
Premium Member
Premium Member
Posts: 136
Joined: Sat Jan 10, 2004 8:51 am

Multiple record types into CFF stage (EBCIDIC)

Post by fridge »

Hi, dont know if anyone can help - but have a job that basically needs to write an EBCIDIC file as follows

Multiple records of the following type
REC_TYPE(D) ACCOUNTNUM VALa VALb VALc VALd

Followed by a single checkrecord of type
REC_TYPE(T) ACCOUNTNUM COUNT FILLER

However this scenerio is repeated thus
D 1234 7 8 9
D 1234 12 33 9
D 1234 32 11 2
T 1234 3 xxxx
D 1111 7 8 9
D 1111 12 33 9
T 1111 2 xxxx
D 2222 7 8 9
D 2222 12 33 9
D 2222 32 11 2
T 2222 3 xxxx

The problem is that there are some 2000 values of ACCOUNT so cant do a loop in the sequencer - and keep appending to the file

But as far as I can see the CFF stage only allows you to write one particular record type (for single file headers/trailers) - have just used different jobs as the overhead is small.

To complicate the issue more - the VALa, VALb are comp-3 - but the COUNT field is PIC 9(5) - so cant even just string everything together into a single record layout.


Any help gratefully recieved
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I don't think the CFF stage can handle multiple file types when it is used as a target. It certainly cannot accept multiple input links. You might be able to trick it by splitting the COUNT field and writing it to VALa and VALb and then adding blanks to fill out the rest.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

My take on this, with assumptions that could be incorrect:

Do not use CFF to write to the EBCDIC file. You should have a fixed length record regardless of record type -- that's standard in any COBOL environment -- and if each record type has overlapping column formats you have to do some preparation first.

Build each record type in a separate track, and funnel them at the end. Do a final transform to a Char or Binary column that contains the entire row regardless of record type. Assuming you must have the output in record type order, you can easily do that in the funnel.

Output to a file (or use FTP to write to your host) on the single-column record. The FAQ "Using Mainframe Source Data" may have further information that could be helpful.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply