Parse/Format file based on header value and then skip header
Posted: Wed Oct 07, 2015 6:18 pm
Hi,
I have file that has values as below:
H|FILE1|DATE
D|1234|TEST DATA|2222|....|XXXX|||
D|32|TESTDDD|2324|...|XXX|X||
..............
.............
.............
I would like to build sort card that reads my header record, and identfiy 'FILE1' (it can be 'FILE2 or 3 also some time), and format my remaining output records as below:
1. Output shouldn't contain header record.
2. It shoudl only pick up entries upt 3 pipes delimited.remaining piped delimited data should be ignored.
Output should look as below:
D|1234|TEST DATA|
D|32|TESTDDD|
.................
.................
Can it be achieved by Sort INREC IFTHEN statement etc.,? Pls advise.
I have file that has values as below:
H|FILE1|DATE
D|1234|TEST DATA|2222|....|XXXX|||
D|32|TESTDDD|2324|...|XXX|X||
..............
.............
.............
I would like to build sort card that reads my header record, and identfiy 'FILE1' (it can be 'FILE2 or 3 also some time), and format my remaining output records as below:
1. Output shouldn't contain header record.
2. It shoudl only pick up entries upt 3 pipes delimited.remaining piped delimited data should be ignored.
Output should look as below:
D|1234|TEST DATA|
D|32|TESTDDD|
.................
.................
Can it be achieved by Sort INREC IFTHEN statement etc.,? Pls advise.