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
 

 

Help needed in ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Help needed in ICETOOL
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    Post subject:
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    Post subject: Reply to: Help needed in ICETOOL
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    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
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
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


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