Chapter Contents |
Previous |
Next |
Run-Time Argument Processing |
Redirections allow the choice of the standard input and
output files to be made at run-time. Redirections are affected by the
_style
variable. The
_style
variable must be an external
variable.
The
_style
variable can have the value
of any valid pathname style and determines the default style prefix. For example,
assume you have a program containing the following declaration:
char *_style = "tso";
Then, the following TSO program call would request that
stdin
be opened to
tso:input.data(file5)
:
call mypgms(simple) '<input.data(file5)'
Refer to the discussion of
_style
in Program Standard File Specification for additional information.
Alternate CMS Redirection Format |
simple -x -y <data.file.a >output.listing
simple -x -y <cms:rdr >printer
simple -x -y <(data file a) >(output listing)
simple -x -y <(rdr) >(printer)
This form of fileid is not subject to truncation in a tokenized parameter list.
Program Standard File Specification |
char *_stdinm = string , *_stdonm = string , *_stdenm = string ; char *_stdiamp = string , *_stdoamp = string , *_stdeamp = string ;
The
_std
xxxx
variable must be an external variable. The variables are used as follows:
_stdinm
to the address of a string
literal to name a specific file to be opened as
stdin
.
_stdonm
to the address of a string
literal to name a specific file to be opened as
stdout
.
_stdenm
to the address of a string
literal to name a specific file to be opened as
stderr
.
_stdiamp
to the address
of a string literal to define access-method parameters (amparms) to be used
by the library when opening
stdin
. This variable can be used to
control whether the program name is used as a prompt or whether any prompt
is issued at all. For example, the following statement suppresses the prompt:
char *_stdiamp = "prompt=";
The following statement causes the prompt "Enter command"
to be issued whenever
stdin
is accessed:
char *_stdiamp = "prompt=Enter command\n";
_stdoamp
to the address
of a string literal to define access-method parameters to be used by the library
when opening
stdout
.
_stdeamp
to the address
of a string literal to define access-method parameters to be used by the library
when opening
stderr
.
You
can also initialize the character pointer variable
_style
to address a string
that will be used by the run-time system as a style prefix for all I/O open
requests that do not specify a style prefix. However, note that
_style
is ignored for a program compiled with the
posix
option.
The format for
_style
is as follows:
char *_style = string ;
The string should be no longer than four characters
(not including the optional final colon and the terminating null). The value
specified for
_style
affects filenames specified on the command
line. For example, under CMS if
_style
is set to
ddn:
and PRINTER is specified on the command line, output is sent to
DDname PRINTER and not to your virtual printer.
Note:
Program option specification is not portable.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.