Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us