Example 12–2 Run Unit with a Main Program and Two Contained Programs
Special Code for Programs Called ''main'' (Tru64 UNIX)
On the Tru64 UNIX operating system, if you have a main program called main,
that program preempts a COBOL Run-Time Library (RTL) initialization routine
also called main. This RTL routine is needed to make a CALL data-name
statement (or
main must supply the necessary code by calling the cob_init routine in the RTL.
The cob_init routine specification (in C) is as follows:
void cob_init (
int argc,
char **argv,
char **envp
)
A Compaq COBOL program called MAIN will only interfere with main if
it was compiled with the
12.2 COBOL Program Attributes
Any Compaq COBOL program can have the INITIAL clause in the PROGRAM-ID
paragraph. Data and files in a COBOL program can have the EXTERNAL
clause.
12.1 Multiple COBOL Program Run Units
IDENTIFICATION DIVISION.
PROGRAM-ID. MAIN-PROGRAM.
.
.
.
CALL SUB1.
.
.
.
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB1.
.
.
.
CALL SUB2.
EXIT PROGRAM.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB2.
.
.
.
EXIT PROGRAM.
END PROGRAM SUB2.
END PROGRAM SUB1.
END PROGRAM MAIN-PROGRAM.
cobfunc, cobcall, cobcancel
/* init the RTL */
/* argument count */
/* arguments */
/* environment variable pointers */
-names lowercase
Interprogram Communication
4
5
6
) work correctly. Your program
Note
flag.
Interprogram Communication 12–3
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?
Questions and answers