HPlogo Accessing Files Programmer's Guide > Chapter 2 Creating A File

The FILE Command

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 6 ♥
E0692 Edition 5

The FILE command is used to determine how a file will be accessed. You may use FILE to describe any of the characteristics available with HPFOPEN/FOPEN or BUILD, but you cannot actually create a file with the FILE command. While HPFOPEN/FOPEN and BUILD physically allocates space for a file and define its characteristics, the FILE command may only define how a file will be accessed at run time.

To be effective, a FILE command must be issued before your file is opened; it takes effect when the file is opened. A FILE command remains in effect until the job or session ends, until it is canceled with a RESET command, or until it is overridden by another command for the same file. Thus, if you enter a FILE command equating the formal designator DATAFL to the actual designator DISCFILE (indicating a disk file) and then run three programs that reference DATAFL, all three programs will access the file DISCFILE. If you wish to define other characteristics for the file, simply issue another FILE command; if you want to nullify the FILE command completely so that the formal designator has the characteristics originally specified by the program that is using it, issue a RESET command.

For example, suppose that you run two programs, both referencing a new temporary file named DFILE located on disk. Before you un the first program, you want to redefine the file so that it is output to the standard list device. To do this, you would issue a FILE command equating DFILE with the actual designator $STDLIST. In the second program, the file is again to be a temporary file on disk. You issue a RESET command so that the specifications supplied by the second program (rather than those in the FILE command) apply.

    JOB JNAME,UNAME.ANAME
   .
   .
   .
    FILE DFILE=$STDLIST
    RUN PROG1
   .
   .
   .
    RESET DFILE
    RUN PROG2
   .
   .
   .

A comparison of the parameters for FILE, FOPEN, and HPFOPEN is given in Table 2-3 "FILE, FOPEN, and HPFOPEN Parameters" For more information about using the FILE command, refer to the MPE/iX Commands Reference Manual.

Table 2-3 FILE, FOPEN, and HPFOPEN Parameters

CHARACTERISTIC FILE
PARAMETER
FOPEN
PARAMETER
HPFOPEN
PARAMETER
Formal file designatorformal
designator
formaldesignator formaldesignator
option

(itemnum=2)
Actual file designatorfilereference
$NEWPASS
$OLDPASS
$NULL
$STDIN
$STDINX
$STDLIST
Default file designator foption (Bits 10:3) designator option
(itemnum=5)
DomainNEW
OLD
OLDTEMP
Domain foption (Bits 14:2) domain option
(itemnum=3)
Logical record sizerecsize recsize record size option
(itemnum=19)
Block/buffer sizeblockfactor blockfactor block factor
option

(itemnum=40)
Record formatF
V
U
Record format foption (Bits 8:2) record format
option

(itemnum=6)
ASCII/Binary CodeASCII
Binary
ASCII/Binary foption (Bits 13:1) ASCII/Binary option
(itemnum=53)
Carriage-control characters supplied in FWRITECCTL
NOCCTL
Carriage-control foption (Bits 7:1) carriage-control
option

(itemnum=7)
Access modeIN
OUT
OUTKEEP
APPEND
INOUT
UPDATE
Access-type aoption (Bits 12:4) access type option
(itemnum=11)
Number of buffersnumbuffers
NOBUF
numbuffers (Bits 11:5) numbuffers option
(itemnum=44)
Exclusive/Share accessEXC
SEMI
SHR
EXCLUSIVE access aoption (Bits 8:2) exclusive option
(itemnum=13)
Multi accessMULTI
NOMULTI
GMULTI
Multiaccess mode aoption (Bits 5:2) multiaccess option
(itemnum=14)
MultirecordMR
NOMR
Multirecord aoption (Bits 11:1) multirecord option
(itemnum=15)
File dispositionDEL
SAVE
TEMP
N/Afinal disposition
option

(itemnum=50)
Device class name or logical device numberdevice devicedevice class option (itemnum=42)
device name option (itemnum=20)
Output priorityoutputpriority numbuffers (Bits 0:4) output priority
option

(itemnum=27)
NOWAIT input/outputNOWAIT
WAIT
NOWAIT I/O aoption (Bits 4:1) nowait I/O option
(itemnum=16)
Number of copiesnumcopies numbuffers (Bits 4:7) spooler copies option
(itemnum=34)
File codefilecode filecode filecode option
(itemnum=37)
File capacitynumrec filesize filesize option
(itemnum=35)
Total number of extentsnumextents numextents numextents option
(itemnum=47)
Extents initially allocatedinitalloc initalloc initial allocation
option

(itemnum=36)
FILE command prohibitionN/A Disallow FILE equation foption (Bits 5:1) disallow file equation option
(itemnum=9)
Dynamic file lockingLOCK
NOLOCK
Dynamic locking aoption (Bits 10:1) disallow file equation dynamic locking option
(itemnum=12)
Forms-alignment messageFORMS formmsg spooled message option
(itemnum=28)
User labels for disk fileN/A userlabels user labels option
(itemnum=33)
File labels for magnetic tape filesLABEL
NOLABEL
Labeled tape foption (Bit 6:1) labeled tape label
option

(itemnum=8)
File typeSTD CIR
MSG RIO
file type foption (Bits 2:3) file type option
(itemnum=10)
Mapped access methodN/A N/A short mapped option
(itemnum=18)
long mapped option
(itemnum=21)
large mapped option (itmenum=87)
Restrict file access according to execution levelN/A N/A privileged access
option

(itemnum=29)
file privilege
option

(itemnum=38)
Determine optimum pre-fetch algorithmN/A N/A will access option
(itemnum=39)
Fast file openN/A N/A UFID option
(itemnum=43)
Fill character for record paddingN/A N/A fill character option
(itemnum=45)
Formal file designator Pascal/iX string typeN/A N/A Pascal/iX string
option

(itemnum=51)
File equation string for file openN/A N/A file equation string
option

(itemnum=52)
KSAM key file recordN/AKSAM param KSAM parm option
(itemnum=54)
User object class numberN/AN/A object class option
(itemnum=56)




The BUILD Command


Summary of Overrides