Previous Topic: Example 3: Changing Online MembersNext Topic: Example 5: Deleting a Database


Example 4: Copying a Database

In this example, database VIEW.SYSTEM1 continually grows in size with the addition of many data sets. For performance reasons, it is copied to a new large database. The old database retains the name of VIEW.OLDSYS1.


//EXAMPLE4 JOB ACCOUNT,PROGRAMMER
//STEP1 EXEC PGM=SARDBASE
//STEPLIB DD DSN=CAI.CVDELOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50))
//SYSIN DD *
NAME VIEW.SYSTEM1
RENAME VIEW.OLDSYS1
NAME VIEW.SYSTEM1
ADDDS UNIT=3380 VOL=SAR001 CYL=50 INDEX
ADDDS UNIT=3380 VOL=SAR002 CYL=600 DATA
COPY VIEW.OLDSYS1
/*