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 

ICETOOL help needed

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


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Mon Aug 18, 2008 10:09 am    Post subject: ICETOOL help needed Reply with quote

Hi all,

I am trying to accomplish the following in one signle step using ICETOOL utility. Could anyone please suggest how I should go about it?.

I have an input file which looks like :
Code:

A   014   C   
A   015   I   
B   052   C   
B   088   C   
B   005   I   

I need to have the output file which should have only rows having "C". But the challenge here is, the numeric field in "I" rows in "A" and "B" should be added as a new column in "A" and "B" record. For Example, my output should look like below
Code:

A   014   C      015   
B   052   C      005   
B   088   C      005   


Please suggest how to do it.

Thanks,
Srini
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Aug 18, 2008 10:28 am    Post subject: Reply with quote

spalanis,



With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this using DFSORT's new WHEN=GROUP function

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
----+----1----+----2----+----3----+----4----+----5----+----6--
A   014   C                                             
A   015   I                                             
B   052   C                                             
B   088   C                                             
B   005   I                                             
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=(1,4,CH,A,11,1,CH,D)     
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(11,1,CH,EQ,C'I'),     
  PUSH=(15:5,3))                                         
  OUTFIL OMIT=(11,1,CH,EQ,C'I')     
/*


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

If you don't have PTF UK90013 installed , then you can use the following DFSORT ICETOOL job to get the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD *                                               
----+----1----+----2----+----3----+----4----+----5----+----6--
A   014   C                                                   
A   015   I                                                   
B   052   C                                                   
B   088   C                                                   
B   005   I                                                   
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  SPLICE FROM(IN) TO(OUT) ON(1,4,CH) KEEPNODUPS KEEPBASE -   
  WITHALL WITH(01,14) USING(CTL1)                             
//CTL1CNTL DD *                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(15:3C'0')),               
        IFTHEN=(WHEN=(11,1,CH,EQ,C'I'),OVERLAY=(15:5,3))     
  SORT FIELDS=(1,4,CH,A,15,3,CH,D)                           
  OUTFIL OMIT=(11,1,CH,EQ,C'I')                               
/*


Hope this helps...

Cheers
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Mon Aug 18, 2008 12:10 pm    Post subject: Reply with quote

Hi Kolusu,

This solution works. Thanks for your help.

Thanks,
Srini
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