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

DFSORT help needed.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Mar 10, 2006 9:47 pm
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:

Use [URL] BBCode for External Links

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

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

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
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 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 Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top