I've a sample input file and output files are as below.
My input file is
..........PICC20090327234954JES22UTO
09IN02884219003000300326046340840031FLC 000102880
09IN02884219003000300326072480460031FLC 000102880
09IN02884219003000300326072492950031FLC 000102880
14NJ50461973948999093397394899909331FLCAEA 000150460
14NJ50462973948999857597394899985751FLCVMA 000150460
..........PICC20090327234954JES22UTO00001049658
09IN02884219003000300326046340840031FLC 000102880
09IN02884219003000300326072480460031FLC 000102880
09IN02884219003000300326072492950031FLC 000102880
14NJ50461973948999093397394899909331FLCAEA 000150460
14NJ50462973948999857597394899985751FLCVMA 000150460
..........PICC20090327234954JES22UTO00001049658
OUPUT File after excluding 14NJ and having only 09IN in output file after reformating should be as below
..........PICC20090327234954JES22UTO
780821900300032604634084003 02880288Y260463420090327
780821900300032607248046003 02880288Y260724420090327
780821900300032607249295003 02880288Y260724420090327
..........PICC20090327234954JES22UTO00001049658
780821900300032604634084003 02880288Y260463420090327
780821900300032607248046003 02880288Y260724420090327
780821900300032607249295003 02880288Y260724420090327
..........PICC20090327234954JES22UTO00001049658
In output last 8 characters are from header date.
The complete requirement is as below for above example.
I've a input file. From this file I need to include only records having ‘09IN’ in first 4 characters in file and reformat the file as below.
The format of the output file is as below.
POS 1-4 IN REFORMATTED FILE SHOULD BE Pos 1-2 AND Pos 3-4 OF INPUT FILE AND Value should always be set to 7808
Pos 5-14 IN REFORMATTED FILE SHOULD BE Pos 10-12 ,Pos 13-15 and
Pos 16-19 of input file
Pos 15-24 IN REFORMATTED FILE SHOULD BE Pos 23-25,Pos 26-28 and
Pos 29-32 of input file
Pos 25-29 IN REFORMATTED FILE SHOULD B Pos 20-22 of input file
Pos 30-39 in reformatted file should be Reserved (Populate w/ spaces)
Pos 40-43 in reformatted file should be Pos 5-8 of input file
Pos 44-47 in reformatted file should be Pos 50-53 of input file
Pos 48 in reformatted file should be Populate ‘Y’
Pos 49-54 in reformatted file should be Pos 23-25 and Pos 26-28 of input file
Pos 55 in reformatted file should be Pos 9 of input file
Pos 56-63 in reformatted file should be Pos 15-22 in input header record (which is date)
Pos 64-70 in reformatted file should be Populate spaces
Please suggest me the sort code to do this.
In input dataset Header is starting with low values(hex 0000) and Trailer with high values(hex FFFF). I need to include this header and trailer along with detail records, but detail records should be only '09IN'
"Pos 56-63 in reformatted file should be Pos 15-22 in input trailer record "
Please suggest me the sort code.
Thanks & Regards
Tvssv