Chapter Contents

Previous

Next
Executing C Programs

Executing C Programs in TSO

Any C program can be run in TSO by use of the standard TSO CALL command. Note, however, that when a C program is executed using CALL, certain TSO oriented features are not available. In particular, the command name is not known to the program.

Alternately, your installation may provide a higher level of support for calling C programs from TSO. There are two higher levels available:

The following are examples of how you call a sample program from TSO at each level of support. In the examples, the library option =w overrides the program's use of the quiet function to suppress warnings. <input redirects stdin from the DDname INPUT. The final parameter, -z , is an argument to the program. See Run-Time Argument Processing for information about program parameters.

This statement uses the TSO CALL command to execute the program tsoexam . The data set containing tsoexam is library.name . The program parameters are surrounded by single quotes.

Note:    The CALL command translates program arguments to uppercase unless you specify the ASIS keyword.  [cautionend]

Both forms of the optional support (illustrated in the next two examples) require that your program data set be allocated to the DDname CPLIB. The examples assume that this has been done before the programs are invoked.

When you execute any C program in TSO, the transient run-time library must be allocated to the DDname CTRANS or installed in the system link list. Your installation will probably cause it to be allocated automatically; if not, you should use the TSO ALLOCATE command to associate this library with the DDname CTRANS.


Using the Debugger

Before using the SAS/C Debugger, it is recommended that you compile with the debug option. Debugger access to program source and variables is permitted only if the C program was compiled with debug . Note that if you compile with dbhook rather than with debug , debugging is limited to commands that do not involve source or SAS/C Debugger User's Guide and Reference variable access. If you compile without specifying either debug or dbhook , use of the debugger is limited to tracing or stopping execution at subroutine call and return.

In TSO, the debugger expects the debugger symbol table file to be allocated to the DDname DBGLIB at the start of execution. Alternately, you can use the debugger set search command in the debugger profile to inform the debugger of the location of symbol tables.

Refer to the SAS/C Debugger User's Guide and Reference for information on running the debugger in TSO.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.