Calling Other Languages

If you are calling a function written in another language, the result type must be able to be mapped to a PL/I data type.

C often expects character strings to be null terminated, that is, the string is delimited by an '\0' byte immediately following the last character of interest. When constructing a character value in PL/I that is passed to a C function expecting a null terminator, the PL/I procedure must supply an explicit null character in the appropriate position. The BYTE built-in function can be used for this purpose, as shown in the following example.

call CFUNC('abcde' || BYTE(0))

or without the BYTE built-in using z-character constants,

call CFUNC('abcde'Z)