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

Regarding DFSORT utility


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

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Fri Aug 26, 2005 2:26 pm
Reply with quote

Hi

here is my requirement.

i've a Sequential file which has DATE field. and format of the date field is:MM/DD/YYYY. for eg:08/26/2005. but my requirement is i want to sort the data based on the date(Year part) filed. can you guys please provide me the JCL for the same??? and i want to sort it on Descending order.

For Eg:

08/26/2005
08/10/2004
01/12/2005
10/10/2003

output :
---------
08/26/2005
01/12/2005
08/10/2004
10/10/2003
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Fri Aug 26, 2005 2:42 pm
Reply with quote

Hi Ykishore,

You can code like this.

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,D,1,2,CH,D,4,2,CH,D)
/*


Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Fri Aug 26, 2005 2:48 pm
Reply with quote

Hi

Try this code code

//SORTTST JOB (ACCT#),'SORT ',NOTIFY=&SYSUID,CLASS=T,MSGCLASS=X
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=Inputdatase name,DISP=SHR
//SORTOUT DD DSN=Out put dataset name,DISP=SHR

//SYSIN DD *
SORT FIELDS=(7,4,CH,D)
/*
//* where year part start from 7 the column
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*


Regards
Rupesh
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Fri Aug 26, 2005 3:13 pm
Reply with quote

refer this link which deals the same post.
http://www.ibmmainframes.com/viewtopic.php?t=2322&highlight=date+sort

hope this helps
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Aug 26, 2005 8:42 pm
Reply with quote

Which is the difference between the method above and
the use of inrec as(in term of performance):

Code:
INREC OVERLAY=(81:7,4,1,2,4,2)
SORT FIELDS=(81,8,D),FORMAT=CH
OUTREC FIELDS=(1,80)

?
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 Aug 26, 2005 9:14 pm
Reply with quote

In general, the job with just the SORT statement will be more efficient than the job with the INREC, SORT and OUTREC statement because INREC and OUTREC require extra data movement.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Aug 26, 2005 9:22 pm
Reply with quote

So, it's better to sort 3 separate keys instead of creating one contiguous key to sort with INREC?
Thanks a lot.
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 Aug 26, 2005 9:51 pm
Reply with quote

In general, yes (there are always exceptions). That's especially true for large keys because adding a copy of the keys at the end of the record with INREC will increase the amount of data being sorted. For example if you have a 500-byte record with 3 100-byte keys and you copy those keys at the end, you've now increased the size of the records to sort from 500 bytes to 800 bytes which is a significant increase in the amount of data being sorted.
Back to top
View user's profile Send private message
ykishore

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Mon Aug 29, 2005 6:51 pm
Reply with quote

Hi all

Thanx alot!!!!
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top