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

Matching Two files Using ICETOOL!!


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

New User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Mon Jan 16, 2006 12:21 pm
Reply with quote

Hi All

Here is my requirement. I've two sequential files with different lengths.

File -1: Lrecl=350 Byte
File -2: Lrecl=23 Byte

I want to have 3 kinds of outout as below.

1)Only Matched cases
2)Only file-1 records
3)Only file-2 records.

Matching Criteria :
----------------------
File-1: 1-3 ,4,3, 7,8, 289,6( total : 23 Byte)
File-2: 1-23

Can you please let me know solution for this Using ICETOOL.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon Jan 16, 2006 1:56 pm
Reply with quote

You can use one of the sample inserted in this forum that referr to the SPLICE function.
Two different length are easily solved with INREC/OUTREC.
ICETOOL(DFSORT in general) is powerfull in all direction.
Try to explain your matching criteria with an INREC or OUTREC
You will able to adapt first file to the second( or the contrary) depending of which kind of output you need.

Make a search in this forum for other information.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Jan 16, 2006 2:54 pm
Reply with quote

I think this Smart DFSORT Trick will help you:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t05

Regards,

Priyesh.
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Wed Jan 18, 2006 1:51 am
Reply with quote

This will give you matching records from file1 and file2 in the same format as of file 1.
Since the key for file 1 is not mentioned properly, I am assuming it this way to make it a 23 byte key.

File-1: from pos-1,3byes ,from pos-4,3bytes, from pos-7,8bytes, from pos-289,9bytes( total : 23 Byte key)

File -2: the whole file of 23bytes is the key.

Code:

//SORT1    EXEC PGM=ICETOOL                                           
//SYSOUT  DD SYSOUT=*                                                 
//TOOLMSG DD SYSOUT=*                                                 
//LIST99  DD SYSOUT=*                                                 
//DFSMSG  DD SYSOUT=*                                                 
//IN1     DD DSN=infile 2(of 23 bytes),DISP=SHR                               
//IN2     DD DSN=infile 1(of 350 bytes),DISP=SHR                               
//T1      DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)     
//OUT     DD DSN=out file(of 350 bytes),DISP=*                               
//TOOLIN  DD *                                                         
  COPY   FROM(IN1)   TO(T1)       USING(CTL1)                         
  COPY   FROM(IN2)   TO(T1)       USING(CTL2)                         
  SPLICE FROM(T1)    TO(OUT)  ON(1,23,CH) WITHALL -                   
         WITH(1,350) WITH(352,1) USING(CTL3)                           
/*                                                                     
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(351:C'11')                                 
/*                                                                     
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=T1,OUTREC=(1:1,14,15:289,9,24:15,274,298:298,53,C'22')
/*                                                                     
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,                                                   
  OUTREC=(1:1,14,15:24,274,289:15,9,298:298,53),                       
  INCLUDE=(351,2,CH,EQ,C'12')                                         
/*                                                                     


Why you need other 2 outputs, when the 2 input files itself have the same info.
Please let me know whether this is hel[ful to you.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top