Interprogram Communication
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
Routine Called
-names lowercase
/names=lower
job1( )
{}
-names uppercase
/names=upper
JOB1( )
{}
-names as_is
/names=as_is
Job1( )
{}
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
-names
flag and /names= option apply 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
Routine Called
-names lowercase
/names=lower
job2( );
-names uppercase
/names=upper
JOB2( );
-names as_is
/names=as_is
not possible
The lower(case) and upper(case) options to the
-names
flag and /names= option
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 12–31
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......