Contents Of Relative Key; Example - Creating A Relative File - IBM 5280 Programmer's Manual

Distributed data system, cobol
Hide thumbs Also See for 5280:
Table of Contents

Advertisement

Contents of Relative Key
use the random access mode, the Status Key is set to 23, indicating the
record cannot be found.
6. Relative files must be on single volumes.
See "Allocating Data Sets for Program Files" in Chapter 8 for the rules that
apply when allocating data sets for your program using IBM 5280 facilities.
When issuing a WRITE with the sequential access mode, the first record
written will have relative record number one, the second two, the third three,
and so on. If a relative record key was specified, it will be updated to contain
the number of the record just written. If the end of extent is reached when a
WRITE request is executed, an invalid key condition will occur, setting the
Status Key to 24 (boundary error).
When issuing a WRITE with the random access mode, place the desired
record number in the relative key data-item before issuing the WRITE.
Invalid Key conditions after a WRITE occur when:
A non-null record already exists. The Status Key is set to 22 (for
duplicate record).
The record number is outside the extent of the file. The Status Key is
set to 24 (for boundary condition).
Example - Creating a Relative File
The program example in figure 5.7 creates a master file of employee records.
Employee numbers from 1001 through 2001 are entered in the employee
number field (EMPNO).
5- 16
IBM 5280 COBOL Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents