Accessing Files Programmer's Guide (32650-90885)

Chapter 3 79
Specifying a File Designation
System-Defined Files
former is duplicated automatically on the latter. For example, input from a magnetic tape
device is printed on a line printer. You can determine whether a pair of files is interactive
or duplicative with the FRELATE intrinsic call. (The interactive/duplicative attributes of a
file pair do not change between the that time the files are opened and the time they are
closed.)
The FRELATE intrinsic applies to files on all devices. To determine if the input file INFILE
and the list file LISTFILE are interactive or duplicative, you could issue the following
FRELATE intrinsic call:
ABLE := FRELATE(INFILE,LISTFILE);
INFILE and LISTFILE are identifiers specifying the file numbers of the two files. The file
numbers were assigned to INFILE and LISTFILE when the HPFOPEN/FOPEN intrinsic
opened the files.
A half-word is returned to ABLE showing whether the files are interactive or duplicative.
The half-word returned contains two significant bits, 0 and 15:
if bit 15 = 1, INFILE and LISTFILE form an interactive pair
if bit 15 = 0, INFILE and LISTFILE do not form an interactive pair
if bit 0 = 1, INFILE and LISTFILE form a duplicative pair
if bit 0 = 0, INFILE and LISTFILE do not form a duplicative pair
Passed files
Programmers, particularly those writing compilers or other subsystems, sometimes create
a temporary disk file that can be automatically passed to succeeding MPE/iX commands
within a job or session. This file is always created under the special name $NEWPASS. When
your program closes the file, MPE/iX automatically changes its name to $OLDPASS and
deletes any other file named $OLDPASS in the job/session temporary file domain. From this
point on, your commands and programs reference the file as $OLDPASS. Only one file
named $NEWPASS and/or one file named $OLDPASS can exist in the job/session domain at
any one time.
The automatic passing of files between program runs is depicted in Figure 3-1. To
illustrate how file passing works, consider an example where two programs, PROG1 and
PROG2, are executed. PROG1 receives input from the actual disk file DSFILE (through the
programmatic name SOURCE1) and writes output to an actual file $NEWPASS, to be passed to
PROG2.($NEWPASS is referenced programmatically in PROG1 by the name INTERFIL.) When
PROG2 is run, it receives $NEWPASS (now known by the actual designator $OLDPASS),
referencing that file programmatically as SOURCE2. Note that only one file can be
designated for passing.