Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: In sort field in sort jcl, How to mention parital PD
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 Moderator


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

PostPosted: Sat Jan 13, 2007 10:31 pm    Post subject:
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:

http://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: 3158
Location: Tucson AZ

PostPosted: Sat Jan 13, 2007 11:12 pm    Post subject:
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 Moderator


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

PostPosted: Sun Jan 14, 2007 9:33 pm    Post subject:
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:

http://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: 3158
Location: Tucson AZ

PostPosted: Sun Jan 14, 2007 10:26 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us