FSCB, FSCBD Macros NOREC=numrec specifies the
read operation.
number of records to
The default is 1.
be read in the next
1. The options RECFM, BUFFER, BSIZE, RECNO, and NOREC must all be
specified as self-defining terms.
2. You can use the same FSCB to reference several different files; you
can override the fileid, or any of the options, on the FSOPEN, or FSREAO macro instructions when you reference a file via
its FSCB. However, if the FSOPEN macro instruction is used to ready an existing file, the BSIZE and fields in the FSCB are
reset to reflect actual file characteristics.
3. You can use multiple FSCBs to reference the same file, for example,
if you wanted one FSCB for writing and a different FSCB for reading
the file. Keep in mind, however, that the file characteristics are
inherent to the file and not to the FSCB. If you establish a read
or write pointer using the RECNO option in one FSCB, that pointer
remains unchanged unless you specify the RECNO option again on the
same or any other FSCB for that file. FSCBD Use the FSCBD macro instruction to generate a DSECT for the file system
control block (FSCB). The format of the FSCBD macro instruction is: r ,
i [label] L- FSCBD label is an optional statement label. The first statement in the FSCBD macro expansion is labeled FSCBD. 1. You can use the labels established in the FSCB DSECT to modify the
fields in an FSCB for a particular file. An FSCB is created
explicitly by the FSCB macro instruction, and implicitly by the FSREAO, and FSOPEN macro instructions.
2. The FSCBD macro expands as follows: FSCBD FSCBCOMM FSCBFN FSCBFr-1 FSCBITNO FSCBBUFF FSCBSIZE FSCBFV FSCBNOIT FSCBNOFD FSCBD OSECT OS CL8 DS CL8 DS CL8 DS CL2 DS H DS A OS F OS CL2 DS H DS A Command
Filename
Filetype
Filemode
Rela ti ve record (item) number
Address of read/write buffer
Length of buffer
Record format (F or V) Number of records to be read/written
Number of bytes actually read
section 6. CMS Macro Instructions 305
FSCLOSE Macro FSCLOSE Use the FSCLOSE macro instruction to close an open file and save its
current status on disk. The format of the FSCLOSE macro instruction is: .------- I r labe11 I L- __ _
label
fileid FSCLOSE {
fileid(,FSCB=fscb] } [,ERROR=erraddr] FSCB=fscb , I I is an optional statement label.
specifies the CMS file identifier. It may be:
'fn ft fm' 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 fileid must be
exactly 18 characters in 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)
the label on the FSCB macro instruction.
a register containing the address of an FSCB. ERROR=erraddr 1.
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 callinq program, as it does if no error occurs.
Although CMS routines close files when a command
completes execution, you must use the FSCLOSE macro
when you are executing a program from within an EXE:, are going to read and write records in the same file.
or program
instruction
or when you
2. If you specify both fileid and FSCB, the fileid is used to fill in
the FSCB. If an error occurs, register 15 contains the following error code: File not open 306 IBM VM/370 CMS Command and Macro Reference
Previous Page Next Page