For all the records in the input file, we are generating the 8-byte ZD sequence number in the position 122. The sequence no starts from 00000000 and increments by 1.
Code:
130:122,8,ZD,MOD,+18,TO=ZD,LENGTH=2)),
Puts the result in position 130
122,8,ZD,MOD,+18 -> This gets the remainder (modulus) of the 8 byte ZD seqnum divided by 18.
TO=ZD,LENGTH=2 -> The reminder is stored with length 2.
The sequence number starts from 0 and hence your 18th record will have the sequence number as 00000017. The remainder is 17 When the sequence number in the 18th record, 36th record, etc is divided by 18.
When the remainder is 17, we are building the first 121 bytes (required bytes) and then writing a new blank line (/,X). The other records are just copied without changes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Aaru,
Pretty good explanation. I edited it a bit for clarity.
Prabha,
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: