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
 

 

Can i do it by ICETOOL

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

New User


Joined: 27 Jul 2005
Posts: 35
Location: Chennai

PostPosted: Fri May 05, 2006 3:18 pm    Post subject: Can i do it by ICETOOL
Reply with quote

Hi,

I have 2 files.Need to compare these 2 file.IF the first 9 fileds are matching in both the file then i need to select certain fields from the 2 file and write that data of file2 into an output file.
file 2 can contain duplicate records.
ex:

File 1

001234567102245
011134571022355
021334432112345

File 2
001234567XXXX111TEST01ADDRESS01
001234567XXXX222TEST01ADDRESS01
011134571YYYY333TEST02ADDRESS02
021334432ZZZZ444TEST03ADDRESS03
022333443AAAA555TEST04ADDRESS04

DESIRED OUTPUT

001234567TEST01ADDRESS01
001234567TEST01ADDRESS01
011134571TEST02ADDRESS02
021334432TEST03ADDRESS03

Can anyone give me the jcl for the above requirement

Thanks
Abi
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 May 05, 2006 8:23 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you want. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1    DD DSN=...  input file1 (FB/80)
//IN2    DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,9,CH) -
  WITHALL WITH(1,81) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'11')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'22')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'21'),
    BUILD=(1,9,17,15,80:X)
/*
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Sun May 07, 2006 12:04 am    Post subject: Re: Can i do it by ICETOOL
Reply with quote

Abi,

With the new UK90007 Dfsort Ptf from April 2006, we are able to use INREC with SPLICE.
We can concatenate the files together with adding a separator between them. So we can apply a logic
to suppress a pass.
Code:

//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//OUTX     DD SYSOUT=*
//TOOLIN   DD *
  SPLICE FROM(IN) TO(OUTX) ON(1,9,CH) -
  WITHALL WITH(1,81) USING(ICE0)
/*
//IN       DD *
001234567102245
011134571022355
021334432112345
/*
//         DD *
FRANK YAEGER
/*
//         DD *
001234567XXXX111TEST01ADDRESS01
001234567XXXX222TEST01ADDRESS01
011134571YYYY333TEST02ADDRESS02
021334432ZZZZ444TEST03ADDRESS03
022333443AAAA555TEST04ADDRESS04
//ICE0CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
                OVERLAY=(81:SEQNUM,5,ZD,SEQNUM,5,ZD)),
        IFTHEN=(WHEN=(1,12,CH,NE,C'FRANK YAEGER'),
                OVERLAY=(86:SEQNUM,5,ZD,
                         81:86,5,ZD,SUB,81,5,ZD,M11,LENGTH=5),
                         HIT=NEXT),
        IFTHEN=(WHEN=(81,5,CH,EQ,C'00000'),
                BUILD=(1,80,C'11')),
        IFTHEN=(WHEN=(81,5,CH,EQ,C'00001'),
                BUILD=(1,80,C'22'))
  OUTFIL FNAMES=OUTX,INCLUDE=(81,2,CH,EQ,C'21'),
         BUILD=(1,9,17,15,80:X)
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: Sun May 07, 2006 5:08 am    Post subject:
Reply with quote

Actually, in this particular case, the simpler one pass version using INREC with SPLICE shown in the DFSORT/ICETOOL job below will work too. It's based on the assumption that both files have the same RECFM and LRECL, and that the first file can be distinguished from the second file by blanks in 16-17.

Code:

//S1    EXEC PGM=ICETOOL                                         
//TOOLMSG   DD SYSOUT=*                                           
//DFSMSG    DD SYSOUT=*                                           
//CON    DD *                                                     
001234567102245                                                   
011134571022355                                                   
021334432112345                                                   
091334432112345                                                   
//       DD *                                                     
001234567XXXX111TEST01ADDRESS01                                   
001234567XXXX222TEST01ADDRESS01                                   
011134571YYYY333TEST02ADDRESS02                                   
021334432ZZZZ444TEST03ADDRESS03                                   
022333443AAAA555TEST04ADDRESS04                                   
//OUT DD SYSOUT=*                                                 
//TOOLIN DD *                                                     
SPLICE FROM(CON) TO(OUT) ON(1,9,CH) -                             
  WITHALL WITH(1,81) USING(CTL1)                                 
/*                                                               
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(16,2,CH,EQ,C' '),OVERLAY=(81:C'11')),       
        IFTHEN=(WHEN=NONE,OVERLAY=(81:C'22'))                     
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'21'),                   
    BUILD=(1,9,17,15,80:X)                                       
/*
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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