Resolving API calls from z/OS clients dynamically
Instead of link-editing the Operational Decision Manager API stub program with your object code, you can dynamically call the stub from within your program. This can increase the portability of your program as you are able to use the same program in batch, IMS, and CICS® environments without link-editing the program again.
Before you begin
- Potentially increases the complexity of your programs
- Increase the storage that is required by your programs at execution time
- Reduce the performance of your programs
If the portability of the program outweighs the preceding limitations, then the API stubs can be dynamically called by using the COBOL and PL/I examples.
Procedure
- Dynamic linking by using COBOL in the batch environment:
... WORKING-STORAGE SECTION. ... 05 WS-HBRCONN PIC X(7) VALUE 'HBRCONN'. ... PROCEDURE DIVISION. ... CALL WS-HBRCONN USING HBRA-CONN-AREA. - If the compile option DYNAM is specified, then
you can code the Operational Decision Manager API
as a CALL literal and you will still get dynamic
behavior:
... CALL 'HBRCONN' USING HBRA-CONN-AREA. - Dynamic linking by using PL/I in the batch environment:In the HBRWSP copy book, modify the declarations of the API calls as follows. From:
dcl HBRCONN ext entry (pointer) OPTIONS (byvalue);To:dcl HBRCONN ext entry OPTIONS (assembler inter);Then, call as follows:
FETCH HBRCONN; CALL HBRCONN (HBRA_CONN_AREA); RELEASE HBRCONN;
| Environment | DDNAME | Operational Decision Manager PDS |
|---|---|---|
| Batch | STEPLIB | ++HBRHLQ++.SHBRLOAD |
| CICS | DFHRPL and STEPLIB | ++HBRHLQ++.SHBRCICS |
| IMS | STEPLIB | ++HBRHLQ++.SHBRIMS ++HBRHLQ++.SHBRLOAD |
For more information about COBOL STATIC versus DYNAMIC calls, see Making static calls and Making dynamic calls in IBM Knowledge Center.
For more information about the PL/I FETCH statement, see Fetching Enterprise PL/I routines in IBM Knowledge Center.