Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

IEDTDEL - Delete a record range or the copy buffer

&pagelevel(4)&pagelevel

This access function deletes either the specified record range of an existing work file or the copy buffer.

Deleting a record range has the same effect as the @DELETE statement (format 1)

Deleting the copy buffer has the same effect as the statement code * in F mode.

Deleting a record range

The record range is specified by two line numbers:

EDTKEY1:        Line number of the first record in the range

EDTKEY2:       Line number of the last record in the range

If the value X'0000000000000000' is specified in EDTKEY1 and the value
X'FFFFFFFFFFFFFFFF' is specified in EDTKEY2 then all the records in the work file are deleted.
This corresponds to the statement @DELETE % - . $ (not to the statement @DEL without operands which resets all the values in the work file).

Deleting the copy buffer

The value C must be entered in the EAMFILE field of control block EDTAMCB.

The value must be left-aligned and padded with blanks.

The buffers EDTKEY1 and EDTKEY2 do not have to be specified when the copy buffer is deleted.

Call

The following specifications are required (see overview):

  • Entry of values in the required fields in the EDTGLCB and EDTAMCB control blocks.

  • Entry of values in the EDTKEY1 buffer

  • Entry of values in the EDTKEY2 buffer

  • Call of the entry point address IEDTDEL with the parameter list

Overview

(For the control blocks, see section “Generation and structure of the control blocks”).

Entry point address     :     IEDTDEL

Parameter list         :     A (EDTGLCB, EDTAMCB, EDTKEY1, EDTKEY2)

Call parameter

Return parameter

EDTAMCB:EAMFILE
EAMLKEY1
EAMLKEY2
EDTGLCB:EGLRETC
EGLRMSG

EDTKEY1
EDTKEY2


 


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[] = "08000001";
char key2[] = "99999999";
amcb.length_key1 = amcb.length_key2 = 8;

If, for example, the records from line number 800.0001 through to the end of work file 1 are to be deleted:

strncpy(amcb.filename,"$1 ",8);

In the C program, the IEDTDEL function is called as follows:

IEDTDEL(&glcb,&tamcb,key1,key2);