View previous topic :: View next topic
|
Author |
Message |
gs_chhatwal
New User
Joined: 19 Jul 2006 Posts: 3 Location: New Delhi
|
|
|
|
Could anybody explain SORT FIELDS=(21,12,PD,A)
Under the second parameter of fields do we need to put exact lenght of the field or we need to do half of the field i.e. PIC S9(12) COMP - 3? Please explain. |
|
Back to top |
|
|
gs_chhatwal
New User
Joined: 19 Jul 2006 Posts: 3 Location: New Delhi
|
|
|
|
Please reply me soon as I need to attend Interview |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
We have to put the complete length and not the half length.
Thanks,
Muthuvel. |
|
Back to top |
|
|
ibmmainframe1
New User
Joined: 26 Jul 2005 Posts: 64 Location: India
|
|
|
|
pd=packed decimal. sorting comp fields |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Could anybody explain SORT FIELDS=(21,12,PD,A) |
This is a DFSORT statement to sort a 12-byte PD (packed decimal) field starting in position 21 in ascending order. A 12-byte PD field looks like this in hexadecimal:
Code: |
ddddddddddddddddddddddds
|
where each d is 0-9 and s is the sign (usually C or F for positive or D for negative). Note that the value has 23 digits.
Quote: |
Under the second parameter of fields do we need to put exact lenght of the field or we need to do half of the field i.e. PIC S9(12) COMP - 3? Please explain. |
The length of a PIC S9(n) COMP-3 field is actually (n/2)+1. So a PIC S9(12) COMP-3 field has a length of 7, not 12. A 7-byte PD field looks like this in hexadecimal:
Note that the value has 13 digits. For an S9(12) COMP-3 field, the leading digit would be 0.
So you would use 21,7,PD,A.
For a table showing the relationship between COBOL data types and DFSORT formats, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603 |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Why you are using PIC its a cobol systax, JCL doesn't have the variables
for your another question
SORT FIELDS=(21,12,PD,A)
Sort from 21 position to a length of 12 which is in packed decimal (Comp-3 for your ref) in acending order |
|
Back to top |
|
|
gs_chhatwal
New User
Joined: 19 Jul 2006 Posts: 3 Location: New Delhi
|
|
|
|
Thanks a lot Muthuvel, Frank and Kiran G R for your valuable information. |
|
Back to top |
|
|
|