Chapter Contents |
Previous |
Next |
Compiling C Programs |
This section explains how to use the LC370 EXEC, which invokes the SAS/C Compiler under CMS.
The LC370 EXEC |
Invoke the compiler with the LC370 EXEC as follows:
LC370 filename [[.] filetype [[.] filemode]] [(options [)]]
or
LC370 ddn:ddname [(options [)]]
where filename is the name of a C source file. The default filetype is C. If filemode is not specified, all accessed disks are searched. A DDN: type filename is illustrated in the following example:
LC370 DDN:SYSIN
where SYSIN is interpreted as a DDname defined by a FILEDEF. The following example is also acceptable:
LC370 DDN:ddname (member)
where member, which must be enclosed in parentheses, refers to a member of an OS/390 PDS. The member must immediately follow the DDname.
LC370 sf:filename [filetype [dirname]]
where dirname is the complete directory name or the NAMEDEF that has been logically assigned to it. If you omit filetype or dirname, the default filetype is C; the default directory name is a period (.), indicating the top directory.
You should issue a GLOBAL command for any MACLIB containing
#include
files before invoking LC370. The standard C macro
library is in
LC370 MACLIB. You also can set default options and default MACLIBs through
a GLOBALV variable. See Using Environment Variables to Specify Defaults.
The following is another sample command line that invokes the compiler:
LC370 PROG (COMN PR TRA NOX
In this command, the fileid of the source file is PROG
C. The compiler options used are
comnest
,
print
,
trans
, and
noxref
. These options are discussed
in Compiler Options.
Note:
The LC370 EXEC does not accept the short form of the
compiler options.
Compiling C Programs from XEDIT |
LCXED [(options [)]]
options can be any options acceptable to the LC370 EXEC.
Using Environment Variables to Specify Defaults |
The compiler references certain environment variables
The compiler and COOL query environment variables in the GLOBALV group LC370 to determine if any default options, MACLIBs, or TXTLIBs have been specified. GLOBALV Group LC370 Variables lists the environment variables that can be defined in the LC370 group.
Specifying Shared File System Directories |
#include
preprocessor directive.
The syntax of specifying an environment variable is as follows:
GLOBALV SELECT LC370 SETL environment-variable directory-list
where directory-list is the list of directories that you want to be searched. You may specify either a directory name or a NAMEDEF when listing a directory that you want to be searched. The directories specified by the environment variable are searched in the order in which you listed them.
GLOBALV SELECT LC370 SET _INCLUDE .C.PROJ1 .C.PROJ2
GLOBALV SELECT LC370 SETL MORE .SYSTEM.H .LOCAL.H
GLOBALV SELECT LC370 SETL _HEADERS .PROJECT.H .COMMON.H &MORE
GLOBALV SELECT LC370 SETL MORE .SYSTEM.H .LOCAL.H &MORE2
Other Environment Variables |
You
can specify a list of default compiler options with the OPTIONS
environment variable. If compiler options are specified both by using the
OPTIONS variable and on the command line, the command-line options override
those specified by the OPTIONS variable. You can specify a default list of
macros to be searched for header files with the MACLIBS environment variable.
You can specify a default list of TXTLIBs to be used for autocall in COOL
with the TXTLIBS environment variable. The EXECs also retain the current
GLOBALed MACLIBs and TXTLIBs before issuing a new GLOBAL command, and they
restore the status after the compiler or COOL has terminated. All of the
EXECs accept the
noglobal
option. If this option is used, no MACLIBs or TXTLIBs are
GLOBALed by the EXEC. For example, the following CMS GLOBALV command creates
a list of default options to be used when the compiler is invoked:
GLOBALV SELECT LC370 SETL OPTIONS COMNEST RENT HLIST
GLOBALV SELECT LC370 SETP MACLIBS LC370
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.