OpenTP1 Version 7 Programming Guide
Use the C, C++ or COBOL language when coding OpenTP1 UAPs. Not only OpenTP1 facilities, but also standard OS facilities and structured query language (SQL) can be used for OpenTP1 UAPs. For details of the coding rules, see the applicable OpenTP1 Programming Reference manual. For details on the SQL coding rules, see the appropriate reference manual.
Code the UAP in either the ANSI C format or the pre-ANSI K&R format (Classic C). To use an OpenTP1 facility from the UAP, call the corresponding OpenTP1 library function.
Code the UAP in the ANSI C format according to the C++ specification. To use an OpenTP1 facility from the UAP, call the corresponding OpenTP1 library function. Note that linking the UAP coded in C++ causes the OpenTP1 library function to be linked and operated as a C function because the header file (dcxxx.h) specifies that OpenTP1 library functions should be linked to elements written in C.
As in the case of OS-provided standard functions, when calling functions, set their arguments.
Whether a function has been normally executed can be determined from the return value from the function. Some functions give return values, whereas others do not.
The figure below shows UAP coding in C.
Figure 1-20 Outline of UAP coding in C
COBOL/2# or COBOL85 is available for UAP coding in the COBOL language. To use OpenTP1 facilities from the UAP, use COBOL-UAP creation programs corresponding to OpenTP1 library functions. The COBOL-UAP creation program is called by the CALL statement in COBOL and transfers control from UAP processing to the OpenTP1 library.
The figure below shows UAP coding in COBOL.
Figure 1-21 Outline of UAP coding in COBOL
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.