EXPORT Command (for Experienced)


The EXPORT command exports or creates a backup copy of a cluster or an AIX.

An empty volume cannot be exported. Access method services recognize and maintain the SMS types during EXPORT.

High-level syntax -


//JOBNAME  JOB job-card-parameters
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  EXPORT Command
/*

Detail syntax -


//JOBNAME  JOB job-card-parameters
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  EXPORT entryname
  	{OUTFILE(ddname)|OUTDATASET(dataset-name)}
  	[CIMODE|RECORDMODE]
  	[ERASE|NOERASE]
  	[INFILE(ddname)]
  	[INHIBITSOURCE|NOINHIBITSOURCE]
  	[INHIBITTARGET|NOINHIBITTARGET]
  	[PURGE|NOPURGE]
  	[TEMPORARY|PERMANENT]
/*

Parameters


The EXPORT command mandatory and optional parameters are specified below -

Mandatory Parameters


entryname


  • Specifies the source name of the cluster, alternate index, or user catalog to be exported.
  • This parameter should be the first parameter after EXPORT.

OUTFILE(ddname)


  • Specifies the DDname of the output dataset.
  • DD statement has only the block size for the DCB parameter should be specified.
  • The default block size for EXPORT is 2048. Block size is used to override this default and improve performance.
  • Output datasets loaded by EXPORT should be sequential datasets, and VSAM is not valid as output datasets.

Short Description: OFILE

OUTDATASET(dataset-name)


  • Specifies the name of the output dataset.
  • If OUTDATASET is specified, it tries to allocate the target dataset dynamically.

Short Description: ODS

Optional Parameters


CIMODE


  • Specifies the data records written to the output dataset as one VSAM control interval. i.e., it uses control interval processing.
  • Each control interval is processed as one logical record. So this mode makes the processing more quickly.
  • CIMODE is the default for LDS clusters.

Short Description: CIM

RECORDMODE


  • Specifies the data records written to the output dataset as one VSAM logical record.
  • RECORDMODE is the default on a system without control interval processing support.
  • RECORDMODE is the default for ESDS, KSDS, and RRDS clusters.

Short Description: RECM

ERASE


  • Specifies the cluster components are to be overwritten with binary zeros when the cluster or alternate index is deleted.
  • If ERASE is specified, the volume that contains the data component must be mounted.

Short Description: ERAS

NOERASE


  • Specifies cluster components are not to be overwritten with binary zeros when the cluster or alternate index is deleted.

Short Description: NERAS

INFILE(ddname)


  • Specifies the DDname that identifies the cluster, alternate index, or catalog to be exported.
  • EXPORT processing ends with an error message if the logical record length exceeds 32760 bytes.

Short Description: IFILE

INHIBITSOURCE


  • Specifies the input dataset records cannot be accessed for any operation other than retrieval after EXPORT.
  • Use INHABITSOURCE when the object is exporting temporarily.
  • If INHIBITSOURCE is specified when exporting a catalog, it is ignored, and a warning message is issued.

Short Description: INHS

NOINHIBITSOURCE


  • Specifies that there will be no restriction in accessing the input dataset records after EXPORT.

Short Description: NINHS

INHIBITTARGET


  • Specifies the output dataset records cannot be accessed for any operation other than retrieval after EXPORT.
  • If INHIBITTARGET is coded when exporting a catalog, it is ignored, and a warning message is issued.
  • This parameter can be altered through the ALTER command.

Short Description: INHT

NOINHIBITTARGET


  • Specifies that there will be no restriction in accessing the output dataset records after EXPORT.
  • This parameter can be altered through the ALTER command.

Short Description: NINHT

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

TEMPORARY


  • Specifies that the cluster, alternate index, or catalog is not to be deleted from the original system.
  • Catalogs are exported as TEMPORARY.

Short Description: TEMP

PERMANENT


  • Specifies that the cluster or alternate index will be deleted from the original system.
  • If not TEMPORARY or PERMANENT specified, PERMANENT is default.

Short Description: PERM

Example -


Requirement - Export KSDS to PS file.

Input ESDS File - MATEPK.TEST.ESDS

<===>----10---+----2----+----3----+----4----+--       
****  Top of data  ****                               
E0001EMPLOYEE1     DIR       LOC1 0000100000          
E0002EMPLOYEE2     MGR  DEPT1LOC1 0000080000          
E0003EMPLOYEE3     MGR  DEPT2LOC2 0000075000          
E0004EMPLOYEE4     TL   DEPT1LOC1 0000050000          
E0005EMPLOYEE5     SSE  DEPT1LOC1 0000045000          
E0006EMPLOYEE6     SE   DEPT1LOC1 0000034000          
E0007EMPLOYEE7     SSE  DEPT2LOC2 0000046000          
****  End of data  ****                               

Code -

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKE JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),            
//             NOTIFY=&SYSUID                                           
//************************************************************          
//* EXPORT DATA FROM VSAM KSDS TO PS DATA SET                           
//************************************************************          
//STEP010  EXEC PGM=IDCAMS                                              
//SYSPRINT DD SYSOUT=*                                                  
//INPUT    DD DSN=MATEPK.EMPL.KSDS,DISP=SHR                             
//OUTPUT   DD DSN=MATEPK.EMPL.BACKUP,                                   
//            DISP=(NEW,CATLG,DELETE),                                  
//            SPACE=(TRK,(3,2),RLSE),                                   
//            UNIT=SYSDA,                                               
//            DCB=(DSORG=PS,RECFM=FB,LRECL=47,BLKSIZE=470)              
//SYSIN    DD  *                                                        
  EXPORT                 -                                              
       MATEPK.EMPL.KSDS  -                                              
       OUTFILE(OUTPUT)   -                                              
       CIMODE            -                                              
       NOINHIBITSOURCE                                                  
/*                                                                      
//*                                                                     
**************************** Bottom of Data ****************************

In the above JCL, MATEPK is the userid and change it as required.

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..

********************************* TOP OF DATA **********************************
IDCAMS  SYSTEM SERVICES                                           TIME: 07:25:33
                                                                                
  EXPORT                 -                                                      
       MATEPK.EMPL.KSDS  -                                                      
       OUTFILE(OUTPUT)   -                                                      
       CIMODE            -                                                      
       NOINHIBITSOURCE                                                          
IDC1141I OBJECT NOT SUPPORTED IN CIMODE, RECORDMODE USED                        
IDC0005I NUMBER OF RECORDS PROCESSED WAS 7                                      
IDC0594I PORTABLE DATA SET CREATED SUCCESSFULLY ON 04/29/22 AT 07:25:33         
IDC0550I ENTRY (D) MATEPK.EMPL.KSDS.DATA DELETED                                
IDC0550I ENTRY (I) MATEPK.EMPL.KSDS.INDEX DELETED                               
IDC0550I ENTRY (C) MATEPK.EMPL.KSDS DELETED                                     
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 4                       
                                                                                
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 4               
******************************** BOTTOM OF DATA ********************************

Explaining Example -

In the above example,

  • MATEPK.EMPL.KSDS specifies the input file.
  • OUTFILE(OUTPUT) specifies the output file.
  • CIMODE specifies control interval should treat as one logical record.
  • NOINHIBITSOURCE specifies the input file records can available for reading, writing, etc.