Page of GC20-1819-2 As Updated April 27, 1981 by TNt SN2S-0828 For S748-XEl FSCBAB!!: This field contains the alternate number of whole records in
an extended FSCB format. See the description of the FSCBNOIT field for
the usage of this field. FSCBwglg: The FSPOINT macro instruction uses this field to contain the
alternate write pointer for an extended FSCB during a POINT operation. The FSPOINT macro instruction uses this field to contain the
alternate read pointer for an extended FSCB during a POINT operation.
The following example shows how you might code an FSCB macro instruction
to define various file and buffer characteristics, and then use the same FSCB to refer to different files: COMMON SHARE FSREAD 'INPUT FILE A1',FSCB=COMMON,FORM=E FSWRITE 'OUTPUT FILE Al',FSCB=COMMON,FORM=E FSCB BUFFER=SHARE,RECFM=V,BSIZE=200,FORM=E DS CL200 In the above example, the fileid specifications on the FSREAD and FSWRITE macro instructions modify the FSCB at the label COMMON each time
a read or write operation is performed. You can also modify an FSCB directly by referring to fields by a displacement off the beginning of
the FSCB; for example: HVC FSCB+8,=CL8'NEWNAME'
moves the name NEWNAME into the filename field of the FSCB at the label FSCBFN. As an alternative, you can use the FSCBD macro instruction to
qenerate a DSECT and refer to the labels in the DSECT to modify the FSCB; for example: INFSCB NEWNAME LA RS,INFSCB USING FSCBD,RS MVC FSCBFN,NEWNAME FSCB DC FSCBD 'INPUT TEST A1',FORM=E Ct8'OUTPUT' In the above example, the HVC instruction places the filename OUTPUT into the FSCBFN (filename) field of the FSCB. The next time this FSCB is
referenced, the file OUTPUT TEST is the file that is manipulated. CMS disk files are sequential files; when you use CMS macros to read and
write these files, you can access them sequentially with the FSREAD and FSWRITE macros. However, you may also refer to records in a CMS file by
246 IBM VM/370 eMS User's Guide
Page of GC20-1819-2 As Updated April 27, 1981 by TNL SN25-0828 For 5748-XE1 their relative record numbers, so you can, in effect, access records
using a direct access method.
If you know which record you want to read or write, you can specify
the RECNO option on the FSCB macro instruction, or on the FSOPEN, FSREAD, or FSWRITE macro instructions. When you use the RECNO option on
the FSCB macro instruction, you must specify it as a self-defining term;
for the FSOPEN, FSREAD, or FSWRITE macro instructions, you may specify
either a self-defining term, as:
WRITE FSWRITE FSCB=WFSCB,RECNO=10,FORM=E or using register notation, as follows:
WRITE FSWRITE FSCB=WFSCB,RECNO=(5) ,FORM=E where register 5 contains the record number of the record to be read. When you want to access files sequentially, the FSCBITNO field of the FSCB must be 0 for an FSCB without the FORM=E option; for an extended FSCB, the FSCBAITN field must be Oe This is the default value. When you
are reading files with the FSREAD macro instruction, reading begins with
record number 1. When you are writinq records to an existing file with
To begin reading or writing files sequentially beginning at a
specific record number, you must specify the RECNO option twice: once to
specify the relative record number at which you want to begin reading,
and a second time to specify RECNO=O so that reading or writing will
continue sequentially beginning after the record just read or written.
the FSWRITE macro, writing begins following the last record in the file.
section 13. Programming for the CMS Environment 246.1
Previous Page Next Page