why 25128 followed by 25100?
the parameter is below
000021 //SYSIN DD *
000022 SORT FIELDS=(5,5,CH,A)
000023 END
000024 /*
the result is below
000017 2512500000000000
000018 2512800000000000
000019 j 2510045600000000
000020 j 2510045600000000
It seems you only show us your output. It could easier for us to help you to also show us a complete example of you I/O files and put them between ubb codes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
why 25128 followed by 25100?
Well, 25100 appears to have a j before the number. It's impossible to tell what your input really looks like from what you posted. Try using this DFSORT job to display your input data in hex so you/we can see what it really looks like:
Dave,I think maybe the first two byes is the length of the record,but i don't know what the 3rd and 4th byte mean.
Yaeger,I can't connect to the mainframe in home,i will try to use your code tomorrow
I had typed in HEX in command line before and get the result displayed in hex mode.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Your hex display seems to show the following VB records:
Code:
Length
Hex Dec Data
38 56 2512500000000000...
38 56 2512800000000000...
91 145 2510045600000000...
The RDW is in positions 1-4 and the Data starts in position 5.
When I use DFSORT to sort these input records with:
Code:
SORT FIELDS=(5,5,CH,A)
I get the following output:
Code:
Length
Hex Dec Data
91 145 2510045600000000...
38 56 2512500000000000...
38 56 2512800000000000...
Note that 25100 is first.
The results you show don't actually look like they've been sorted so I might guess that you're actually doing a COPY rather than a SORT. Perhaps you're overriding the SYSIN control statements you show with control statements from another source (like DFSPARM).
Please show us your //SYSOUT DD output so we can see what's really going on.
If you like, you can send me the information offline (yaeger@us.ibm.com) instead of posting it here. If you do, please put "DFSORT" somewhere in your Subject line to catch my attention.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I worked with William offline to figure this one out. It turns out his VSAM input file has an embedded RDW in the first 4 bytes, so the value he wants to sort is actually in bytes 5-8 of the data rather than in bytes 1-4 of the data. Therefore, when treating the VSAM data set as VB, the needed SORT statement is: