FSOPEN Macro FSOPEN Use the FS8PEN macro instruction to rea1y a file for either input or
output. The format of the FSOPEN macro instruction is: r- , I [label] FSOPEN {
fileid [,FSCB=fscb] } [,ERROR=erraddr][,optionS]" FSCB=fscb I L label is an optional statement label.
fileid specifies the CMS file identifier. It may be:
'fn ft fm'
(reg)
the fileid enclosed in single quote marks
separated by blanks. If fm is omitted, Al assumed.
and
is
a register other than 0 or containing the
address of the fileid (18 characters). When register format is used, the fileid must be
exactly 18 characters in length; 8 for the
filename, 8 for the filetype, and 2 for the
filemode. Fill shorter names with blanks.
FSCB=fscb specifies the address of an FSCB. It may be:
label
(reg)
ERROR=erraddr
the label on an FSCB macro instruction.
a register containing the address of an FSCB. specifies the address of an error routine to be given control
if an error is found. If ERROR= is not coded and an error
occurs, control returns to the next sequential instruction in
the calling program, as it does if no error occurs. You can specify any of the following FSCB macro on the FSOPEN macro instruction: BUFFER=buffer RECNO=number
BSIZE=size
RECFM=format NOREC=numrec These options may be specified either as the actual value (for
example, NOREC=l) or as a register that contains the value (for
example, NOREC= (3) where register 3 contains the value 1). When you use any of these options, the associated field in the FSCB is modified.
1. On return from the FSOPEN macro, register 1 points to the FSCB for
the file. If no FSCB exists, one is created in the FSOPEN macro
expansion. However, if the FSOPEN macro instruction is used to
ready an existing file, the BSIZE and RECFM fields are reset to
reflect actual file characteristics. 308 VM/370 eMS Command and Macro Reference
FSOPEN, FSREAD Macros 2. If you code both fileid and FSCB=, the fileid is used to fill in
the FSCB. 3. YO] can use the FSOPEN macro instruction to verify the existence of
a file to be opened for reading or writing and to create an FSCB fOL it.
If an error occurs, register 15 contains one of the following error
codes: 20 24
28
36 !1ยง!ling Invalid file identifier
Invalid filemode
File does not exist
Disk not accessed
FSREAD Use the FSREAD macro instruction to read a record from a disk file into
an 1/0 buffer. The format of the FSREAD macro instruction is: r I [label] I L- label
fileid
------------------------.-------------------------------,
FSREAD
{
fileid[,FSCB=fscb] }C,ERROR=erraddr] [,options] II FSCB=fscb
____ .--1 is an optional statement label.
specifies the CMS file identifier. It may be:
'fn ft fm' the fileid enclosed in single quotation marks and
separated by blanks. If fm is omitted, A1 is
assumed .. (reg) a register other than 0 or 1 containing the
address of the fileid (18 characters). When register format is used, the flleid must be
exactly 18 characters in length; 8 for the
filename, 8 for the filetype, and 2 for the
filemode. Shorter names must be filled with
blanks.
FSCB=fscb specifies the address of an FSCB. It may be:
label (reg) ERROR=eJ:"raddr the label of an FSCB macro instruction.
a register containinq the address of an FSCB. specifies the address of an error routine to be given control
if error is found. If ERROR= is not coded and an error
occurs, control returns to the next sequential instruction in
the callinq program, as it does if no error occurs.
Section 6. CMS Macro Instructions 309
Previous Page Next Page