The DBSTUB1 invocation method is valid only for calling a COBOL program compiled with VS-COBOL or a non-reentrant assembler program. It is not valid for any other program such as a program written in COBOL, PL/I or any LE-compliant language. DBSTUB1 is an assembler front end that is linked with the actual procedure. The linked module name must match the name in the schema CALL statement. The entry point must point to DBSTUB1's entry point.
DBSTUB1 is written with DC system calling conventions. It runs in MPMODE=DB, which means that it holds a lock on MPMODE DB when it gains control. No other program that runs in MPMODE DB can run at the same time. Once it has control, it calls the database procedure that is linked with it. The procedure called must not issue any IDMS calls because during such a call, the MPMODE DB lock protection is lost.
Note: For more information about DC system calling conventions and MPMODE, see "Calling Conventions for Numbered Exits" in the CA IDMS System Operations Guide.
A unique DBSTUB1 must be written for and linked with each database procedure that needs this interface. Usually only the entry point that is called must be changed.
Following is a sample of DBSTUB1 that calls the CHECKIT database procedure.
DBSTUB1 TITLE 'Example of a DB procedure'
#MOPT CSECT=DBSTUB1,ENV=SYS
*
* The following code shows how a COBOL database procedure might
* be called in a multi-tasking environment. This program is
* linked with the COBOL procedure. The module name must be the
* same as the name coded in the Schema CALL statement.
* The entry point is STUBEP1.
*
* The following code emulates how DBMS calls DB procedures.
* When this procedure receives control the task is single
* threaded on the MPMODE=DB lock.
*
* On Entry: R1 already points to plist.
*
USING CSA,R10
STUBEP1 #START MPMODE=DB
L R15,=V(CHECKIT) Base linked DB Procedure.
CLC =X'4700',0(R15) Bif DC mode prog.
BE STUB010
*
#CHKSTK =(18+1) Make sure room on stack,
* for the savearea.
BALR R14,R15 Call Standard mode program.
B STUB020
*
STUB010 #CALL (R15) Call DC mode program.
*
STUB020 #RTN Return to DBMS.
LTORG
COPY #CSADS
END
Following is how DBSTUB1 would be linked with CHECKIT.
INCLUDE OBJLIB(DBSTUB1) INCLUDE OBJLIB(CHECKIT) ENTRY STUBEP1 MODE AMODE(31),RMODE(ANY) NAME CHECKIT(R)
|
Copyright © 2014 CA.
All rights reserved.
|
|