What I try to achieve is to omit some record numbers. I have a list of records to remove from a dataset (Ex: 5,9,38,..).
5 mean the fifth record in the dataset, etc..
I found that there is the STARTREC and ENDREC that can be used in a OUTFIL group, but this cannot achieve what I wan to do.
With this we can put records from 1..4 to one file, omit rec 5, put 6..8 to another file, omit 9, put 10..37 to another file, etc
But of course, I would like 1..4,6..8,10..37 to be in the same file !
I found a solution, but I don't like it, as I have to refer to the LRECL of the dataset. And as I will use this to process different LRECLs, I don't want to hardcode them in the JCL.
But, here it is for you information, and in case you have an idea on it:
with SEQNUM, I generate a sequence number which I add as the first field of the input data set.
For this, I do : INREC BUILD=(SEQNUM,8,ZD,1,247) --> where 1,247 means append the input dataset (247 is its LRECL, that what I don't want to refer to).
Then, I can use the OMIT command to as OMIT=(1,8,EQ,ZD,5,OR,1,8,EQ,ZD,9,OR,1,8,EQ,ZD,38,...).
After that, OUTREC BUILD=(9,247) so I can remove the sequence number from the output (again I reference the LRECL of the input file)