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.
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.
Pretty good explanation. I edited it a bit for clarity.
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: