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

Please help with ICETOOL problem!!!


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Aug 29, 2009 11:16 pm
Reply with quote

Hello there. Need a little assistance with ICETOOL
I actually solved the problem with SORT but I'm sure that ICETOOL can be more efficient and nice....
I have two files - main file and driver file. I have to skip everything from main file if there is matching record on driver file based on key. Second output file needs to have records which I skipped.

Main file is 1000 bytes, key is 6:10CH
Code:
----+----1----+----2----+----3----+----4---
*******************************************
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987


Driver file is 10 bytes long and it's key is 1:10CH
Code:
----+----1
**********
1111111111
2222222222
3333333333
4444444444


So my output file 1 should have:
Code:
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987
XXXXX5555555555C7722XXXXXXXXXXXXXXXX....987


Output file to should have:
Code:
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX1111111111C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987
XXXXX3333333333C7722XXXXXXXXXXXXXXXX....987



Any help would be greatly appreciated.

Thanks. icon_smile.gif
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sun Aug 30, 2009 11:44 pm
Reply with quote

I was able to create first output file. But I'm stuck with second file were I write records which were omitted.

Code:
//STEP001  EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN1      DD DSN=TESTFL.DRIVER.FILE,DISP=SHR             
//IN2      DD DSN=TESTFL.MAIN.FILE,DISP=SHR
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(CYL,(50,10)),   
//            UNIT=SYSDA                                           
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
 COPY FROM(IN1) TO(TMP1) USING(CP01)                               
 COPY FROM(IN2) TO(TMP1) USING(CP02)                               
 SPLICE FROM(TMP1) TO(OUT) ON(6,10,CH) WITH(6,10) KEEPNODUPS-     
 USING(CP03) KEEPBASE WITHALL                                     
/*                                                                 
//CP01CNTL DD *                                                   
 OUTREC FIELDS=(6:1,10,1001:C'11')                                 
 SUM FIELDS=NONE                                                   
//CP02CNTL DD *                                                   
  OUTREC FIELDS=(1,1000,1001:C'22')             
//CP03CNTL DD *                                 
  OUTFIL FNAMES=OUT,INCLUDE=(1001,2,CH,EQ,C'22')


Please show me how to write to second file records which were omitted.
Thanks. icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 31, 2009 1:37 am
Reply with quote

Hello,

From a previous post (The forum SEARCH is your friend icon_smile.gif ):
Quote:
check the smart DFSORT trick "Create files with matching and non-matching records"

www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000094

See if this has what you need. . .
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Mon Aug 31, 2009 6:47 pm
Reply with quote

Thanks, I downloaded it but still struggling with writing to two files duplicates and non duplicates in the same step icon_cry.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Aug 31, 2009 9:23 pm
Reply with quote

rmd3003,

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//FB0010   DD DSN=Your input 10 byte fb file,DISP=SHR
//FB1000   DD DSN=Your input 1000 byte fb file,DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)         
//OUT1     DD SYSOUT=*                                                 
//OUT2     DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
  COPY FROM(FB0010) USING(CTL1)                                       
  COPY FROM(FB1000) USING(CTL2)                                       
  SORT FROM(T1) USING(CTL3)                                           
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T1,BUILD=(6:1,10,1001:C'1')                           
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(1001:C'2')                                 
//CTL3CNTL DD *                                                       
  SORT FIELDS=(6,10,CH,A)                                             
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(1003:SEQNUM,8,ZD,RESTART=(6,10))),
  IFTHEN=(WHEN=GROUP,BEGIN=(1003,8,ZD,EQ,1),PUSH=(1002:1001,1))       
  OUTFIL FNAMES=OUT1,BUILD=(1,1000),INCLUDE=(1001,2,ZD,EQ,22)         
  OUTFIL FNAMES=OUT2,BUILD=(1,1000),INCLUDE=(1001,2,ZD,EQ,21)         
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Mon Aug 31, 2009 10:48 pm
Reply with quote

Skolusu, thank you very much icon_smile.gif . Simple and efficient.
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
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
Search our Forums:

Back to Top