I have a flat file with fixed length of 778 byte. And there are certain types of records like 'A1', 'F1', 'C1', 'G1', 'M1', 'M2' etc. starting with 1st byte; with 2 variants like '20' & '30' ( from 5th byte say ).
But I need to sort the file with certain keys among which one of the keys(with 9 bytes) position is different in different types of record.
Here I tried but the code doesn't work out..i am trying to Push the field's value from different position in the last byte & trying to sort afterwards.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
D Rishi,
Welcome to the forums.
You need to use OVERLAY instead of PUSH. PUSH is not applicable in this context. PUSH is used when you need to GROUP a set of records using WHEN=GROUP.
If it does n't work, post your Syntax error and SYSOUT messages here using "Code" tags.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Also you need to omit the IFOUTLEN parameter as well. If you don't need the additional 9 bytes at pos-779 to be written in output, you can choose not to select it in the OUTREC pass.
Well, along with IFOUTLEN, you removed INREC, so you don't have a valid control statement. You need INREC:
Code:
INREC IFTHEN=(...
If you want more help on this, you need to explain in more detail what it is exactly you're trying to do. 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. If the input file can have duplicates within it, show that in your example.