The VSAM EXPORT-IMPORT commands are usually used to take the backup and recovery. The EXPORT option is used to export the dataset or alternate index or catalog. EXPORT-IMPORT can be used with the VSAM dataset (KSDS, ESDS, RRDS, and LDS), Alternate indexes, and the dataset created by EXPORT can have only a sequential organization. EXPORT copies the information required to fully reconstruct the cluster without executing a separate DEFINE. The portable copy of the exported cluster must always be contained in a non-VSAM, sequential dataset.
Using EXPORT/IMPORT for backup and recovery has the following advantages:
EXPORT entryname[/password] {OUTFILE(ddname)]OUTDATASET(entryname)} [ERASE]NOERASE] [INFILE(ddname)] [INHIBITSOURCE]NOINHIBITSOURCE] [INHIBITTARGET]NOINHIBITTARGET] [PURGE]NOPURGE] [TEMPORARY]PERMANENT]
The entry name is the name of the object that needs to be exported and OUTFILE provides to which it should be exported.
IMPORT {INFILE(ddname)]INDATASET(entryname)} {OUTFILE(ddname[/password])] OUTDATASET(entryname[/password])} [ERASE]NOERASE] [INTOEMPTY] [OBJECTS((entryname [FILE(ddname)] [(KEYRANGES((lowkey highkey)] [(lowkey highkey)...])] [NEWNAME(newname)] [ORDERED]UNORDERED] [VOLUMES(volser[ volser...])]) [(entryname...)...])] [PURGE]NOPURGE] [CATALOG(catname[/password])]
The following usage rules apply to the EXPORT/ or MPORT command:
Parameter | Description |
---|---|
ERASE OR NOERASE | Used to specify whether or not the components of a cluster or alternate index exported need to be erased(Erasing will overwrite it with binary zeroes). ERASE will overwrite the data component with binary zeroes during the cluster or an alternate index is deleted. NOERASE will not overwrite the data component with binary zeroes when the cluster or alternate index is deleted. |
INHIBITSOURCE OR NOINHIBITSOURCE | Used to specify how the data records in the source data set (ALTERNATE INDEX and CLUSTER) can be accessed after they have been imported to another system. ALTER command is used to change this parameter. If INHIBITSOURCE is specified then the original data records in the original system cannot be accessed for any operation other than retrieval. If NOINHIBITSOURCE is specified then the original data records in the original system can be accessed for any kind of operation. |
INHIBITTARGET OR NOINHIBITTARGET | Used to specify whether or not the data records copied into the target cluster or alternate index can be accessed for any operation other than retrieval after they have been imported to another system. This specification can be changed through the ALTER command. If INHIBITTARGET is specified, the target object cannot be accessed for any operation other than retrieval after it has been imported into another system. If NOINHIBITTARGET is specified, the target object can be accessed for any type of operation after it has been imported into another system. |
PURGE OR NOPURGE | Used to specify whether or not the cluster or alternate index to be exported needs to be deleted from the original system regardless of the retention period specified in a TO or FOR parameter during the original definition. This parameter can be specified only if the object is to be permanently exported, that is, deleted from the original system. Therefore, it does not apply to catalogs that must be exported as TEMPORARY. If PURGE is specified then the object is deleted even if the retention period has not expired. If NOPURGE is specified then the object is not deleted unless the retention period has not expired. |
TEMPORARY OR PERMANENT | Used to specify whether or not the cluster, alternate index, or catalog to be exported is to be deleted from the original system. If TEMPORARY is specified then the cluster or alternate index is not deleted from the original system. The object in the original system is marked as TEMPORARY to indicate that another copy exists and that the original copy can be replaced. If PERMANENT is specified then the cluster or alternate index is deleted from the original system & storage space is freed. If its retention period has not yet expired then PURGE must be specified. |
//VSAMIMPT JOB (1234),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=&SYSUID,REGION=6M //******************************************************** //* THIS IMPORT AND EXPORT COMMAND USED ONLY FOR VSAMFILE. //******************************************************** //STEP1 DD DSN=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=XXXXXX.YYYYYY.KSDS.BACKUP, // DISP=SHR //SYSIN DD * IMPORT - INFILE(DD1) - OUTDATASET(XXXXXX.YYYYYY.KSDS.CLUSTER) /*
//VSAMEXPT JOB (1234),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=&SYSUID,REGION=6M //******************************************************** //* THIS IMPORT AND EXPORT COMMAND USED ONLY FOR VSAMFILE. //******************************************************** //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //DD1 DD DSN=XXXXXX.YYYYYY.KSDS.BACKUP, // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA, // DCB=(BLKSIZE=8000) //SYSIN DD * EXPORT - XXXXXX.YYYYYY.KSDS.CLUSTER - OUTFILE(DD1) - TEMPORARY /*
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…
The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…
The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…
Choosing the right Scrum Master Certification depends on your current experience and career goals. If…