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
 

 

Sort records in Ascending Order

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

New User


Joined: 09 Feb 2007
Posts: 4
Location: India

PostPosted: Wed Feb 28, 2007 7:03 pm    Post subject: Sort records in Ascending Order
Reply with quote

Hi,

I have a file, i need to keep in order, Could you please any one help to solve this.

My requirement is

Input File:

Line10
xxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyy
ddddddddddddddddd
Line01
dddddddddddddddd
dddddddddddddddd
yyyyyyyyyyyyyyyy
Line11
eeeeeeeeeeeeeeeee
yyyyyyyyyyyyyyyy
djfjflfjsdfjsdf
dflsdkfjsdlfj
Line02
sdfsddfsdfsdf
sdfsdfsfdsfwerewr

Out put file should be like the follwing(it should be Sorted order based on LINE01/02/03....

Line01
dddddddddddddddd
dddddddddddddddd
yyyyyyyyyyyyyyyy
Line02
sdfsddfsdfsdf
sdfsdfsfdsfwerewr
Line10
xxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyy
ddddddddddddddddd
Line11
eeeeeeeeeeeeeeeee
yyyyyyyyyyyyyyyy
djfjflfjsdfjsdf
dflsdkfjsdlfj

If any suggestion, Please welcome

Many thanks in advance
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: Wed Feb 28, 2007 9:15 pm    Post subject:
Reply with quote

What is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
rama9

New User


Joined: 09 Feb 2007
Posts: 4
Location: India

PostPosted: Fri Mar 02, 2007 12:07 pm    Post subject: Re: Sort records in Ascending Order
Reply with quote

Hi,

Thanks for your reply..

RECFM= FB and LRECL=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 Mar 02, 2007 9:39 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT      DD DSN=...  output file (FB/80)
//TOOLIN   DD *
SPLICE FROM(IN) TO(T1) ON(81,8,ZD) -
  WITHALL WITH(1,80) KEEPBASE USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,4,CH,EQ,C'Line'),
                OVERLAY=(81:SEQNUM,8,ZD,98:1,8)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(89:SEQNUM,8,ZD,98:8X,
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(98,8,UFF,A)
  OUTREC BUILD=(1,80)
/*
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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