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'
FSWRITE Macros
3. fields in the file status table are in packed decimal format with the exceptions noted above.
If an error occurs, register 15 contains one of the error
codes: 2Q 23
36 !1ggni!!g Invalid character in fileid Invalid filemode
Fi Ie not found
Disk not accessed FSWRITE Use the FSWRITE macro instruction to write a record from an IIO buffer
to a CMS lisk file. The format of the FSWRITE macro instruction is:
r i , rlabell , FSWRITE {
fileid(,FSCB=fscb] } [,ERROR=erraddr](,optionS],'
FSCB=fscb
L : label filei:l 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 fileid must be
exactly 18 characters in length; 8 for the
filename, 8 for the filetype, and 2 for the
filemode. Shorter name must be filled with
blanks. FSCB=fs=b specifies the address of an FSCB. It may be: llbel (req) 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 coled and an error occars, control returns to the next sequential instruction in
the calling proqram, as it does if no error occurs. Yoa can specifv any of the followinq FSCB macro options on the FSWRITE macro instruction: BUFFER=buffer REC"lO=number BSIZE=size NOREC=numrec
RECFM=format
312 CMS Command and Macro Reference
Previous Page Next Page