MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Overlay the Key for other records using ICETOOL?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Ambi
Beginner


Joined: 14 Jun 2005
Posts: 5
Topics: 3

PostPosted: Tue Jun 14, 2005 7:59 am    Post subject: How to Overlay the Key for other records using ICETOOL? Reply with quote

Hi ,

I want to overlay the Key to the next record using ICETOOL ..

Here is the example

Code:

KEY1       A
           B
           C
KEY2       A
           B
           C
           D
KEY3       A
           B
           C


the output I am expecting ,

Code:

KEY1       A
KEY1       B
KEY1       C
KEY2       A
KEY2       B
KEY2       C
KEY2       D
KEY3       A
KEY3       B
KEY3       C


Can anybody give a clue ..

Thank You
Ambi.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue Jun 14, 2005 9:08 am    Post subject: Reply with quote

Ambi,

Check the 13th post from the bottom. This does almost everything you asked for, except you would miss the HDR record. I am assuming that KEEPBASE of splice operator will able to retain the base record also.

http://www.mvsforums.com/helpboards/viewtopic.php?t=1850&highlight=splice

If you have trouble figuring it out, let me know and I will post a solution.

Thanks

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue Jun 14, 2005 9:55 am    Post subject: Reply with quote

Ambi,

If your input file is of FB recfm and 80 bytes in length the following JCL will give you the desired results even without the KEEPBASE parm.
Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//DFSMSG   DD SYSOUT=*                                       
//TOOLMSG  DD SYSOUT=*                                       
//IN       DD *                                               
KEY1 A                                                       
B                                                             
C                                                             
KEY2 A                                                       
B                                                             
C                                                             
D                                                             
KEY3 A                                                       
B                                                             
C                                                             
//HDR      DD DSN=&HDR,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//DET      DD DSN=&DET,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//BASE     DD DSN=&BASE,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//CON1     DD DSN=*.HDR,VOL=REF=*.HDR,DISP=OLD               
//         DD DSN=*.DET,VOL=REF=*.DET,DISP=OLD               
//T3       DD DSN=&T3,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)     
//CON2     DD DSN=*.BASE,VOL=REF=*.BASE,DISP=OLD             
//         DD DSN=*.T3,VOL=REF=*.T3,DISP=OLD                 
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(IN)  USING(CTL1)                                 
  SORT FROM(CON1) USING(CTL2)                                 
  SPLICE FROM(CON2) TO(OUT) -                                 
          ON(86,8,CH) -                                       
          WITH(1,80) -                                       
          WITHALL  USING(CTL3)                               
//CTL1CNTL DD *                                               
  INREC  FIELDS=(1,80,SEQNUM,8,ZD)                           
  OUTFIL FNAMES=HDR,INCLUDE=(1,3,CH,EQ,C'KEY'),               
  OUTREC=(5X,6,75,8C'0',SEQNUM,8,ZD,C'H',1,5)                 
  OUTFIL FNAMES=DET,SAVE,                                     
  OUTREC=(5X,1,75,81,8,SEQNUM,8,ZD,C'Z',5X)                   
  OUTFIL FNAMES=BASE,INCLUDE=(1,3,CH,EQ,C'KEY'),             
  OUTREC=(5X,6,75,1,5,SEQNUM,8,ZD)                           
//CTL2CNTL DD *                                               
  OPTION EQUALS                                               
  INREC  FIELDS=(1,96,(81,8,ZD,SUB,89,8,ZD),M11,LENGTH=8,97,6)
  SORT   FIELDS=(97,8,ZD,A)                                   
  OUTFIL FNAMES=T3,OUTREC=(1,80,106,5,97,8)                   
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT,                                         
  OUTREC=(81,5,6,75)                                         
/*                                                           


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jun 14, 2005 10:19 am    Post subject: Reply with quote

Ambi,

If you have z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can do this more easily and efficiently using DFSORT's new IFTHEN, OVERLAY and KEEPBASE functions as shown in the DFSORT/ICETOOL job below. 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/

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN  DD *
KEY1       A
           B
           C
KEY2       A
           B
           C
           D
KEY3       A
           B
           C
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT  DD SYSOUT=*
//TOOLIN   DD *
  COPY FROM(IN) TO(T1) USING(CTL1)
  SPLICE FROM(T1) TO(OUT) ON(81,8,ZD) -
    WITHALL WITH(5,76) KEEPBASE USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'KEY'),
                OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(89:SEQNUM,8,ZD,
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,OUTREC=(1,80)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ambi
Beginner


Joined: 14 Jun 2005
Posts: 5
Topics: 3

PostPosted: Tue Jun 14, 2005 10:21 am    Post subject: Reply with quote

Kolusu,

Thatz Great. It is working .. I did change little bit as I dont have Key identifier. Instead of KEY1 , KEY2 I have some Employee Serials .. But i am able to manage.

Thanks Once again Kolusu.

Cheers... Ambi
Back to top
View user's profile Send private message
Ambi
Beginner


Joined: 14 Jun 2005
Posts: 5
Topics: 3

PostPosted: Tue Jun 14, 2005 1:01 pm    Post subject: Reply with quote

Frank,

I have tried your solution and It worked very well .. So I have the DEC 2004 PTF installed. I have to play around with this now ..

Thank you Frank...

Cheers ... Ambi
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group