jcl sort the ps on the date



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

jcl sort the ps on the date

Postby vathota » Thu Aug 06, 2009 2:13 am

hi

i have got a ps file which has the date field which is unloaded directly from db2 tables. i need to sort this file on the date which is in the format yyyy-mm-dd. i am trying to do sort on this field. here is example what i am trying to do ...
SORT FIELDS = (147,10,CH,A). but it is not sorting properly. so can you help me how the date is handled in jcl sort ?

date starts in column 147 ranging to 156.
vathota
 
Posts: 2
Joined: Thu Aug 06, 2009 2:07 am
Has thanked: 0 time
Been thanked: 0 time

Re: jcl sort the ps on the date

Postby Frank Yaeger » Thu Aug 06, 2009 2:21 am

If your dates are all character values of the form yyyy-mm-dd and that field starts in position 147, that would be the correct SORT statement.

If it is not sorting properly, then either:

1) You are not specifying the correct starting position for the field. One common mistake here is that the input file has RECFM=VB, and you are not accounting for the RDW in positions 1-4. If that's the case, the starting position would be 151, not 147.
2) You do not really have proper character values of the form yyyy-mm-dd.

If you need more help, use these DFSORT control statements to display the values from the first 8 records (in hex) and post here:

   OPTION COPY,STOPAFT=8
   INREC BUILD=(147,10,HEX)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: jcl sort the ps on the date

Postby vathota » Thu Aug 06, 2009 2:41 am

thank you. i am gonna try with the character mode.
vathota
 
Posts: 2
Joined: Thu Aug 06, 2009 2:07 am
Has thanked: 0 time
Been thanked: 0 time

Re: jcl sort the ps on the date

Postby Frank Yaeger » Thu Aug 06, 2009 5:31 am

i am gonna try with the character mode.


I have no idea what you mean by that. Good luck.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post