Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

IEDTPUT - Write a record

&pagelevel(4)&pagelevel

This access function saves a record (EDTREC) with a mark (EAMMARK in EDTAMCB) in a work file under the specified line number (EDTKEY).

If a record with this line number already exists then it is replaced together with its mark (see section “IEDTPTM - Mark a record”).

The character set in which the record is made available must be specified in the field EGLCCSN (EDTGLCB).

If the flag EAMNOMOD is set in the EAMFLAG field of control block EDTAMCB when a record is written with IEDTPUT, then the work file is not identified as modified even though a record has been added. This makes it easier for the calling program to recognize whether a user has modified the work file in the dialog (by querying the field EPLMODIF in the control block EDTPARL). This also eliminates an unnecessary EDT save query in the @HALT statement if nothing has been changed in the dialog.

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 EDTKEY buffer

  • Entry of values in the EDTREC buffer

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

Overview

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

Entry point address     :     IEDTPUT

Parameter list         :     A (EDTGLCB, EDTAMCB, EDTKEY, EDTREC)

Call parameter

Return parameter

EDTGLCB:EGLUNIT
EGLVERS
EGLCCSN
EDTGLCB:EGLRETC
EGLRMSG

EDTAMCB: 

EAMUNIT
EAMVERS
EAMFLAG
EAMFILE
EAMMARK
EAMLKEY
EAMLREC

 


EDTKEY
EDTREC



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 control block EDTAMCB is declared and initialized as follows (the value 4096 here was selected as an example of the maximum expected record length):

iedamcb amcb = IEDAMCB_INIT;
char key[8];
char rec[4096];
IEDAMCB_SET_NO_MARKS(amcb);
amcb.length_key = 8;

If, for example, a record with line number 75 is to be written to work file 0:

strncpy(rec,"This is the content of the record",29); 
strncpy(key,"00750000",8);
strncpy(amcb.filename,"$0     ",8);
amcb.length_rec = 29;

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

IEDTPUT(&glcb,&amcb,key,rec);