Non-XPLINK and XPLINK under TSO

Copy the IBM-supplied sample program and header file into your data set. For example, if your user prefix is PETE, store the sample z/OS® XL C program (CCNUAAM) in PETE.TEST.C(CTOF) and the header file in PETE.TESTHDR.H(CCNUAAN).

Steps for compiling, binding, and running the example program using TSO commands

Before you begin: Ensure that the Language Environment® runtime libraries SCEERUN and SCEERUN2, and the z/OS XL C compiler are in the STEPLIB, LPALST, or LNKLST concatenation.

Perform the following steps to compile, bind, and run the example program using TSO commands:

  1. Compile the z/OS XL C source. You can use the REXX EXEC CC to invoke the z/OS XL C compiler under TSO as follows:
    %CC TEST.C(CTOF) (LSEARCH(TESTHDR.H)
    
    -- or, for XPLINK --
    
    %CC TEST.C(CTOF) (LSEARCH(TESTHDR.H) XPLINK
    The REXX EXEC CC compiles CTOF with the default compiler options and stores the resulting object module in PETE.TEST.C.OBJ(CTOF).

    The compiler searches for user header files in the PDS PETE.TESTHDR.H, which you specified at compile time by the LSEARCH option. The system header files are searched in the data sets specified with the SEARCH compiler option, which defaults to CEE.SCEEH.+.

    For more information see Compiling under TSO.

    _______________________________________________________________

  2. Perform a bind:
    CXXBIND OBJ(TEST.C.OBJ(CTOF)) LOAD(TEST.C.LOAD(CTOF))
    
    -- or, for XPLINK --
    
    CXXBIND OBJ(TEST.C.OBJ(CTOF)) LOAD(TEST.C.LOAD(CTOF)) XPLINK

    CXXBIND binds the object module PETE.TEST.C.OBJ(CTOF) to create an executable module CTOF in the PDSE PETE.TEST.C.LOAD, with the default bind options. See Binding z/OS XL C/C++ programs for more information.

    _______________________________________________________________

  3. Run the program:
    CALL TEST.C.LOAD(CTOF)

    Example: When a message appears asking you to enter a Celsius temperature, enter, for example, 25.

    Result: The load module displays the following output: 25.00 Celsius is 77.00 Fahrenheit

    CALL runs CTOF from PETE.TEST.C.LOAD with the default runtime options in effect. See Running a C or C++ application for more information.

    _______________________________________________________________