FS READ Macro 1 YJU can soecify any of the following FSCB macro options on the FSREAD macro instruction: BUFFER=buffer NOREC=numrec
BSIZE=size
RECNO=number These options may be specified either as the actual value (for eKample, NOREC=1) or as a register that contains the value (for eKample, NOREC=(3) where register 3 contains the value 1). When you use any of these options, the associated field in the F3CB is modified.
If an FSCB macro instruction has not been coded for a file (and FSCB= operand is not coded), you must specify the BUFFER= BSIZE= options to indicate the address of the buffer and
length. When reading variable-length records, a record that
longer than the buffer length is truncated.
the
and
its
is
2. In from the FSREAD macro, register 1 points to the FSCB for the file. If no FSCB exists, one is created following the FSREAD ma=ro instruction.
3. If yon specify both fileid and FSCB=, the fileid is used to fill in
the FSCB. 4. Fegister 0 contains, after the read operation
number of bytes actually read. This information
in the FSCBNORD field of the FSCB. is complete, the
is also contained s. To read records sequentially beginning with a particular record ncrmber, use the RECNO option to specify the first record to be
read. On the next FSREAD macro instruction, use RE:NO=O so that reaaing continues sequentially following the first record read.
If an error occurs, register 15 contains one of the following error
codes: 1
2
3
5
7
B q 11
12
13 15 File not found
Invalid buffer address ?ermanent IIO error
Number of records to be read is less than or equal to zero,
or greater than 32,768
Invalid record format (only checked when the file is first
opened for reading)
Incorrect length
File open for output
Nllmber of records greater than 1 for variable-length file
End of file, or record number greater than number of in data set (maximum number of records is 65,533)
Variable-length file has invalid displacement in active file
table
Invalid character in filename
Invalid character in filetype 310 IBM VM/370 CMS Command and Macro Reference
FSSTATE Macro FSSTATE Use the FSSTATE macro instruction to determine whether a particular file
exists. The format of the FSSTATE macro instruction is: r , [label] , L- label
fileid FSSTATE {
fileid [,FSCB=fscb] } [,ERROR=erraddr] FSCB=fscb 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 a 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. Shorter names must be filled 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.
1. If the specified file exists, register 15 contains a a return code.
2. When the FSSTATE macro completes execution, register 1 contains the
address of the file status table (FST) for the specified file.
The file status table contains the following information:
Decimal
Displacement a 3 16
18 20 22
24
26 2g 30 32
36
38
Field Description
Filename -EBCDIC
Filetype -EBCDIC
Date (mmdd) last written
Time (hhmm) last written
Write pointer (number of item)
Read pointer (number of item)
Filemode
Number of records in file
Disk address of first chain link
Record format (F IV) Logical record length
Number of 800-byte data blocks -binary Year (yy) last written -EBCDIC Section 6. CMS Macro Instructions 31'
Previous Page Next Page