How can I unload entities from a ZCL without running a batch retrieve which requires setting locks?

Document ID : KB000055475
Last Modified Date : 14/02/2018
Show Technical Document Details

When you want to retrieve an entity without setting a lock, you can use GET from entity access. Using the Alchemist Web Interface, you can specify multiple GETs at one time. However, neither of these approaches is practical when you need to unload a significant number of entities or even entire entity types without setting locks.

The best method in this case is to use a combination of two Alchemist utilities, ZCEZCEXT and ZCEXPORT.

The following examples take advantage of the batch export enhancements for these utilities that were made available with 5.3.1 PTF SU03013. So it is necessary to have this applied in order to create the LIST DD for ZCEZCEXT and for ZCEXPORT to be able to subsequently process this input via SYSUT1.

Please refer to the Alchemist Administrator's Guide Reference Guide and the PTF text for a complete description of these utilities and the enhancements. The remainder of this document describes how to exploit these utilities in conjunction with each other in order to easily create a copy of entity source from a Zone Control Library (ZCL) into a partitioned data set ( PDS ). Allocate the PDS as appropriate for the entities being unloaded.

If the two utilities are used together, entity versions are extracted to PDS members, which are named @nnnnnnn (the change control reference, or ccref, number). This ensures unique PDS member names that do not exceed eight characters. (See example 1)

However, by manipulating the simple sequential file passed between the utility programs the member names in the PDS can easily be changed. (See example 2)

Alternatively, the PDS with @nnnnnnn member names could be further processed in conjunction with the LIST sequential file to move long entity names to the desired locations.

Example 1: This example shows a basic two step job to extract the two most recent versions of all Cobol entities from a ZCL called TEST. The resulting PDS will have the ccref numbers as the member names and will contain the current and -1 version of every entity of the entity type "COBOL PROGRAM" from the TEST zone.

 //**************************************************************
 //** ZCL EXTRACT
 //**************************************************************
 //ZCEZCEXT EXEC PGM=ZCEZCEXT,                                   
 //         PARM=('SELECTVER=C2,ETYPE=COBOL PROGRAM')     
 //SYSPRINT DD SYSOUT=*                                          
 //ZCL      DD DISP=SHR,DSN=CYB1.AS5311.TEST.ZCL                
 //EXTRACT  DD DUMMY,                                            
 //            DCB=(RECFM=FB,LRECL=2048,BLKSIZE=8192)           
 //LIST     DD DSN=USERID.MYFILE.FROM.ZCEZCEXT.@NUMBER,         
 //            DISP=(,CATLG),UNIT=SYSDA,                        
 //            SPACE=(CYL,(1,5)),                               
 //            DCB=(RECFM=F,LRECL=144),DSORG=PS                  
 //**************************************************************
 //** ZCL EXPORT                                                 
 //**************************************************************
 //ZCEXPORT EXEC PGM=ZCEXPORT,                                  
 // PARM='OENAME=AS5311,ZONE=TEST,TYPE=COBOL PROGRAM,BATCH=Y'              
 //*                                                             
 //SYSUT1  DD DISP=SHR,DSNAME=USERID.MYFILE.FROM.ZCEZCEXT.@NUMBER
 //SYSUT2  DD DSNAME=USERID.MYFILE.PDS.COBOL
 //           DISP=(,CATLG,CATLG),                       
 //           DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PO),
 //           SPACE=(CYL,(10,10,50)),UNIT=SYSDA

Example 2: This example shows how to extract only the current version and create a PDS with member names that are the same as the entity name instead of the ccref number. This assumes that all entity names are no more than eight characters.

The format of the sequential file created by ZCEZCEXT referenced by DD LIST is:

 ----+----1----+----2----+----3
 AAAAAAAABBBBBBBBCCCCCCCCCCCCCC...(up to column 144)
 AAAAAAAA will be used by ZCEXPORT as the 8 character PDS member name to use
 BBBBBBBB is the entity's cc reference number  
 CCCCCCCCCCCCCC... is the entity name (maximum 136 characters)

The change in PDS member names is accomplished by manipulating this sequential file before passing it to ZCEXPORT. Since ZCEXPORT uses columns 1 thru 8 from this file as the resulting PDS member name, the IEBGENER step replaces this with the first eight characters of the entity name that begins in column 17.

For example, if the format of the original sequential file from ZCEZCEXT looks like this:

 @0000866@0000866ASRC                                                          
 @0000270@0000270CLIP1                                                         
 ...

The reformatted file passed to ZCEXPORT becomes:

 ASRC    @0000866ASRC                                                          
 CLIP1   @0000270CLIP1                                                         
 ...

The following JCL extracts the current version of all entities of type " PCL " from a ZCL called PROD to a PDS :

 //**************************************************************
 //** ZCL EXTRACT
 //**************************************************************
 //ZCEZCEXT EXEC PGM=ZCEZCEXT,                                   
 //         PARM=('SELECTVER=C1,ETYPE=PCL')                      
 //SYSPRINT DD SYSOUT=*                                          
 //ZCL      DD DISP=SHR,DSN=CYB1.AS5311.PROD.ZCL                
 //EXTRACT  DD DUMMY,                                            
 //            DCB=(RECFM=FB,LRECL=2048,BLKSIZE=8192)           
 //LIST     DD DSN=USERID.MYFILE.FROM.ZCEZCEXT.@NUMBER,         
 //            DISP=(,CATLG),UNIT=SYSDA,                        
 //            SPACE=(CYL,(1,5)),                               
 //            DCB=(RECFM=F,LRECL=144),DSORG=PS                  
 //**************************************************************
 //** Manipulate LIST so that PDS membernames will be entity name
 //*  instead of @number.  (Put desired member name in cols 1-8)
 //**************************************************************
 //IEBGENER EXEC PGM=IEBGENER,REGION=1024K                       
 //SYSPRINT DD SYSOUT=*                                          
 //SYSUT1   DD DSN=USERID.MYFILE.FROM.ZCEZCEXT.@NUMBER,           
 //            DISP=SHR                                          
 //SYSUT2   DD DSN=USERID.MYFILE.FROM.ZCEZCEXT.NAME,            
 //            DISP=(,CATLG),UNIT=SYSDA,                        
 //            SPACE=(CYL,(1,5)),                              
 //            DCB=(RECFM=F,LRECL=144),DSORG=PS                  
 //SYSIN    DD *                                                
   GENERATE MAXFLDS=2                                          
   RECORD   FIELD=(8,17,,1),FIELD=(136,9,,9)                   
 /*                                                              
 //**************************************************************
 //** ZCL EXPORT                                                 
 //**************************************************************
 //ZCEXPORT EXEC PGM=ZCEXPORT,                                  
 // PARM='OENAME=AS5311,ZONE=PROD,TYPE=PCL,BATCH=Y'              
 //*                                                             
 //SYSUT1  DD DISP=SHR,DSNAME=USERID.MYFILE.FROM.ZCEZCEXT.NAME
 //SYSUT2  DD DSNAME=USERID.MYFILE.PDS,                 
 //           DISP=(,CATLG,CATLG),                       
 //           DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PO),
 //           SPACE=(TRK,(10,10,20)),UNIT=SYSDA