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

Help needed in ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anu Vijayaraghavan

New User


Joined: 13 Feb 2008
Posts: 16
Location: Chennai

PostPosted: Thu Sep 24, 2009 2:46 pm
Reply with quote

file details:

master file:
LRECL = 420
key start position:9
key length :12

reference file:
LRECL = 86
key start position:2
key length :12

file characteristics:
both master and reference file have a common key.
master file may contain duplicates.
reference file will NOT contain duplicates.

requirement:
ICETOOL must be used
All the records of the master file should be written to the output file
If a Key is found in both master and reference file then the fields 75 to 80 in reference file should be moved to the fields 385-390 in the output file.
if a match for a record in master file is NOT found in the reference file then the fields 385-390 of the output file should contain the original data that was present in the master file
Back to top
View user's profile Send private message
Anu Vijayaraghavan

New User


Joined: 13 Feb 2008
Posts: 16
Location: Chennai

PostPosted: Thu Sep 24, 2009 6:59 pm
Reply with quote

Hi all,
I went through some of the solutions provided in this forum and wrote the following sort code to accomplish my requirements. This code worked fine for me. icon_biggrin.gif
Code:

//IN1      DD DSN=IN1,DISP=SHR               
//IN2      DD DSN=IN2,DISP=SHR               
//REF      DD DSN=REF,DISP=SHR           
//MASTR    DD DSN=&&MASTR,DISP=(MOD,PASS),SPACE=(CYL,(9,9),RLSE)       
//T2       DD DSN=&&T2,DISP=(MOD,PASS),SPACE=(CYL,(9,9),RLSE)         
//MERGE1   DD DSN=MERGE1,                     
//         DISP=(OLD,CATLG,DELETE),                                   
//         UNIT=SYSDA,                                                 
//         SPACE=(CYL,(25,10),RLSE),                                   
//         LRECL=422,RECFM=FB                                         
//OUTFILE  DD DSN=OUTFILE,                     
//         DISP=(NEW,CATLG,DELETE),                                   
//         UNIT=SYSDA,                                                 
//         SPACE=(CYL,(25,10),RLSE),                                   
//         LRECL=420,RECFM=FB                                         
//TOOLIN   DD *                                                       
  COPY FROM(IN1) TO(MASTR)                                             
  COPY FROM(IN2) TO(MASTR)                                             
  COPY FROM(REF) TO(T2) USING(CTL1)                                   
  COPY FROM(MASTR)  TO(T2) USING(CTL2)                                 
  COPY FROM(T2) TO(MERGE1)                                             
  SPLICE FROM(MERGE1) TO(OUTFILE) ON(9,12,CH)         WITHALL         
  WITH(1,384) WITH(391,30) WITH(421,1) KEEPNODUPS USING(CTL3)         
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T2,                                                   
  BUILD=(1:1,8,9:2,12,21:21,66,298X,385:75,6,30X,421:C'RR')           
//CTL2CNTL DD *                                                       
  SORT FIELDS=(9,12,CH,A)                                             
  OUTFIL FNAMES=T2,BUILD=(1:1,420,421:C'MM')                           
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUTFILE,                                               
  INCLUDE=(421,2,CH,NE,C'RR'),                                         
  BUILD=(1:1,420)                                                     
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 24, 2009 9:03 pm
Reply with quote

Anu Vijayaraghavan,

You really don't need that many passes of data. The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//MASTER   DD DSN=your 420 byte master file,DISP=SHR
//REFER    DD DSN=your 86 byte reference file,DISP=SHR
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)       
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  COPY FROM(REFER)  USING(CTL1)                                       
  COPY FROM(MASTER) USING(CTL2)                                       
  SORT FROM(TEMP)   USING(CTL3)                                       
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=TEMP,BUILD=(9:2,12,385:75,6,421:C'1')                 
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=TEMP,OVERLAY=(421:C'2')                               
//CTL3CNTL DD *                                                       
  SORT FIELDS=(9,12,CH,A),EQUALS                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(423:SEQNUM,8,ZD,RESTART=(9,12))),
  IFTHEN=(WHEN=GROUP,BEGIN=(423,8,ZD,EQ,1),PUSH=(422:421,1,431:385,6))
  OUTFIL FNAMES=OUT,INCLUDE=(421,2,ZD,GE,21),IFOUTLEN=420,           
  IFTHEN=(WHEN=(421,2,ZD,EQ,21),OVERLAY=(385:431,6))                 
/*
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 Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top