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
 

 

compare 2 files & matched recs write into 3rd file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Pamela Pradhan

New User


Joined: 18 Dec 2007
Posts: 2
Location: Pune

PostPosted: Fri Feb 15, 2008 2:22 pm    Post subject: compare 2 files & matched recs write into 3rd file
Reply with quote

Hi
I can't quite work out how to do the following -

File1 : key position (1-13)

2546289077943
2546289079584
2541828046435
0000013080956

File2 : key position (14-26)

34 ..|2546289077943...|0 ..|STL ..| ..|..Tucker Jammie &
34 ..|2546289079584...|0 ..|STL ..| ..|..Bynum Tanya.....
34 ..|2541828046435...|0 ..|STL ..|AA..|..Dairy Queen.....
34 ..|2541828046435...|0 ..|STL ..|01..|..Carquest Auto Pa
34 ..|2541828046435...|0 ..|STL ..|04..|..Carquest Paint S
34 ..|2541828046435...|1000 ..|LINE..|05..|..1202 E Hwy 190..
56 ..|0000013080956...|0 ..|STL ..|58..|..RHA Health Servi
34 ..|2541828046435...|2000 ..|LINE..|06..|..................
34 ..|2546289083510...|0 ..|STL ..| ..|..Henry Ricardo...
34 ..|2546289084589...|0 ..|STL ..| ..|..McCarroll C.....
34 ..|2541828060360...|0 ..|STL ..|06..|..Stampede Hockey.
34 ..|2541828060360...|2500 ..|LINE..|07..|..Bus Ofc 100 W Ce
34 ..|2541828060360...|0 ..|STL ..|0A..|..New Millineum In

required file3:

34 ..|2546289077943...|0 ..|STL ..| ..|..Tucker Jammie &
34 ..|2546289079584...|0 ..|STL ..| ..|..Bynum Tanya.....
34 ..|2541828046435...|0 ..|STL ..|AA..|..Dairy Queen.....
34 ..|2541828046435...|0 ..|STL ..|01..|..Carquest Auto Pa
34 ..|2541828046435...|0 ..|STL ..|04..|..Carquest Paint S
34 ..|2541828046435...|1000 ..|LINE..|05..|..1202 E Hwy 190..
56 ..|0000013080956...|0 ..|STL ..|58..|..RHA Health Servi
34 ..|2541828046435...|2000 ..|LINE..|06..|..................

I want to use the presence of a key in file 1 (position 1 for 13) to lift out the records in file 2 with the same key in the different position (14-26) to a file 3.
I want to fetch all the matching records to file 3.

Any help is much appreciated.

Pam
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Feb 16, 2008 12:21 am    Post subject:
Reply with quote

Pam,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=... input file1 (keys in 1-13)
//IN2 DD DSN=... input file2 (FB/1200) - keys in 14-26
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/1200)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(14,13,CH) -
  WITHALL WITH(1,1201) WITH(1203,8) USING(CTL3)
SORT FROM(T2) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC BUILD=(14:1,13,1201:C'BB',1203:8X)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(1201:C'VV',1203:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=T2,INCLUDE=(1201,2,CH,EQ,C'VB')
/*
//CTL4CNTL DD *
  SORT FIELDS=(1203,8,ZD,A)
  OUTREC BUILD=(1,1200)
/*
Back to top
View user's profile Send private message
Pamela Pradhan

New User


Joined: 18 Dec 2007
Posts: 2
Location: Pune

PostPosted: Mon Feb 18, 2008 12:32 pm    Post subject: Reply to: compare 2 files & matched recs write into 3rd
Reply with quote

Frank,

Thanks a lots icon_smile.gif
Its working fine..
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 SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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