View previous topic :: View next topic |
Author |
Message |
manojy2k Beginner
Joined: 19 Jan 2003 Posts: 6 Topics: 3 Location: India
|
Posted: Fri Jan 31, 2003 9:45 am Post subject: to find matching records in two vsam ksds file |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jan 31, 2003 10:06 am Post subject: |
|
|
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 |
|
|
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Fri Jan 31, 2003 12:21 pm Post subject: |
|
|
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 |
|
|
manojy2k Beginner
Joined: 19 Jan 2003 Posts: 6 Topics: 3 Location: India
|
Posted: Mon Feb 03, 2003 2:31 am Post subject: |
|
|
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 |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Mon Feb 03, 2003 7:23 am Post subject: |
|
|
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 |
|
|
|
|