Page 1 of 1

How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Wed Jul 22, 2009 5:30 pm
by RajendraPrabhuS
Hi, I know that, using REPRO we can able to copy some content from PS/VSAM file to VSAM file. I just want to know how we copy the content without deleting the old content in the destination file?

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Wed Jul 22, 2009 6:22 pm
by expat
REPLACE

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Wed Jul 22, 2009 7:13 pm
by RajendraPrabhuS
Are you sure? Can you please expand your answer. Where to give ? and How to give?

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Wed Jul 22, 2009 10:37 pm
by MAINFRAME GURU
Yes, Thats correct...

Here is the code.. You can use this

//IDCAMS01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN1      DD DISP=SHR,DSN=XYZ.ABC.123
//OUT1     DD DISP=SHR,DSN=XYZ.ABC.123.OUT1
//SYSIN    DD *                                   
       REPRO INFILE (IN1)  OUTFILE (OUT1)  REPLACE
/*


Hope it works for you..

Regards,
Guru

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Wed Jul 22, 2009 11:31 pm
by arunprasad.k
I just want to know how we copy the content without deleting the old content in the destination file?


REPRO will not delete any contents!! It will just insert the data from input file to output file.

Say you have a record with key as "999" and want to repro another record with the same key of "999" then the REPRO will fail due to duplicate record (Default is NOREPLACE).

If you use REPRO with REPLACE then the old "999" record will be replaced with the new "999" record. Doesn't this mean deleting the old record and adding the new one?

Here is the link for the Optional parameters you can use with REPRO

http://publibz.boulder.ibm.com/cgi-bin/ ... 0956&CASE=

Arun.

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Thu Jul 23, 2009 3:01 am
by dick scherrer
Hello,

To help the performance of the new combined content file you might consider unloading the existing data, sorting both sets of data on the key (discarding duplicatges) and then reloading the reorganized data.

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Thu Jul 23, 2009 11:14 am
by RajendraPrabhuS
I thank Every one for my answer.

Re: How do we copy the content 2 VSAM file without delete old 1?

PostPosted: Thu Jul 23, 2009 11:09 pm
by dick scherrer
You're welcome - good luck :)

d