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
 

 

Regarding DFSORT utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Regarding DFSORT utility
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    Post subject: Re: Reg: DFSORT
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: 464

PostPosted: Fri Aug 26, 2005 2:48 pm    Post subject: Re: Reg: DFSORT
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: 436
Location: chennai, India

PostPosted: Fri Aug 26, 2005 3:13 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 26, 2005 9:14 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 26, 2005 9:51 pm    Post subject:
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    Post subject:
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    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 How to Use DebugTool CodeCoverage Uti... neo4u IBM Tools 0 Thu Jun 22, 2017 6:38 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts HLIST Utility In Batch Virendra Shambharkar TSO/ISPF 4 Fri Apr 07, 2017 3:38 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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