kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Jul 09, 2005 5:15 am Post subject: |
|
|
Ted allen,
I am not sure of VSAM Backup process on VSE. But on MVS there are many tools which can be used to backup and recover vsam clusters. ex: (IDCAMS,FDR,STARTTOOL...). Here are some examples using IDCAMS
Example 1: The following JCL will create a tape backup named VSAM.BACKUP.FILE of the VSAM file named VSAM.FILE. This example uses the EXPORT facility of IDCAMS.
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BACKUP DD DSN=VSAM.BACKUP.FILE,UNIT=TAPE,
// DISP=(NEW,CATLG,DELETE),DCB=BLKSIZE=6000
//SYSIN DD *
EXPORT -
VSAM.FILE -
OUTFILE(BACKUP) -
TEMPORARY
/*
|
BLKSIZE is not required on the BACKUP dd statement but should be coded if you wish to override the default of 2048.
Example 2: The following JCL restores the VSAM file named VSAM.FILE from the tape backup named VSAM.BACKUP.FILE using the IMPORT facility of IDCAMS.
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SOURCE DD DSN=VSAM.BACKUP.FILE,DISP=OLD
//SYSIN DD *
IMPORT -
INFILE(SOURCE) -
OUTDATASET(VSAM.FILE)
/*
|
If a VSAM file has an alternate index associated with it, you must IMPORT and EXPORT both the alternate index and the file.
Example 3: The following JCL creates a tape backup named VSAM.BACKUP.ALTNDX of the alternate index named VSAM.ALTNDX associated with the VSAMfile. Both backups will be contained on the same tape volume. The alternate index must be backed up first.
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BACKUP DD DSN=VSAM.BACKUP.ALTNDX,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TAPE,LABEL=(1,SL),VOL=(,RETAIN)
//SYSIN DD *
EXPORT VSAM.ALTNDX -
OUTFILE(BACKUP)
/*
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BACKUP DD DSN=VSAM.BACKUP.FILE,
// DISP=(,CATLG,DELETE),
// UNIT=TAPE,LABEL=(2,SL),VOL=(,,REF=*.STEP1.BACKUP)
//SYSIN DD *
EXPORT VSAM.FILE -
OUTFILE(RECEIVE)
/*
|
Another method for backing up and restoring a VSAM file is the REPRO facility of IDCAMS.
Example 4: The following JCL creates a tape backup named VSAM.BACKUP.FILE of the VSAM file named VSAM.FILE using the REPRO facility of IDCAMS.
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=VSAM.BACKUP.FILE,UNIT=TAPE,
// DISP=(,CATLG,DELETE),DCB=(appropriate parameters)
//DD2 DD DSN=VSAM.FILE,DISP=OLD
//SYSIN DD *
REPRO -
INFILE(DD2) -
OUTFILE(DD1)
/*
|
In order to restore a VSAM file from a backup created with the REPRO facility, the file must first be defined again using the DEFINE facility of IDCAMS. Therefore, you must know the attributes of the file in order to use the REPRO facility.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|