The logical record access functions allow users to access records in the work files from within a user program.
The following access functions are available:
Access functions | Entry point address |
Read a record |
|
Read a marked record |
|
Write a record |
|
Mark a record |
|
Delete the copy buffer or a record range |
|
Modify a line number |
|
Read the global EDT parameter settings |
|
Read the work file-specific EDT parameter settings |
|
The individual access functions are described in the sections below.
Access functions can only be executed if EDT is initialized. Initialization is performed by calling the function IEDTCMD
(see section “IEDTCMD - Execute EDT statements”).
If the call is issued in a statement or user routine with the supplied EDTGLCB
, then EDT is already initialized.
If access functions are used with a work file which is already active and is being processed as a procedure with @DO then they are rejected with the return code EAMACERR
/EAMAC48
(work file is active).
Processing files and library elements
The logical record access functions always apply to the records in a work file. If it is necessary to process files or library elements then these must first be read into a work file (e.g. with the function IEDTCMD
). A file can also be opened for real processing. These files or elements are then written back using EDT statements (e.g. with the function IEDTCMD
).
Each record has a line number via which it can be accessed.
Each record may also have various marks (see [1], section on record marks).
Control structures
Before a record access function is called, the required control blocks must have been declared in the calling program and, if necessary, defined and filled with the required values.
Return codes of the record access functions
The table indicates the return codes which EDT can set for the individual access functions. In this table, GET
stands for IEDTGET
etc.
Return code | Function | ||||||
|
|
|
|
|
|
|
|
EAMRETOK | EAMOK00 EAMOK04 EAMOK08 EAMOK12 | x x x x | x x x x | x | x | x | x |
EAMOK16 EAMOK20 | x x | ||||||
EAMACERR | EAMAC04 | x | |||||
EAMAC08 EAMAC12 | x x | x x | |||||
EAMAC16 EAMAC20 | x | x x | x | x x | x | ||
EAMAC28 EAMAC32 | x | x | x x | ||||
EAMAC36 EAMAC40 EAMAC44 | x x x | ||||||
EAMAC48 | x | x | x | x | x | x | |
EAMEDERR EAMOSERR EAMUSERR | x x x | x x x | x x x | x x x | x x x | x x x | |
EAMPAERR |
|
|
|
|
|
|
|
EAMPA28 | x | ||||||
EAMPA32 EAMPA36 EAMPA40 EAMPA44 | x x x x | x x x x | x x x x | x x | x x | x x |
The fields EGLMRET
and EGLRS1
belong to the control block EDTGLCB
. For the meaning of the return codes, see section “EDTGLCB - Global EDT control block”.