Previous Topic: Overriding Subschemas (Release 10.2)Next Topic: Overriding an Online Program's Subschema


Overriding a Batch Program's Subschema

To override the subschema named in a batch application program in the z/OS environment, perform the following steps:

  1. Include an 01-level LINKAGE SECTION entry that names two subordinate data items:
    01  RUNTIME-TEST-PARMS.
    
        05 PARM-LENGTH             PIC S9(4) COMP.
        05 RUNTIME-TEST-SUBSCHEMA  PIC X(8).
    
  2. Include a USING statement in the PROCEDURE DIVISION heading:
    PROCEDURE DIVISION USING RUNTIME-TEST-PARMS.
    
  3. Before issuing any BIND statements, perform processing to determine if a subschema override has been included in the execution JCL:
    IF PARM-LENGTH NOT EQ ZERO
       MOVE RUNTIME-TEST-SUBSCHEMA TO SUBSCHEMA-SSNAME.
    
  4. Issue database BINDS and perform other processing as needed
  5. At run time, include a PARM option in the JCL EXEC statement that specifies the name of the alternative subschema

Local Mode Considerations

The database and the appropriate subschemas must be defined in the database name table in the load (core-image) library.

Note: For more information about the database name table, see CA IDMS Database Administration Guide.

'Z/VSE users'. You can pass the alternative subschema name by using a SYSPARM:

// OPTION SYSPARM=ssname.

Example of Overriding a Batch Subschema

The program excerpt and JCL below illustrate the batch subschema override technique in the z/OS COBOL environment.

The PARM option on the EXEC statement specifies the name of a test subschema used to override the production subschema. If the parameter is passed, the application program moves the parameter to the SUBSCHEMA-SSNAME field in program variable storage before issuing the BIND RUN-UNIT command.