I have a dataset with one record. The record layout is as follows.
I have a number in a field starting from position 1 thru 13 (with leading zeroes). Another number starting in position 18 (no leading zeroes). I want to take the number from position 18, subtract 1 and then compare with the number in position 1 thru 13. If the numbers are not equal, I want to set the RC (return code) to 4 or greater.
I do not have DFSORT, but have SYNCSORT and FILEAID. Can someone suggest a way to achieve this.
Thanks for posting this code. It worked well. I have a question though. The number of digits in the count value, here 10124, can vary. How does the statement OUTREC=((18,05,ZD,SUB,+1),1,50,80:X) would look?
If the input is as given above all you need to change is
OUTREC=((18,X,ZD,SUB,+1),1,50,80:X) where X is the maximum length of your numeric field (Assuming it's less than or equal to 15 - In SYNCSORT the maximum for a ZD field is 15 digits)