Page 1 of 1

Multiple record types into CFF stage (EBCIDIC)

Posted: Wed May 02, 2012 1:22 pm
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

Posted: Mon May 07, 2012 7:42 pm
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.

Posted: Tue May 08, 2012 2:58 pm
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.