IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Please explain the PD parameter field under JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gs_chhatwal

New User


Joined: 19 Jul 2006
Posts: 3
Location: New Delhi

PostPosted: Wed Sep 13, 2006 4:11 pm
Reply with quote

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
View user's profile Send private message
gs_chhatwal

New User


Joined: 19 Jul 2006
Posts: 3
Location: New Delhi

PostPosted: Wed Sep 13, 2006 4:36 pm
Reply with quote

Please reply me soon as I need to attend Interview
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Wed Sep 13, 2006 6:25 pm
Reply with quote

We have to put the complete length and not the half length.

Thanks,
Muthuvel.
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Wed Sep 13, 2006 8:34 pm
Reply with quote

pd=packed decimal. sorting comp fields
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 13, 2006 8:43 pm
Reply with quote

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:

Code:

ddddddddddddds


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
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Wed Sep 13, 2006 10:02 pm
Reply with quote

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
View user's profile Send private message
gs_chhatwal

New User


Joined: 19 Jul 2006
Posts: 3
Location: New Delhi

PostPosted: Thu Sep 14, 2006 10:22 am
Reply with quote

Thanks a lot Muthuvel, Frank and Kiran G R for your valuable information.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top