MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

to find matching records in two vsam ksds file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
manojy2k
Beginner


Joined: 19 Jan 2003
Posts: 6
Topics: 3
Location: India

PostPosted: Fri Jan 31, 2003 9:45 am    Post subject: to find matching records in two vsam ksds file Reply with quote

Hi,

I have to merge 2 vsam ksds files and store all records in one file.
Orginal File A has some 10000 records. The other file B has some 13000 records. Now I have to put all records of File B into A. But while copying this there are certain records are present in both the file due to which I am getting Logical VSAM Error or Return code 12 if I use IDCAMS Repro utility through JCL.

Can anybody suggest me how to compare this two VSAM KSDS Files and find out how many records are matching in both the files. Both the files are VB REC Length.

Looking forward for a answer.

Thanks,
Manoj.
Manojy2k@yahoo.com
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jan 31, 2003 10:06 am    Post subject: Reply with quote

Manoj,

Try this
1. Dump the contents of fileA to a Flat file say T1
2. Dump the contents of FileB to another flat file say T2
3. Now concatenate T1 & T2 and sort on the key eliminating duplicates using sort utility and create file say T3
4. Repro file T3 to vsam ksds fileA using replace option.
Code:
REPRO IFILE(IN) OFILE(OUT) REPLACE


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Fri Jan 31, 2003 12:21 pm    Post subject: Reply with quote

Or you could just REPRO with the REPLACE option from the VSAM file with the 10,000 records into the 13,000 record file and not bother with steps 2 & 3 in the example given by kolusu. The end result will be the same.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manojy2k
Beginner


Joined: 19 Jan 2003
Posts: 6
Topics: 3
Location: India

PostPosted: Mon Feb 03, 2003 2:31 am    Post subject: Reply with quote

kolusu & CaptBill,

Thanks very much for the suggesation. It worked fine with Repro command with Replace option. CaptBill, you are right the steps 2 & 3 are not needed .

Thanks,
Manoj.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Mon Feb 03, 2003 7:23 am    Post subject: Reply with quote

Hi manojy2k,
Just to add to what Kolusu and captBill have said, if you don't want to use the REPLACE option, which basically replaces all records having matching keys, you may not use it but instead of that use the ERRORLIMIT option. Specify a large value of ERRORLIMIT say ERRORLIMIT(10000). In that case, your IDCAMS REPRO will not end till 10000 matching key values are reached. The default value of ERRORLIMIT is 4 and thats why your job ends with a return code of 12 if 4 matching key values are found.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group