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

How to sort a DATE field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Apr 22, 2005 10:50 pm
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:

Use [URL] BBCode for External Links

You can access all of the DFSORT books online at:

Use [URL] BBCode for External Links

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top