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
 

 

DFSORT help needed.

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

New User


Joined: 09 Mar 2006
Posts: 2

PostPosted: Fri Mar 10, 2006 12:38 pm    Post subject: DFSORT help needed.
Reply with quote

I have a question.My inpyt records are like this

Code:

Key1 data1 data2 data3
           data4 data5 data6
Key2 data1 data2 data3
           data4 data5 data6
           data7 data8 data9


I want output as

Code:

Key1 data1 data2 data3
key1  data4 data5 data6
Key2 data1 data2 data3
Key2  data4 data5 data6
Key2  data7 data8 data9


Pls help me in this
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 10, 2006 9:47 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the one below to do what you asked for. I assumed your input file has RECFM=FB and LRECL=30, but you can change the job appropriately for other attributes. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN, OVERLAY and KEEPBASE functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 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 Dec, 2004 PTF, see:

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

For more information on using this "group" technique, see the following two Smart DFSORT Tricks:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#d01

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#d02

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=...  input file (FB/30)
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT  DD DSN=...  output file (FB/30)
//TOOLIN   DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(31,8,ZD) KEEPBASE -
  WITHALL WITH(5,19) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(31:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'Key'),
                OVERLAY=(31:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
         OVERLAY=(39:SEQNUM,8,ZD,
                 31:31,8,ZD,SUB,39,8,ZD,M11,LENGTH=8))
  OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C' '),
         BUILD=(7:12,17,31:31,16))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,30)
/*
Back to top
View user's profile Send private message
shammy

New User


Joined: 09 Mar 2006
Posts: 2

PostPosted: Tue Mar 14, 2006 3:09 pm    Post subject: Re: DFSORT help needed.
Reply with quote

Thanks It works
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 get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Help Needed with View Direct shailesh_do CA Products 2 Wed Jul 13, 2016 10:39 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


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