A SERVICE OF

logo

246 Chapter 4
Command Definition F-K
FILE
To use the FILE command for a file, you must have a valid, formal file designator (the
name by which your program recognizes the file). The formal file designator provides a way
for commands and code outside your program to reference the file. The FILE command is
the only way you can control or change the programmatic file specifications without
changing the code which calls FOPEN or HPFOPEN.
Use
This command may be issued from a session, a job, a program, or in BREAK. Pressing
Break has no effect on this command.
Examples
To run the program MYPROG, which references two files by the file names (formaldesignators)
SOURCE and DEST, but to use two existing disk files INX and OUTX as the actual files for the
program, enter:
FILE SOURCE=INX
FILE DEST=OUTX
RUN MYPROG
Enter the following command to send the output to a new file FILEX. The parameters
entered on the command line define FILEX as having 64-word fixed-length records, blocked
two records per block in ASCII code; it is limited to 800 records among 10 extents, two of
which are to be immediately allocated. When MYPROG closes the file, it will be permaently
saved.
FILE DEST=FILEX,NEW;REC=64,2,F,ASCII;DISC=800,10,2;SAVE
RUN MYPROG
Note that the file equation only modifies those items specified. All other attributes used
come from the parameters specified in the FOPEN or HPFOPEN call (or the defaults where
parameters are omitted) for the file DEST.
Implicit File Commands for Subsystems
When an actual file designator appears as a command parameter, it is automatically
equated to a formal file designator. This is then used within the subsystem by an implicit
FILE command issued by the command executor. For instance, within the FORTRAN
77/XL compiler the formal file designator for the text file input is FTNTEXT. Suppose you
specify a file named ALSFILE for text file input as shown below:
FTNXL ALSFILE
MPE/iX implicitly issues the following FILE command, invisible to you:
FILE FTNTEXT=ALSFILE
You cannot backreference any of the formal file designators associated with the command
as actual file designators. Therefore, do not use the formal file designators FTNTEXT,
FTNUSL, or FTNLIST as actual file names. The use of FTNTEXT as a file name, as in the
following example, is invalid because the implicit FILE command issued by the FORTRAN
compiler then backreferences itself:
FTNXL *FTNTEXT
FILE FTNTEXT=*FTNTEXT