Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Where data is passed

It is as important for interacting routines to agree on what and where data is passed as it is for them to agree on how data is passed. With both PL/I and C, data can be passed on the stack, in general registers, or in floating-point registers.

In PL/I, the LINKAGE option (in the OPTIONS option of the procedure statement and entry declaration) determines where data is passed. One common way that errors in data location occur is if you specify mismatched linkage types (or fail to specify a linkage type when the default is incorrect).

PL/I for Windows supports three 32-bit linkage types-- OPTLINK, CDECL and STDCALL. The following PL/I declaration indicates that the function dosSleep uses the SYSTEM linkage:

  dcl dosSleep entry( fixed bin(31) byvalue )
               returns( fixed bin(31) )
               options( linkage(system) );

The options list should specify the linkage used by any C routines you call. Both the PL/I and VisualAge for C++ compilers use OPTLINK as their default linkage. Many C routines on Windows use the STDCALL linkage, and for these routines, LINKAGE(STDCALL) should be specified in the OPTIONS attribute. For instance, you would declare the Windows equivalent of DosSleep as:

  dcl Sleep    ext('Sleep')
               entry( fixed bin(31) byvalue )
               returns( fixed bin(31) )
               options( linkage(stdcall) );
Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide