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

In sort field in sort jcl, How to mention parital PD


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Sat Jan 13, 2007 12:26 pm
Reply with quote

For example:

Input file contain date field structure s9(9) comp-3 ,length 5 .
data is +60101 , How can i sort only year and month from this data, since it is packed decimal how can i seperate this fields.

Input file :

date(s9(9) comp-3) , char(3)
+60102 , aaa
+60102 , aab
+60103 , aac
+60102 , aav
+60104 , aaa

+60102 means 02/jan/2006

Sort on the basic of year ,month and char(3)

Output should be

+60102 , aaa
+60104 , aaa
+60102 , aab
+60103 , aac
+60102 , aav

How ll mention in the sort fields in jcl .
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: Sat Jan 13, 2007 10:31 pm
Reply with quote

You can use the following DFSORT job to do what you asked for. I assumed your yy years represented 1980-2079, but you can change the Y2PAST value for other ranges (e.g. Y2PAST=2000 for 2000-2099).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION EQUALS,Y2PAST=1980
  SORT FIELDS=(2,3,Y2V,A,6,3,CH,A)
/*


For more information on DFSORT's Y2x formats, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.1?DT=20060615185603

And please don't post the same question in more than one Forum.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Jan 13, 2007 11:12 pm
Reply with quote

Frank Yaeger wrote:
SORT FIELDS=(2,3,Y2V,A,6,3,CH,A)

Code:
  1234567      2345
000060102s>>X'00601s'
3,Y2V: P'yyxx' (X'0yyxxs') Is this format picking up the second, third, fourth and fifth half bytes?
Quote:
The special indicators are P'0...0' (PD zeros) and P'9...9' (PD nines).
What is the significance of special indicators? I couldn't find them referenced in the index....
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: Sun Jan 14, 2007 9:33 pm
Reply with quote

Yes, it's picking up the xyymms value from positions 3-5. So for example, for X'000991231C' it would pick up 099123 and treat it as x9912s where x and s are ignored. The century window is applied to the yy year to determine if it's 19yy or 20yy.

Special indicators: P'0...0' is sorted before all of the dates and P'9...9' is sorted after all of the dates. Even though these are not valid dates per se, some people use them in their data to indicate low and high values of some kind.

For complete details on DFSORT's Year2000 support, see:

www.ibm.com/servers/storage/support/software/sort/mvs/year2000/
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Jan 14, 2007 10:26 pm
Reply with quote

Really cool, thanks for the info,

Bill
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top