BLZCMD API interface

BLZCMD provides an API interface to RTC services. You can call BLZCMD from a REXX exec or from JCL code.

Calling BLZCMD from REXX

For BLZCMD and any sub modules it calls to be found in the load module search order, the library containing the required load modules needs to be either in the STEPLIB or in LINKLST. If the library containing the required load modules is added to STEPLIB, ensure that it is also added to the APF list if any other modules in the STEPLIB require APF authorization.

Additionally, a sample program is provided in the hlq.SBLZEXEC library called BLZDECOD. This program will perform the required allocations to display a panel that presents a list of members that can be decoded by calling BLZCMD.

To call BLZCMD from REXX, use the Address ATTCHMVS command as shown in the following example:
/* REXX */                                                             
                                                   
  /* Clean up the allocations before we start */                       
  x = msg('off')                                                       
  Address TSO "FREE  F(BLZCMPIN)"                                      
  x = msg('on')                                                        
                                                                       
  DSN      = 'USER01.ENCODE.LIST'                                     
  Member   = 'BLZBUFRS'                                                
                                                                       
  Drc = bpxwdyn("ALLOC DD(BLZCMPIN) DA('"DSN"("Member")') SHR")     
  Drc = bpxwdyn("ALLOC DD(BLZERROR) cyl space(1,1) dsorg(ps) " ||,        
                    "unit(sysallda) lrecl(131) recfm(f,b)  new msg(1)")    
                                                                       
  request  = 'ENCODE'   /* ENCODE or DECODE                          */     
  indd     = 'BLZCMPIN' /* Input DD - Already allocated              */          
  outdd    = 'BLZCMPIN' /* Output DD - Already allocated             */          
  unit     = 'VIO'      /* Unit to be used for temporary data sets   */          
  userid   = 'USER01'   /* Userid to be used for temporary data sets */     
  cmpchk   = 'Y'        /* Check if already encoded                  */     
                                                                       
  PARMS    = request','indd','outdd','unit','userid','cmpchk                                                                    
                                                                       
  Address ATTCHMVS 'BLZCMD PARMS'
  Say RC
  /*-----------------------------------------------------------------*/ 
  /* Alternatively use "TSOEXEC CALL *(BLZCMD) '"PARMS"'"            */  
  /*-----------------------------------------------------------------*/ 
  
  /* Display error messages */
  "EXECIO * DISKR BLZERROR (FINIS STEM blzerror." 
  Do x = 1 to blzerror.0                          
    Say Strip(blzerror.x)                         
  End                                                                                                            
                                                                       
  x = msg('off')                                                       
  Drc = bpxwdyn("FREE DD(BLZCMPIN)")                                   
  x = msg('on')
Exit

Calling BLZCMD from JCL

To call BLZCMD from JCL, use EXEC PGM=BLZCMD as shown in the following example:
//*                                                         
//* Decode member contents                                  
//*                                                         
//BLZCMD  EXEC PGM=BLZCMD,                                  
//   PARM='DECODE,BLZCMPIN,BLZCMPIN,SYSALLDA,USER01,Y'      
//STEPLIB   DD DISP=SHR,DSN=BLZ.SBLZLOAD                    
//BLZCMPIN  DD DISP=SHR,DSN=USER01.ENCODE.LIST(BLZBUFRS)    
//BLZERROR  DD SYSOUT=*

RTC Services

Each service description includes the following information:
Description
A description of the function and operation of the service.
REXX command format
The syntax that you use to code the service, showing the command.
Parameters
A description of any required or optional keywords or parameters.
Return Codes
A description of the codes the service returns. For all services, a return code of 12 or higher implies a severe error. The error is usually a syntax error, but it can be any severe error detected when using the services.
Examples
Sample usage of the service.

The ENCODE service

The ENCODE service enables you to compress a data set member in a PDS.

Format of the command to start the service
>>-BLZCMD--ENCODE,in_ddn,out_ddn,temp_unit,userid,compress_check--><
ENCODE
Specifies that the input data set and member defined by the in_ddn value are compressed into the output data set and member defined by the out_ddn value. If the input is already compressed, the service returns a code of 4.
in_ddn
The DD name that is allocated to the data set and member used as input to the ENCODE service. The maximum length of the in_ddn value is eight characters.
out_ddn
The DD name that is allocated to the data set and member used as the output of the ENCODE service. The maximum length of the out_ddn value is eight characters.
Note: The in_ddn and out_ddn values can be the same if the compressed output is intended to replace the input.
temp_unit
The DASD unit type used in the allocation of temporary data sets by the ENCODE process. For example, VIO or SYSALLDA. The maximum length of the temp_unit value is eight characters.
user ID
The user ID that is used for the allocation of temporary data sets by the ENCODE process. The maximum length of the user ID value is eight characters.
compress_check
A flag to have the ENCODE service to check whether a member is already compressed. The maximum length of the compress_check value is one character, with a value of Y or N.
Return codes
Possible return codes:
0
The compression of the in_ddn data set was successful and placed in the out_ddn data set.
4
The in_ddn data set and member are already compressed.
12
There was an error. Refer to the error messages for more information.

The DECODE service

The DECODE service enables you to decompress a data set member in a PDS.

Format of the command to start the service
>>-BLZCMD--DECODE,in_ddn,out_ddn,temp_unit,userid,compress_check--><
DECODE
Specifies that the input data set and member defined by the in_ddn value are decompressed into the output data set and member defined by the out_ddn value. If the input is already decompressed, the service returns a return code of 4.
in_ddn
The DD name that is allocated to the data set and member used as input to the DECODE service. The maximum length of the in_ddn value is eight characters.
out_ddn
The DD name that is allocated to the data set and member used as the output of the DECODE service. The maximum length of the out_ddn value is eight characters.
Note: The in_ddn and out_ddn values can be the same if the decompressed output is intended to replace the input.
temp_unit
The DASD unit type used in the allocation of temporary data sets by the DECODE process. For example, VIO or SYSALLDA. The maximum length of the temp_unit value is eight characters.
user ID
The user ID that is used for the allocation of temporary data sets by the DECODE process. The maximum length of the user ID value is eight characters.
compress_check
A flag to have the DECODE service to check whether a member is already decompressed. The maximum length of the compress_check value is one character, with a value of Y or N.
Return codes
Possible return codes:
0
The decompression of the in_ddn data set was successful and placed in the out_ddn data set.
4
The in_ddn data set and member are already decompressed.
12
There was an error. Refer to the error messages for more information.