12.8 Special Considerations for Interprogram Communication
•
upper—Forces all external data names, PROGRAM-ID names, and CALL
literals to be uppercase.
•
as_is—The case of literals used in CALL literals is taken as is. This is
useful when you are calling subroutines with mixed case (for example,
GetStatusRoutine). Data items defined with EXTERNAL will be treated
as lowercase. PROGRAM-ID names will be treated as uppercase.
The names option flag does not apply to the CANCEL verb or to the CALL verb
used with a data item. These language features are meaningful only when both
the calling program and the called program are Compaq COBOL programs.
12.8.4.2 Calling C Programs from Compaq COBOL on Tru64 UNIX and Windows NT
Because lowercase is the names option default, the names upper option is only
required to call C functions whose names contain uppercase letters, as described
in Table 12–2.
Table 12–2 C Routine Called by Statement: CALL ''Job1''
FLAG,
option
-names lowercase
/names=lower
-names uppercase
/names=upper
-names as_is
/names=as_is
For example, a Compaq COBOL program must be compiled with the names upper
option to be able to call a C program named JOB1.
12.8.4.3 Calling COBOL Programs from C on Tru64 UNIX and Windows NT
The lower and upper options to the
PROGRAM-ID as well as to the literals used with CALL literal. This makes it
possible for C programs to call Compaq COBOL programs with either lowercase
or uppercase names, as described in Table 12–3.
Table 12–3 C Invocation to Call COBOL PROGRAM-ID ''Job2''
FLAG,
option
-names lowercase
/names=lower
-names uppercase
/names=upper
-names as_is
/names=as_is
The lower(case) and upper(case) options to the
preserve the semantics of calls among Compaq COBOL programs. However, the
as_is option does not preserve these semantics. For example, the following code
fragment will have different behavior if compiled with as_is.
Interprogram Communication
Routine Called
job1( )
{}
JOB1( )
{}
Job1( )
{}
-names
flag and /names= option apply to the
Routine Called
job2( );
JOB2( );
not possible
-names
flag and /names= option
Interprogram Communication 12–31
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?
Questions and answers