I have a flat file, variable length records, different layout for every record. If in the first record the pos,let's say, 10th is equal "Y",- than I need to copy the whole file as is (like the OPTION COPY in sort). If the 10th position is not "Y". I need to bypass all records including the first one, create an empty file. Does someone know, is it possible to accomplish using ICETOOLs?
Thanking in advance.
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=VB and LRECL=80, but the job can be changed appropriately for other attributes. I also assumed that when you said the 10th position you were not counting the RDW, so the actual position is 10+4 = 14. If not change 14 to 10.
You said "I have a flat file, variable length records". I assumed that meant your input file is VB. So I set up the job to handle VB records. 7:5 at the end of the INREC statement gives us the bytes from 5 to the end of the record. This is the correct way to handle VB records. 5,76 would require that every record have 76 bytes starting at position 5, which may not be the case for VB records.
When I run the job with VB records, it works fine. Given the error message you received, my first guess would be that you really have FB input records rather than VB input records. Is that the case?
Thanks a lot for your help. You are absolutely right. For VB it was perfectly fine. My file is FB, each record was appended to 750b with spaces.
This is that I have:
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,1,CH) WITHALL WITH(3,750) KEEPBASE - USING(CTL1)
//CTL1CNTL DD *
I modified it and made it with no errors, to:
SPLICE FROM(IN) TO(OUT) ON(751,1,CH) WITHALL WITH(1,750) KEEPBASE -
//CTL1CNTL DD *
Now it still does NOT work: it includes only the first record...