I have an input file which has some records. It has a header and trailer. I would like to split the file based on two consecutive characters present in the detail records. The characters can be either 'AB' or 'AC'. The two files hence generated should have header copied from the original file. After splitting the trailer has to be updated to the new files with the new count. The trailer also has some text at the beginning and at the end of the trailer record the count has to be updated( count being of 8 character length). Kindly help
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Your description is too vague.
Please show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
Tell or show us what identifies the header and trailer.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
000 20110606165432
0011134567860123456AB E 145190273033344
0011222333344445555AB E 145190273033344
0011139567890123456AC E 145190273033344
0011222333244445555AC E 145190273033344
999999999999999999900000004
The starting position of the field is 20, length is 2 and the type is character
The output files
File1:
000 20110606165432
0011134567860123456AB E 145190273033344
0011222333344445555AB E 145190273033344
999999999999999999900000004
File2:
000 20110606165432
0011139567890123456AC E 145190273033344
0011222333244445555AC E 145190273033344
999999999999999999900000004
Sorry... the output files should have the new count
Input file layout:
000 20110606165432
0011134567860123456AB E 145190273033344
0011222333344445555AB E 145190273033344
0011139567890123456AC E 145190273033344
0011222333244445555AC E 145190273033344
999999999999999999900000004
The starting position of the field is 20, length is 2 and the type is character
The output files
File1:
000 20110606165432
0011134567860123456AB E 145190273033344
0011222333344445555AB E 145190273033344
999999999999999999900000002
File2:
000 20110606165432
0011139567890123456AC E 145190273033344
0011222333244445555AC E 145190273033344
999999999999999999900000002
Can we update the output files header with the type of accounts that are present, meaning, if the type is AB it should be present in the 19 position of the header.