If you are using a programming language other than COBOL II to call GeoTAX, you must first initialize the COBOL II runtime environment using the COBMSTUB or COBMINI program. The following sections describe these methods.
Using COBMSTUB to Initialize the COBOL II Runtime Environment
If the non-COBOL II user-written program that calls GeoTAX is a batch program, you can use COBMSTUB to initialize the runtime environment. COBMSTUB is a stub program that ships with GeoTAX. With this method, the name of the user-written program is passed as a parameter, through JCL or other means, to COBMSTUB. COBMSTUB becomes the top program in the calling stack and causes the COBOL II runtime environment to initialize before the user-written program executes. We recommend that the user-written program perform a dynamic call to the GeoTAX callable.
Using COBMINI to Initialize the COBOL II Runtime Environment
If you are using an older version of COBOL (pre-COBOL II), complete the following to initialize the COBOL II runtime libraries.
-
Add the following to the WORKING_STORAGE SECTION:
10 COBM-RETURN-CODE PIC S9 (9) COMP VALUE ZERO 88 COBMINI-OK VALUE ZERO 88 COBMTRM-OK VALUE ZERO
-
Add the following to the PROCEDURE DIVISION to execute once before the first call to a GeoTAX callable:
CALL 'COBMINI' USING COBM-RETURN-CODE. IF NOT COBMINI-OK (handle error condition and abend)
-
After the last call, you can optionally add the following:
CALL 'COBMTRM' USING COBM-RETURN-CODE. IF NOT COBMTRM-OK (handle error condition and abend)
-
Compile the COBOL and link with the COBOL static link library.
If you use a language other than COBOL, you can apply the same techniques as described above, but you must convert the COBOL language syntax into your programming language's syntax.
Using Assembler to Initialize the COBOL II Runtime Libraries
If you are using Assembler, complete the following to initialize the COBOL II runtime libraries.
-
Add the following constants:
COBMINIT DC F'0' COBMINI RETURN CODE INITIALIZE COBMTERM DC F'0' COBMINI RETURN CODE TERMINATE
-
Add the following to execute once before the first call to a GeoTAX callable:
CALL COBMINI, (COBMINIT) COBOL II INITIALIZATION L 15,COBMINIT C 15,=F'4' CHECK RETURN CODE BNH INITOK . . . (handle bad return code from COBOL II initialization)
-
After the last call, you can optionally add the following:
CALL COBMINI, (COBMTERM) COBOL II TERMINATION L 15,COBMTERM LTR15, 15 CHECK RETURN CODE BZ TERMOK C 15,=F'16' CHECK RETURN CODE BE TERMOK (handle bad return code from COBOL II termination)
-
Assemble the program and link with the COBOL II static link library from the distribution media.