I want to sort a VB file, the MIN length is 350 bytes, and the MAX length is 2500 bytes, now I want to sort out some records based on condition,start at position 1613, length 2, how to achieve that?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
now I want to sort out some records based on condition,start at position 1613, length 2
It's not clear what you mean by this. Do you mean you want to sort on a field at position 1613-1614 (SORT), or do you mean you want to only keep records where position 1613-1614 has a specific value (INCLUDE), or what?
You need to state more clearly what you want to do.
Note that for a VB input file, the RDW is in positions 1-4, so the first data byte starts in position 5, not in position 1. So if you are counting the RDW, position 1613 would be the correct position. But if you're not counting the RDW, the correct position would be 1617 (1613+4).
Also, for VB records, you may have to handle "short" records (records with a length less than the maximum last position you define). How you would handle "short records" depends on what you want to do.
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: