HPlogo Accessing Files Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 2 Creating A File

The FILE Command

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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-4 “FILE, FOPEN, and HPFOPEN Parameters”. For more information about using the FILE command, refer to the MPE/iX Commands Reference Manual (32650-90003).

Table 2-4 FILE, FOPEN, and HPFOPEN Parameters

CHARACTERISTIC:FILE\PARAMETERFOPEN\PARAMETERHPFOPEN\PARAMETER
Formal file designator

formaldesignator

formaldesignator

formaldesignator option (itemnum=2)

Actual file designator

filereference $NEWPASS $OLDPASS $NULL $STDIN $STDINX $STDLIST

Default file designator foption (Bits 10:3)

designator option (itemnum=5)

Domain

NEW OLD OLDTEMP

Domain foption (Bits 14:2)

domain option (itemnum=3)

Logical record size

recsize

recsize

record size option (itemnum=19)

Block/buffer sizeblockfactorblockfactor

block factor option (itemnum=40)

Record format

F V U

Record format foption (Bits 8:2)

record format option (itemnum=6)

ASCII/Binary Code

ASCII Binary

ASCII/Binary foption (Bits 13:1)

ASCII/Binary option (itemnum=53)

Carriage-control characters supplied in FWRITE

CCTL NOCCTL

Carriage-control foption (Bits 7:1)

carriage-control option (itemnum=7)

Access mode

IN OUT OUTKEEP APPEND INOUT UPDATE

Access-type aoption (Bits 12:4)

access type option (itemnum=11)

Number of buffers

numbuffers NOBUF

numbuffers (Bits 11:5)

numbuffers option (itemnum=44)

Exclusive/Share access

EXC SEMI SHR

EXCLUSIVE access aoption (Bits 8:2)

exclusive option (itemnum=13)

Multi access

MULTI NOMULTI GMULTI

Multiaccess mode aoption (Bits 5:2)

multiaccess option (itemnum=14)

Multirecord

MR NOMR

Multirecord aoption (Bits 11:1)

multirecord option (itemnum=15)

File disposition

DEL SAVE TEMP

N/A

final disposition option (itemnum=50)

Device class name or logical device numberdevicedevice

device class option (itemnum=42) device name option (itemnum=20)

Output priorityoutputprioritynumbuffers (Bits 0:4)

output priority option (itemnum=27)

NOWAIT input/output

NOWAIT WAIT

NOWAIT I/Oaoption (Bits 4:1)

nowait I/O option (itemnum=16)

Number of copiesnumcopiesnumbuffers (Bits 4:7)

spooler copies option (itemnum=34)

File codefilecodefilecode

filecode option (itemnum=37)

File capacitynumrecfilesize

filesize option (itemnum=35)

Total number of extentsnumextentsnumextents

numextents option (itemnum=47)

Extents initially allocatedinitallocinitalloc

initial allocation option (itemnum=36)

FILE command prohibitionN/ADisallow FILE equation foption (Bits 5:1)

disallow file equation option (itemnum=9)

Dynamic file locking

LOCK NOLOCK

Dynamic locking aoption (Bits 10:1)

disallow file equation dynamic locking option (itemnum=12)

Forms-alignment messageFORMSformmsg

spooled message option (itemnum=28)

User labels for disk fileN/Auserlabels

user labels option (itemnum=33)

File labels for magnetic tape files

LABEL NOLABEL

Labeled tape foption (Bit 6:1)

labeled tape label option (itemnum=8)

File type

STD CIR MSG RIO

file type foption (Bits 2:3)

file type option (itemnum=10)

Mapped access methodN/AN/A

short mapped option (itemnum=18) long mapped option (itemnum=21)

Restrict file access according to execution levelN/AN/A

privileged access option (itemnum=29) file privilege option (itemnum=38)

Determine optimum pre-fetch algorithmN/AN/A

will access option (itemnum=39)

Fast file openN/AN/A

UFID option (itemnum=43)

Fill character for record paddingN/AN/A

fill character option (itemnum=45)

Formal file designator Pascal/iX string typeN/AN/A

Pascal/iX string option (itemnum=51)

File equation string for file openN/AN/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)

 

Feedback to webmaster