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
 

 

Matching Two files Using ICETOOL!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    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

MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
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

Senior Member


Joined: 28 Mar 2005
Posts: 1452
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: 116

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
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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