Using KSAM/XL and KSAM 64 (32650-90886)

142 Chapter9
KSAM Intrinsics
FREADLABEL
FREADLABEL
Reads a user-defined file label.
Syntax
I16V UDS I16V I16V
FREADLABEL(
filenum,buffer,length,labelid
);
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file whose label is to be read.
buffer
user-defined structure (required)
Returns the label that was read. This structure must be large enough to
hold the number of halfwords specified by
length
.
length
16-bit signed integer by value (optional)
Passes the number of halfwords to be transferred from the label. This field
must not be greater than 128 halfwords.
Default: 128 halfwords
labelid
16-bit signed integer by value (optional)
Passes the label number. (The first label is numbered zero.)
Default: Zero
Operation Notes
When a disk file is opened, user labels can be read from it, or written to it, in any order, at
any time, regardless of access capabilities to the rest of the file. A disk file can have as
many as 254 128-halfword user-defined labels.
MPE/iX automatically skips over any unread user-defined labels when the first
FREAD
intrinsic call for files
is issued. To read a user-defined label, you should call the
FREADLABEL
intrinsic immediately after an
FOPEN/HPFOPEN
intrinsic has opened the file. The user-defined label must be 40 halfwords in length to
conform to the length of the ANSI-standard or IBM-standard label.
Condition Codes
CCE Request granted. The label was read.
CCG Request denied. A label was referenced beyond the last label written on
the file.
CCL Request denied. The label was not read; an error occurred.
Refer to this intrinsic in the MPE/iX Intrinsics Reference Manual for other codes
pertaining to KSAM files.