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



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby RajendraPrabhuS » Wed Jul 22, 2009 5:30 pm

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?
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby expat » Wed Jul 22, 2009 6:22 pm

REPLACE
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

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

Postby RajendraPrabhuS » Wed Jul 22, 2009 7:13 pm

Are you sure? Can you please expand your answer. Where to give ? and How to give?
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MAINFRAME GURU » Wed Jul 22, 2009 10:37 pm

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
MAINFRAME GURU
 
Posts: 18
Joined: Fri Jul 10, 2009 8:41 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby arunprasad.k » Wed Jul 22, 2009 11:31 pm

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.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Jul 23, 2009 3:01 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby RajendraPrabhuS » Thu Jul 23, 2009 11:14 am

I thank Every one for my answer.
RajendraPrabhuS
 
Posts: 33
Joined: Mon Jul 20, 2009 4:54 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Jul 23, 2009 11:09 pm

You're welcome - good luck :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post