This access function is used to modify the line number of a record in a work file.
EDTKEY1
:
Line number that is to be modified
EDTKEY2
:
New line number
If a record with the new line number already exists or if the work file contains further records between the old and new line numbers then the function is not executed.
Call
The following specifications are required (see overview):
Entry of values in the required fields in the
EDTGLCB
andEDTAMCB
control blocks.Entry of values in the
EDTKEY1
bufferEntry of values in the
EDTKEY2
bufferCall of the entry point address
IEDTREN
with the parameter list
Overview
(For the control blocks, see section “Generation and structure of the control blocks”).
Entry point address |
Parameter list |
Call parameter | Return parameter | ||
EDTGLCB: | EGLUNIT EGLVERS | EDTGLCB: | EGLRETC EGLRMSG |
EDTAMCB: | EAMUNIT EAMVERS EAMFILE EAMLKEY1 EAMLKEY2 | ||
|
|
For the possible return codes, see section “Logical record access functions”.
Call in the C program
Required include files:
#include <stdio.h>
#include <iedtgle.h>
The EDTAMCB
control block is declared and initialized as follows:
iedamcb amcb = IEDAMCB_INIT; char key1[] = "01234000"; char key2[] = "00000100"; amcb.length_key1 = amcb.length_key2 = 8;
If, for example, the record with line number 123.4
is the 1st record in work file 1
and is to
receive line number 0.01
:
strncpy(amcb.filename,"$1 ",8);
In the C program, the IEDTREN
function is called as follows:
IEDTREN(&glcb,&amcb,key1,key2);