Chapter Contents |
Previous |
Next |
Run-Time Argument Processing |
Command-line options have the form
=option
. Options specified in this way are only in effect for the current execution
of the program.
For example, under CMS the
=minimal
command-line option
is specified on the program's command line as follows:
cpgm arg1 =minimal
Specifying the option in this form indicates that you
want a minimal form of program linkage for only this execution of your program.
If you wanted always to have the
minimal
option in effect, however, you would code
it in the program as follows:
char _linkage = _MINIMAL;
Note that program option specification is not portable.
The run-time options can be grouped as follows:
Each group of options is discussed in detail in the following sections.
General Run-Time Options |
These options control basic
actions performed by the SAS/C Library.
Most of these options can be specified either directly on the command line
or in the program source. Command-line options begin with the equal sign
(=). Most command-line options can be negated using the prefix
no
. For example, the
negation of the
=warning
option can be specified as
=nowarning
.
General Run-Time Options lists sets of general options available for controlling run-time processing. Each option is discussed in detail following the table. The command-line specification is covered in the first section, followed by the program-specification form. General run-time options specified in the program source must be in uppercase.
=abdump
=a
SIGABRT
or
SIGABND
signal handler. Under OS/390,
=abdump
is only meaningful
in the case that an ABEND is recovered, since a dump is always produced (if
an appropriate DD card is allocated) if the ABEND is not recovered.
Obtaining an ABEND dump under the USS shell can be tedious,
because the mechanism that supports this (defining a SYSMDUMP data set before
invoking the TSO OMVS command to bring up the shell) applies to all descendants
of the shell. The
=abdump
run-time option overcomes this difficulty.
If
=abdump
is specified for a program with
exec
-linkage, the library
allocates the OS/390 data set userid.SASC.DUMP to the DDname
SYSUDUMP during program startup. If the file cannot be allocated (perhaps
because it is in use by another process) a diagnostic is generated and execution
proceeds normally. You can use a dump file other than userid.SASC.DUMP
with the
=abdump
option if you export the environment variable
ddn_SYSUDUMP
with the name of an alternate dump data
set.
=btrace
=b
=nobtrace
.
Note:
The
=btrace
name is used to distinguish this option from the
=trace
option, which invokes the debugger.
=cnftrace
LSCX077 TCP/IP Config Trace: [text]
=debug
=d
If you are executing an all-resident module using the
=debug
or
=trace
options, you must also define the macro name
ALLOW_TRANSIENT
in the
module that includes
<resident.h>
.
Note:
When you specify this option,
=fdump
option is also in effect.
=fillmem
is in effect unless it is
overridden. The default is
=nodebug
.
=fillmem
=fi
int
has a value of approximately --48,000,000),
which increases the chance that the error will be detected. The default is
=nofillmem
, unless the debugger is used. When the debugger is used,
=fillmem
is the default.
Note:
The use of
=fillmem
forces
the use of the
=fdump
linkage option.
Also, the use of
=fillmem
substantially increases execution time.
=hcsig
=hc
SIGFPE
,
SIGSEGV
, and
SIGILL
)
using SPIE or ESPIE. The default is
=hcsig
. Specifying
=nohcsig
prevents library handling of these signals. The following
characteristics also pertain to
=hcsig
:
=nohcsig
is in effect,
these signals cause an immediate abend; therefore, handling of overflow and
underflow by library mathematical routines is impossible in some cases.
=nohcsig
also applies to the debugger; therefore, the debugger
features for
recovery from invalid pointer usage are ineffective.
=nohcsig
and
=htsig
are used together, the SPIE or ESPIE macro is still used during ABEND handling
in order to protect the ABEND exit from errors caused by corruption of CONTROL
blocks. However, the SPIE or ESPIE in effect at the time of the ABEND is
always restored by the library's traceback routine before it returns control
to the system.
=htsig
=ht
SIGABRT
and
SIGABND
) using ESTAE under OS/390 or ABNEXIT under CMS. The default is
=htsig
. Specifying
=nohtsig
prevents library handling
of these signals.
Note:
When
=nohtsig
is in effect,
no traceback can be produced at program termination. Also, when the
system
function is used to call a TSO command, ESTAE is always used
to protect TSO from the effects of an ABEND during this processing. This
exit produces no messages and is in effect only during execution of the
system
function. Use of
=nohtsig
should seldom
be required. The library's ABEND handling routine is written so that it does
not interfere with other ABEND exits established by the caller of the C program
or by assembler routines called from C.
=multitask
=mu
=multitask
helps isolate
the programs and languages from each other and reduces the chances that an
error in one will cause the other to fail. However, use of
=multitask
causes additional overhead, and it is more suited for use during program
development than in a production program. The default is
=nomultitask
. Refer to the SAS/C Compiler Interlanguage Communication Feature
User's Guide for more information on the
=multitask
option.
Under OS/390,
=multitask
causes the C
program, the debugger, and each non-C language to run as a separate task.
The
fork
library function may not be used if
=multitask
is in effect.
=quit
=q
quiet
function, the
=quit
option has no effect unless
the
=warning
option is also specified. The default is
=noquit
.
=storage
=s
If you are executing an all-resident module using the
=storage
option,
you must also define the macro name
ALLOW_TRANSIENT
in the file that includes
<resident.h>
.
Under CMS, the report is written to STGRPT LISTING A1.
In TSO or under OS/390 batch, the report is written to DDname STGRPT. Under
the USS shell, the report is written to the file
storage.out
in the current
directory. If the report is created at normal program termination, it is titled
"Normal Termination Storage Report." If it is created during abnormal termination,
it is titled "Abnormal Termination Storage Report."
=usage
=u
=minimal
option. The default
is
=nousage
.
=version
LSCX056 SAS/C library release n.nnx (resident) release n.nnx (transient)where n.nnx is the release number. The release number of the resident library does not have to be the same as the release number of the transient library. This information can be helpful in determining library mismatches. See Chapter 1, "Introduction to the SAS/C Library," in SAS/C Library Reference, Volume 1 for information about using different releases of the Compiler and Library.
=warning
=w
quiet
function is used by the program to suppress
them. The
=warning
option also generates a traceback even when
the program is cancelled, as by an OS/390 operator cancel or a CMS HX command.
The traceback is ordinarily suppressed in this situation. This option may
be useful for getting diagnostic information about a looping program. The
default is
=nowarning
.
=xtrace
=x
=zeromem
=z
=nozeromem
.
Note:
Using
=zeromem
forces the use of the
=fdump
linkage option.
Also, using
=zeromem
substantially increases execution time.
If both
=fillmem
and
=zeromem
are specified,
=fillmem
is ignored.
To specify general run-time options in your program,
initialize the integer variable
_options
with one or more
bit flags to specifically request one or more options. The
_options
variable must be an external variable.
Include
<options.h>
to obtain
the names of the flags for assignment to
_options
. The currently
implemented options are as follows:
For example, the following code assigns flags to the
_options
variable:
extern int _options = _BTRACE + _WARNING; extern int _negopts = _NOHCSIG;
You can initialize the integer variable
_negopts
to reset (turn off) one or more options. Do not specify the same option
for both the
_options
and
_negopts
variables; if
you do, the result is undefined.
Include
<options.h>
to obtain
the names of the flags for assignment to
_negopts
. The following
are currently implemented options:
For example, the following code prevents the library handling of computational signals:
int _negopts = _NOHCSIG;
Linkage Run-Time Options |
Linkage options are
a subset of the library options that specify
which prolog and epilog code should be executed with your program. Even after
link-editing your program, you have some flexibility choosing which prolog
and epilog code is executed at function entry and return. The choice of linkage
option can affect considerably how fast the program executes and how easy
it is to debug. Note that the linkage options cannot be negated. The
=inter
option is the default linkage
option.
Linkage Run-Time Options summarizes the linkage run-time options. The linkage options and their effects follow the table.
Specified on the Command Line |
---|
=fdump
|
=inter
|
=minimal
|
=optimize
|
=fdump
=fd
=inter
=i
=minimal
=mi
=usage
in General Run-Time Options and to
=nnn/mmm
in
Memory Allocation Options for information on obtaining
the stack size to specify when you use the
=minimal
option.
Use of this option minimizes the overhead of function
calls, producing significant savings. However, all of the restrictions described
for optimized linkage also apply to minimal linkage. Also note that due
to the difference in automatic storage layout when
=minimal
is specified,
storing data outside the bounds of an array is more likely to overlay other
data.
=optimize
=o
indep
option cannot be used.
Optimized linkage is recommended for production programs that meet the restrictions described above.
You can initialize the character variable
_linkage
to specify a linkage option. Include
<options.h>
to obtain
the names of the values for assignment to
_linkage
. The following
are the currently implemented linkage options:
_FDUMP
|
supports dump formatting. |
_INTER
|
supports linkage with other languages. |
_MINIMAL
|
suppresses stack overflow checking. |
_OPTIMIZE
|
supports optimized linkage. |
The following is an example of assigning the
_FDUMP
option to the
_linkage
character variable:
extern char _linkage = _FDUMP;
Memory Allocation Options |
=nnn/mmm
nnn
is
the starting stack size and
mmm
is
the starting heap size. (The sizes can be expressed either as integers or
as integers followed by an upper- or lowercase K.) To specify a stack size
only, use
=nnn
(omit the slash).
To specify a heap size only, use
=/mmm
(include the slash). The default heap size is 4K. The default starting stack
size is 4K unless
=minimal
is specified, in which case the default
is 32K.
Note:
If the program initializes the external
variable
_mneed
to a non-zero
value to indicate the use of the obsolete
sbrk
function, the
mmm
portion of the statement is interpreted as the size
of the
sbrk
area rather than as the size of the heap.
exam =o nolist =/80k =noht "sep(' ')"
call (exam) '=o nolist =/80k =noht "sep('' '')"' asis
exam =o nolist =/80k =noht "sep(' ')"
// EXEC PGM=EXAM, // PARM='=o nolist =/80k =noht "sep('' '')"'
Each example invokes the program
exam
.
The library options
=optimize
and
=nohtsig
are specified, and an initial heap allocation of 80K is requested.
Two arguments, which have the values
nolist
and
sep(' ')
, are passed to
exam
.
These memory allocation options can be specified in the program as follows:
int _stack = value; int _heap = value; int _mneed = value;
You can initialize the integer
_stack
to a numeric value to request a specific initial allocation
of stack space.
You can initialize the integer
_heap
to a numeric value to request a specific initial allocation of heap (
malloc
) space.
You can initialize the integer
_mneed
to
a numeric value to request a specific initial allocation
of
sbrk
space.
The following is an example of how to force a large heap allocation:
int _heap = 1024000;
Note that you can override a
_heap
or
_mneed
specification by using the
=nnn/mmm
option for the command line.
Program-only Options |
You can initialize
the integer variable
_nio
to any non-zero value to indicate
that the C program performs no I/O with C library routines. The overhead of
opening the standard files and loading I/O routines can thus be avoided.
For example:
int _nio = nonzero ;
You can initialize the integer variable
_nlibopt
to any non-zero value to suppress the use of library
options or redirection
on the command line. If
_nlibopt
is set, all tokens on the
command line are passed to the program, even if they resemble run-time options.
For example:
int _nlibopt = nonzero ;
You
can initialize the pointer
_pgmnm
to the address of a string
literal to be used as the program name when no name can be obtained from the
operating system. For example:
char *_pgmnm = string ;
stkabv and stkrels External Compiler Variables |
In SAS/C Release 6.50, defining the external integer
variable
_stkabv
in the source program
(example:
extern int _stkabv = 1;
) will
indicate to the library to allocate stack space above the 16M line.
Note:
Setting the variable at run time will have no
effect; it must be initialized to 1 as shown.
However, some SAS/C library functions require their
stack space be allocated below the line due to their use of auto storage for
parameter lists and control blocks which still have a below-the-line requirement.
These library routines have been identified, and either modified to remove
the requirement, or changed to request that their own allocation of stack
space be located below the 16M line. Release 6.50 includes a compiler option
(STKBELOW) and a
CENTRY
macro parameter
(STKBELOW=YES) to allow user code to request that its stack space be allocated
below the line even if the
_stkabv
variable
is defined as non-zero.
A new option allows the library to release stack space
that is no longer needed. To free stack space, define the external integer
variable
_stkrels
(example:
extern int _stkrels = 1;
). This tells the library that, on return from
a function, if an entire stack segment becomes unused, the segment should
be returned to the operating system. This option is useful in long running
programs that contain code paths that can occasionally become deeply nested,
or in multi-tasking applications. Use of
_stkrels
and
_stkabv
guarantee that no
stack space is allocated below the line if none is required by an executing
routine.
Interleaved SYSOUT |
_isysout
_isysout
in the source program (for example,
extern int _isysout = 1;
) indicates to the library that access to data
sets with a SYSOUT type must be serialized. ABENDs may occur in a multitasking
program (notably, ABEND S02A, reason x'0C') when more than one task attempts to write
to a SYSOUT data set at the same time. The _isysout
variable must be initialized to 1 in each task of a multitasking SAS/C application
that could potentially write to a common SYSOUT data set.
This support is for OS/390 only, and OS/390 Name/Token services must be available at run time.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.