FSWRITE Macro
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 FSCB for the file is filled in or modified. 1. If an FSCB macro instruction has not been coded for a file (and the FSCB= operand is not coded on the FSWRITE macro instcuction), you
must specify the BUFFER= and BSIZE= options to indicate the
location of the read/write buffer and the length of the record to
be written. For the filemode, you must specify both a letter and a
number. If the file is a variable-length file, you must also
specify REC'FM=V. 2. On return from the FSWRITE macro, register 1 contains the address
of the FSCB for the file. If no FSCB exists, one is created
following the FSWRITE macro instruction.
3. If you specify both fileid and FSCB=, the fileid is used to fill in
the FSCB. 4. If the HECNO option is specified (either on the FSWRITE macro
instruction or in the FSCB), that specified record is written. Otherwise, the next sequential record is written. For new files,
writing begins with record 1 ; for existing files, writing begins
with the first record following the end of the file.
5. To write records sequentially beginning a particular record
number, use the RECNO option to specify the first record to be
written. On the next FSWRITE macro instruction, use RECNJ=O so that
writing continues sequentially, following the first record written.
6. To write blocked records (valid for fixed-length files only), use
the BSIZE and NOREC options to specify the blocksize and number of
records per block, respectively. For example r to write 80-byte records into 800-byte blocks, you should specify BSIZE=800 and NOREC=10. The buffer you use must be at least 800 bytes long.
7. When using the FSWRITE macro to update an existing file of variable
records, ensure that the replacement record length is equal to the
original record length. Any attempt to replace a record in the
file with one that is shorter or longer than the original record,
will cause the file to be truncated at the specified record number.
No error return code results.
If an error occurs, register 15 contains one of the following error
codes: Invalid buffer address
First character of filemode is invalid Second character of filemode is invalid
Item number too large (more than 65,533)
Attempt to skip over unwritten variable-length item
Section 6. CMS Macro Instructions 313
FSWRITE Macro q g 10 11
12
13 14 15 16
11 1q 1q 20 21
22
25 Buffer size not specified
File open for input Maximum number of files per minidisk reached (3400) Record format not F or V Attempt to write on read-only disk
Disk is full
Number of bytes to be written is not integrally divisible by the number of records to be written
Length of fixed-length item not the same as previous item
Record format specified not the same as file
Variable-length item greater than 65K bytes
Number of records greater than 1 for variable-length file
Maximum number of data blocks per· file (16060) Invalid character detected in filename
Invalid character detected in filetype
Virtual storage capacity exceeded
Insufficient free storage available for file directory
buffers 31U eMS Command and Macro Reference
Previous Page Next Page