Accessing Files Programmer's Guide (32650-90885)

Chapter 3 77
Specifying a File Designation
System-Defined Files
System-Defined Files
System-defined file designators indicate those files that the file system uniquely identifies
as standard input/output devices for jobs and sessions. These designators are described in
Table 3-1. on page 77 When you reference them, you use only the file name; group or
account names and lockwords do not apply.
As an example of how to use some of these designators, suppose you are running a
program that accepts input from a file programmatically defined as INFILE and directs
output to a file programmatically defined as OUTFILE. Your program specifies that these
are disk files, but you wish to respecify these files so that INFILE is read from the standard
input device and OUTFILE is sent to the standard listing device.
Table 3-1. System-Defined File Designators
FILE\DESIGNATOR
(NAME)
DEVICE/FILE REFERENCED
$STDIN The standard job or session input device from which your job/session is
initiated. For a session, this is always a terminal. For a job, it may be a
disk file or other input device. Input data images in this file should not
contain a colon in column 1, because this indicates the end-of-data. (When
data is to be delimited: use the EOD command, which performs no other
function.)
$STDINX Same as $STDIN except that MPE/iX command images (those with a colon
in column 1) encountered in a data file are read without indicating the
end-of-data; however, the commands :EOD and EOF (and in batch jobs, the
commands JOB, EOJ and DATA) are exceptions that always indicate
end-of-data, but are otherwise ignored in this context--they are never read
as data. $STDINX is often used by interactive subsystems and programs to
reference the terminal as an input file.
$STDLIST The standard job or session listing device, nearly always a terminal for a
session and a printer for a batch job.
$NULL The name of a nonexistent ghost file that is always treated as an empty
file. When referenced as an input by a program, that program receives an
end-of-data indication upon each access. When referenced as an output
file, the associated write request is accepted by MPE/iX but no physical
output is actually done. Thus, $NULL can be used to discard unneeded
output from a running program.