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

icetool problem


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

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Tue Jan 08, 2008 1:52 pm
Reply with quote

IN1: File 1 has following records
1 1 1
1 1 2
3 1 1
4 1 5
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9

IN2: File 2
2
6
7
8

OUT12: Now Outfile 1 should have

6 1 1
7 1 3
7 1 4
7 1 5
8 1 9

OUT1: Outfile 2 should have

1 1 1
1 1 2
3 1 1
4 1 5

please help... i tried using icetool as follows, but it is removing duplicates in the OUT1 file:

Code:

//T1 DD DSN=&&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))           
//TOOLIN DD *                                                           
 COPY FROM(IN1) TO(T1) USING(CTL2)                                     
 COPY FROM(IN2) TO(T1) USING(CTL1)                                     
 SPLICE FROM(T1) TO(OUT12) KEEPNODUPS WITH(21,1) -                     
 WITHALL WITH(21,1) WITH(1,1) ON(1,2,CH)                               
/*                                                                     
//CTL1CNTL DD *                                                         
 OUTREC FIELDS=(1,15,20:C'11')                                         
/*                                                                     
//CTL2CNTL DD *                                                         
 OUTREC FIELDS=(1,10,20:C'22')                                         
/*                                                                     
//CTL3CNTL DD *                                                         
 OUTFIL FNAMES=OUT12,INCLUDE=(20,2,CH,EQ,C'21'),OUTREC=(1:1,15,133:X)   
 OUTFIL FNAMES=OUT1,INCLUDE=(20,2,CH,EQ,C'11'),OUTREC=(1:1,20,133:X)   
/*                                                                     
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jan 08, 2008 1:56 pm
Reply with quote

divya,

We expect some exaplanation regarding your requirement. Please remember its not possible for most of us to go trhu sort card and get the requirement.
Back to top
View user's profile Send private message
divya_maddi

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Tue Jan 08, 2008 1:58 pm
Reply with quote

if the record is present in both input file 1 and 2 then write file1 record to outfile1 else write to outfile2. Note that outfile1 has duplicates and they need to be written in the output files.
Back to top
View user's profile Send private message
divya_maddi

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Tue Jan 08, 2008 2:00 pm
Reply with quote

note that i have searched the dfsort/icetool forum but did not find any sample for this case..... none of them write the eliminated records to another file.... and most of them do not deal with duplicates.
Back to top
View user's profile Send private message
divya_maddi

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Tue Jan 08, 2008 2:01 pm
Reply with quote

divya_maddi wrote:
if the record is present in both input file 1 and 2 then write file1 record to outfile1 else write to outfile2. Note that outfile1 has duplicates and they need to be written in the output files.


small correction. The key is the first byte and it is enough if the 1st byte of file 1 and 2 match to write to the outfile1
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 3:21 pm
Reply with quote

Code:
//STEP001  EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN1      DD *           
1 1 1                     
1 1 2                     
1 1 2                     
3 1 1                     
4 1 5                     
6 1 1                     
7 1 3                     
7 1 4                     
7 1 5                     
8 1 9                     
/*                         
//IN2      DD *           
2                         
6                         
7                         
8                                                                     
/*                                                                     
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//MATCH    DD SYSOUT=*                                                 
//UNMATCH  DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
 COPY FROM(IN2)  TO(TMP1) USING(CP01)                                 
 COPY FROM(IN1)  TO(TMP1) USING(CP02)                                 
 SPLICE FROM(TMP1) TO(MATCH) ON(1,1,CH) WITH(2,9) WITH(13,1) -         
      WITHALL KEEPBASE      USING(CP03) KEEPNODUPS                     
/*                                                                     
//CP01CNTL DD   *                                                     
  OUTREC BUILD=(1,10,12:C'11')                                         
/*                                                                     
//CP02CNTL DD   *                                                     
  OUTREC BUILD=(1,10,12:C'22')                                         
/*                                                                     
//CP03CNTL DD   *                                                     
  OUTFIL FNAMES=MATCH,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10,133:X)   
  OUTFIL FNAMES=UNMATCH,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10,133:X)
/*                                                                   

MATCH contains
Code:
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9
UNMATCH contains
Code:
1 1 1
1 1 2
1 1 2
3 1 1
4 1 5
Back to top
View user's profile Send private message
divya_maddi

New User


Joined: 03 Nov 2005
Posts: 33

PostPosted: Tue Jan 08, 2008 4:02 pm
Reply with quote

thank you very much krisprem..... works perfectly
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