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
 

 

How to sort a DATE field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Suthandira

New User


Joined: 06 Apr 2005
Posts: 10

PostPosted: Fri Apr 22, 2005 2:00 pm    Post subject: How to sort a DATE field
Reply with quote

1. Can you please tell me how can I sort a DATE field?

for ex

12/03/2005
09/12/2004 .......


2. What is the difference between Syncsort and Dfsort?

Regards,
Devi.
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: Fri Apr 22, 2005 10:50 pm    Post subject:
Reply with quote

1. Your date field is in the form mm/dd/yyyy. To sort it correctly, you must specify yyyy, mm and dd, in that order. You can use a DFSORT job like the following. I assumed the date starts in position 1, but you can change the job accordingly for other starting positions.

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...   output file
//SYSIN DD *
* Sort mm/dd/yyyy on yyyy, mm and dd.
  SORT FIELDS=(7,4,CH,A,1,2,CH,A,4,2,CH,A)
/*


2. DFSORT is IBM's sort product. Syncsort is Syncsort, Inc's sort product.
For complete details on DFSORT, go to the DFSORT website at:

www.ibm.com/storage/dfsort/

You can access all of the DFSORT books online at:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

If you, or anyone else on this list, would like me to send you some files prepared by the DFSORT Team that discuss what we see as the advantages of DFSORT over Syncsort, as well as considerations for migrating from DFSORT to Syncsort, send me a note offline (yaeger@us.ibm.com). Please include "DFSORT" somewhere in your Subject line to catch my attention.
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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