EXTERNAL WAIT time for a batch program running in CV mode
search cancel

EXTERNAL WAIT time for a batch program running in CV mode

book

Article ID: 12066

calendar_today

Updated On:

Products

IDMS IDMS - Database IDMS - ADS

Issue/Introduction

Sometimes, it is required to use specific EXTERNAL WAIT times for batch programs running in CV mode, because due to their functionality, they may be permitted to use a higher EXTERNAL WAIT time than the one specified at SYSTEM level.

The EXTERNAL WAIT time to be used for the entire Central Version must be specified in the SYSGEN SYSTEM statement by means of the EXTERNAL WAIT time parameter.

EXTERNAL WAIT time is the amount of time the DC/UCF system waits for an external user session (batch job or CICS task), to issue a database request before assuming that it has terminated. When the EXTERNAL WAIT time elapses, the system abnormally terminates the external request unit with an error status of nn69 and initiates recovery procedures.



Such batch programs can call several subprograms and each of these programs can create their own database run unit. It is even possible that the run-units for these subprograms will access different back-end CVs.

The question is how to define an EXTERNAL WAIT time for all of these programs.

Assume the following example :

A Cobol batch program called BELMAIN creates a database run unit and calls 2 subprograms, BELBAT1 and BELBAT2.

The main program and the subprograms need to access a database and therefore create their own database run unit. Furthermore, BELMAIN and BELBAT1 need to setup a connection with IDMS CV "SYSTEM02" because their databases are accessed via that CV, but BELBAT2 needs to setup a connection with IDMS CV "SYSTEM01" because its database is accessed via SYSTEM01.

 

 

 

Environment

CA IDMS all supported releases.

Resolution

In order to accomplish this, you need to define a TASK in each CA-IDMS Central Version that needs to be accessed. The name of the task MUST correspond with the name of the program in the //EXEC PGM= statement in the batch jobstep.

This TASK statement needs to invoke program RHDCNP3S and can be used to specify the EXTERNAL WAIT time to be used for this task.

The task needs to be defined in SYSGEN. Note that this is a permanent definition but it will only be active after a recycle of the Central Version. In conjunction with this definition, the task can also be defined dynamically by means of a DCMT VARY DYNAMIC TASK command. This DCMT command will be active immediately, but it is a temporary definition because it will disappear at shutdown.

Syntax :

1. SYSGEN TASK definition

    ADD TASK taskname                       
       INVOKES PROGRAM RHDCNP3S        
       NOINPUT                         
       NOMAP                           
       EXTERNAL WAIT IS nnnn            
       .

2. DCMT command

    DCMT VARY DYNAMIC TASK taskname INVOKES RHDCNP3S EXTERNAL WAIT nnnn .                        

 

Continuation of the example shown above. Assume that the batch job needs to run with an EXTERNAL WAIT of 60 seconds.

1.  Exec statement in batch job :

       //    EXEC PGM=BELMAIN

2.  External Wait definitions used at SYSTEM level in all of the involved CA-IDMS Central Versions :

    *+   ADD SYSTEM 01            
    *+       EXTERNAL WAIT IS 20 

    *+   ADD SYSTEM 02             
    *+       EXTERNAL WAIT IS 30  

3.  Required TASK definitions  (in all involved CVs) :

    ADD TASK BELMAIN                 
        INVOKES PROGRAM RHDCNP3S  
        NOINPUT                   
        NOMAP                     
        EXTERNAL WAIT IS 60        
        .
    and eventually

    DCMT VARY DYNAMIC TASK BELMAIN INVOKES RHDCNP3S EXTERNAL WAIT 60 .

 

Immediately after the batch job is submitted, a DCMT DISPLAY ACTIVE TASK command is executed on both SYSTEM67 and SYSTEM65. The output confirms that the batch job made a connection with the CVs and created a (ERUS) task on them :

  Taskid   Taskcd   Prog     LTERM    Pri Stat Stim  A(ECB)  ECB Type          
0000000133 BELMAIN  BELMAIN  LD000000 100 WAIT 0055 2D91B438 EREECB            
V02  ENTER NEXT TASK CODE:      CA IDMS release 19.0 tape GJJ03I node SYSTEM02  

  Taskid   Taskcd   Prog     LTERM    Pri Stat Stim  A(ECB)  ECB Type         
0000000058 BELMAIN  BELMAIN  LD000002 100 WAIT 0050 28B0A468 EREECB           
V01  ENTER NEXT TASK CODE:      CA IDMS release 18.5 tape GJI50B node SYSTEM01

The "Stim" column indicates the Stall Time, which here corresponds with the External Wait time. The values of 55 and 50 respectively show the batch task was started with an EXTERNAL WAIT of 60 seconds on both systems, and that the DCMT commands were executed 10 and 15 seconds after the batch job was started.  

OPER WATCH DATABASE shows the run units that are created by the batch programs :

-  On SYSTEM02

     IDMS-DC Release 1900     Display DB activity            Line 1     of 22  
 Task Id   Orig IDMSProg Subschem Pri Sta V# PageRead PageWrit CallIDMS LOCK-Rq
0000000149 BATC BELBAT1  EMPSS02  100   A 11 00000000 00000000 00000004 00000003
0000000149 BATC BELMAIN  EMPSS01  100   A 19 00000000 00000000 00000003 00000003

- On SYSTEM01

     IDMS-DC Release 1850     Display DB activity            Line 1     of 12  
 Task Id   Orig IDMSProg Subschem Pri Sta V# PageRead PageWrit CallIDMS LOCK-Rq
0000000068 BATC BELBAT2  EMPSS02  100   H 11 00000000 00000000 00000004 00000005
  

Conclusion :

Despite the EXTERNAL WAIT time of 20 seconds and 30 seconds on SYSTEM01 and SYSTEM02 respectively, the batch job is running with an EXTERNAL WAIT of 60 seconds on these CVs.

Additional Information

IDMS 19.0, External Wait Time