Writing multiple record types flat file
Posted: Mon Apr 10, 2017 1:33 pm
Hello, I've been tasked with extracting data and sending it via a flat file to a vendor in a particular format. The challenge for me is that there are multiple record types in the file. I've only ever worked with one set of column definitions. This file consists of several different record types. One for the header and footer and three for detail data. The first two characters of each record comprise the first column which is the record type. The second column is an ID field or column. And the rest vary in number and type.
The data in the output file would look something like this:
FH LOAD 20170410 2.2 3365 1
CD 3365 1 23172 Doe, John
LD 3365 1 0000001 35784629
HL 3365 1 0000001 14723 N N
FF LOAD
How can I transform my input data, which is one record type, into these different record types (the CD,LD,HL)? The header and footer will be hardcoded. I read some posts regarding the complex flat file stage and I played around with it a little. Correct me if I am wrong, but that stage only allows multiple records types when reading (source) and NOT writing. See this quote from the IBM website "You cannot write to MVS data sets or to files that contain multiple record types."
Would any of the stages under "Restructure" work?
Thanks!
The data in the output file would look something like this:
FH LOAD 20170410 2.2 3365 1
CD 3365 1 23172 Doe, John
LD 3365 1 0000001 35784629
HL 3365 1 0000001 14723 N N
FF LOAD
How can I transform my input data, which is one record type, into these different record types (the CD,LD,HL)? The header and footer will be hardcoded. I read some posts regarding the complex flat file stage and I played around with it a little. Correct me if I am wrong, but that stage only allows multiple records types when reading (source) and NOT writing. See this quote from the IBM website "You cannot write to MVS data sets or to files that contain multiple record types."
Would any of the stages under "Restructure" work?
Thanks!