Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us