COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-59
ENTER COBOL
°
The function specifies a formal parameter whose type has no corresponding
COBOL type (see Appendix B, Data Type Correspondence).
Do not include the GIVING phrase in an ENTER statement that accesses an
HP C or HP C++ function whose type is a pointer.
Because the names of HP C++ routines are often modified to reflect their
classes and argument types, it is recommended that HP COBOL programs call
only regular HP C++ functions, not constructs that are peculiar to HP C++
(such as member functions and templates).
Restrictions on Calling pTAL Routines
If your HP COBOL program calls a TAL or pTAL routine that has a
string:length parameter, you only need to give the name of the corresponding
actual parameter, because the compiler can determine its length.
If a TAL or pTAL routine that has a string:length parameter does not ignore
trailing spaces and you want to pass it an actual parameter that is shorter than the
one defined for the corresponding formal parameter, use reference modification.
The HP COBOL code in Example 9-16 calls the pTAL routine
FILENAME_COMPARE_, which does not ignore trailing spaces and has two formal
parameters, filename1:length1 and filename2:length2.
ENTER COBOL
HP COBOL compilers treat ENTER COBOL as a comment. In implementations that
use ENTER to mark the beginning of an embedded routine in a language other than
COBOL, the ENTER COBOL statement ends the embedded routine and the
resumption of COBOL source code.
Example 9-16. Calling a pTAL Routine That Does Not Ignore Trailing Spaces
01 file-name-1 PIC X(255).
01 file-name-2 PIC X(255).
01 len-1 PIC 999 COMP.
01 len-2 PIC 999 COMP.
...
MOVE 0 TO len-1, len-2
INSPECT file-name-1 TALLYING len-1
FOR CHARACTERS BEFORE SPACE
INSPECT file-name-2 TALLYING len-2
FOR CHARACTERS BEFORE SPACE
ENTER "FILENAME_COMPARE_" USING file-name-1 (1: len-1)
file-name-2 (1: len-2)
GIVING ...
ENTER COBOL
.
VST150.vsd