Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Matching Two files Using ICETOOL!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
ykishore

Active User


Joined: 12 Aug 2005
Posts: 53
Location: USA

PostPosted: Mon Jan 16, 2006 12:21 pm    Post subject: Matching Two files Using ICETOOL!!
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
References
MGIndaco

Moderator


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

PostPosted: Mon Jan 16, 2006 1:56 pm    Post subject:
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

Global Moderator


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

PostPosted: Mon Jan 16, 2006 2:54 pm    Post subject: Re: Matching Two files Using ICETOOL!!
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: 108

PostPosted: Wed Jan 18, 2006 1:51 am    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1