COPY DATASTORE FROM ONE SSID TO ANOTHER

Document ID : KB000071587
Last Modified Date : 29/05/2018
Show Technical Document Details
Issue:
Datastore can be copied from ssid A vcat B to ssid A VCAT C but can it  be copied from SSID A to SSID B? Also must the ssid still exist to copy from an "orphaned" datastore? or can the copy be performed to/from any datastore as long as they are still defined to the control file?
 
Resolution:
YES datastore can be  copied from one SSID to another. Here is the job to accomplish that in 2 steps: 
First job 
//JOBNAME JOB (106100000),'PDT RESTORE1', 
// CLASS=A, 
// MSGCLASS=X, 
// NOTIFY=USERID 
/*JOBPARM SYSAFF=CA31 
//*==================================================================* 
//* 
//* Copy the first record to a sequential file 
//* This is so the first 4 characters of the record can be change 
//* to the db2 ssid 
//* 
//*==================================================================* 
//IDCAMS EXEC PGM=IDCAMS 
//INDTR1 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00001 
//INDTR2 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00002 
//INDTR3 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00003 
//* 
//OUTDTR1 DD DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00011, 
// DISP=(NEW,CATLG,CATLG), 
// DCB=(RECFM=FB,LRECL=24576,BLKSIZE=24576), 
// SPACE=(CYL,(1,1),RLSE),UNIT=SYSDA 
//OUTDTR2 DD DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00012, 
// DISP=(NEW,CATLG,CATLG), 
// DCB=(RECFM=FB,LRECL=8192,BLKSIZE=8192), 
// SPACE=(CYL,(1,1),RLSE),UNIT=SYSDA 
//OUTDTR3 DD DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00013, 
// DISP=(NEW,CATLG,CATLG), 
// DCB=(RECFM=FB,LRECL=24576,BLKSIZE=24576), 
// SPACE=(CYL,(1,1),RLSE),UNIT=SYSDA 
//* 
//AMSDUMP DD SYSOUT=* 
//SYSLST DD SYSOUT=* 
//SYSUDUMP DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSIN DD * 
REPRO INFILE(INDTR1) OUTFILE
REPRO INFILE(INDTR2) OUTFILE(OUTDTR2) COUNT(1) 
REPRO INFILE(INDTR3) OUTFILE(OUTDTR3) COUNT(1) 
/* 
//* 
//*==================================================================* 
//* MANUAL STEP. EDIT THE SEQUENTIAL FILE TO CHANGE THE SSID 
//*==================================================================* 
//*==================================================================* 
//* MANUAL STEP. CREATE THE DATASTORE THROUGH PDT 
//*==================================================================* 
// 
Second job 

//JOBNAME JOB (106100000),'PDT RESTORE2', 
// CLASS=A, 
// MSGCLASS=X, 
// NOTIFY=USERID 
/*JOBPARM SYSAFF=CA11 
//*==================================================================* 
//* COPY THE MODIFIED SEQUENTIAL FILE TO THE CONTROL FILE 
//*==================================================================* 
//IDCAMS EXEC PGM=IDCAMS 
//SYSPRINT DD SYSOUT=* 
//INPUT11 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00011 
//INPUT12 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00012 
//INPUT13 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.I0129.DTZ00013 
//OUTPUT1 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0001.D10A 
//OUTPUT2 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0002.D10A 
//OUTPUT3 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0003.D10A 
//SYSIN DD * 
ALTER PDTDBA.R16.Z1690609.DTR0001.D10A REUSE 
ALTER PDTDBA.R16.Z1690609.DTR0002.D10A REUSE 
ALTER PDTDBA.R16.Z1690609.DTR0003.D10A REUSE 
REPRO INFILE(INPUT11) OUTFILE(OUTPUT1) REUSE 
REPRO INFILE(INPUT12) OUTFILE(OUTPUT2) REUSE 
REPRO INFILE(INPUT13) OUTFILE(OUTPUT3) REUSE 
/* 
//* 
//IDCAMS EXEC PGM=IDCAMS 
//SYSPRINT DD SYSOUT=* 
//INPUT01 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00001 
//INPUT02 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00002 
//INPUT03 DD DISP=SHR,DSN=TSDUMP.PDT2.C1690609.E0129.DTZ00003 
//OUTPUT1 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0001.D10A 
//OUTPUT2 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0002.D10A 
//OUTPUT3 DD DISP=OLD,DSN=PDTDBA.R16.Z1690609.DTR0003.D10A 
//SYSIN DD * 
REPRO INFILE(INPUT01) OUTFILE(OUTPUT1) SKIP(1) NOREPLACE 
REPRO INFILE(INPUT02) OUTFILE(OUTPUT2) SKIP(1) NOREPLACE 
REPRO INFILE(INPUT03) OUTFILE(OUTPUT3) SKIP(1) NOREPLACE 
ALTER PDTDBA.R16.Z1690609.DTR0001.D10A NOREUSE 
ALTER PDTDBA.R16.Z1690609.DTR0002.D10A NOREUSE 
ALTER PDTDBA.R16.Z1690609.DTR0003.D10A NOREUSE 
/*