Restore file from backup (IMPORT)
Restore file from backup (IMPORT)
The IMPORT command imports or restores a cluster, AIX, or catalog from a backup created by the EXPORT. Here, the input is the backup created by EXPORT, and the output is like the base file from where the data was exported earlier.
Syntax -
//JOBNAME JOB job-card-parameters
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
IMPORT (entryname
[FILE(ddname)]
[NEWNAME(newname)]
[ORDERED | UNORDERED]
[VOLUMES(volser[ volser...])])
({INFILE(ddname) |
INDATASET(dataset-name)}
[CATALOG(catname)]
[ERASE | NOERASE]
[PURGE | NOPURGE])
[DEVICETYPE(type)]
[VOLUMES(volser[ volser...])]
[CATALOG(catname)]
/*
Mandatory Parameters
- INFILE(ddname) - Specifies the DD name of the sequential dataset that contains the exported backup. This dataset should have been previously created using the EXPORT command. Short Description: IFILE
- INDATASET(dataset-name) - Specifies the input DSN name of the sequential dataset that contains the exported backup. Short Description: IDS
- NEWNAME(newname) - specifies the new name of an imported cluster, aix, its components, or a path.
- VOLUMES (volser[ volser...]) - Specifies the volume serial numbers where the dataset will reside. If there is not enough space on the volume as specified, the allocation is unsuccessful. Short Description: VOL
Optional Parameters
- FILE(ddname) - specifies the file name identifying the volume(s) and extents allocated to the data and index components of an aix or cluster to be imported.
- ERASE | NOERASE - Default: NOERASE
- ERASE - specifies the cluster components memory is to be erased with binary zeroes when cluster is deleted. Short Description: ERAS
- NOERASE - specifies the cluster components memory is not to be erased when cluster is deleted. Short Description: NERAS
- PURGE | NOPURGE -
- PURGE - Specifies the output objects should delete if the retention period has not expired. Short Description: PRG
- NOPURGE - Specifies the output objects should not delete until the retention period has expired. Short Description: NPRG
- ORDERED | UNORDERED -
- ORDERED - Specified volumes are to be used in the order they were listed in the VOLUMES parameter. Short Description: ORD
- NOPURGE - Specifies volumes can be used in any order. Short Description: UNORD
- CATALOG (catname) - Specifies the name of the catalog where the path will be defined. Short Description: CAT
Example -
Scenario - Import backup PS file to KSDS.
Input ESDS File - MATEPK.EMPL.BACKUP
JCL -
----+----1----+----2----+----3----+----4----+----5----+
...
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BACKUP DD DSN=MATEPK.EMPL.BACKUP,DISP=SHR
//SYSIN DD *
IMPORT -
INFILE(BACKUP) -
OUTDATASET(MATEPK.TEST.KSDS) -
INTOEMPTY
/*
...
Output -
Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, then REPRO is successful.