Previous Topic: Effects of Parameters

Next Topic: EDTRCD2 Device Function

EDTRCD Device Function

The Edit Record (EDTRCD) function defines a program that maintains records in a specified file, one record at a time.

The EDTRCD function executes in either *ADD or *CHANGE mode. There are two display panels for this function type: a key panel that prompts for the key values and a detail panel that displays all the fields from the based-on access path.

The EDTRCD function has the following default logic:

If no key value, or a partial key value, is supplied as a restrictor parameter, the key panel prompts for the remainder of the key. By specifying the elements of a composite key as restrictor (RST) parameters, the key panel is bypassed and the function exits when the record is changed and Enter is pressed.

The EDTCD function is in *CHANGE mode when first called unless there are no records existing in the file. If you set the function option Dynamic program mode to Y, the function automatically chooses the correct mode. You can toggle between *ADD and *CHANGE modes by pressing F9 on the key panel.

An EDTRCD function can be attached to a Retrieval (RTV) or a Resequence (RSQ) access path.

By default, an EDTRCD function contains calls to the CRTOBJ, DLTOBJ, and CHGOBJ functions based on the function options.

You can disable these calls by changing the function options.

The following is an example of a Key panel.

EDTRCD Device Function

The following is an example of a Detail panel.

EDTRCD Device Function (2)

The following table shows the parameters available.

Parameters

Usage

Role

Default

Option

Return code

B

-

Y

R

Part/fully restricted key

I

RST

-

O

Other fields

Any

-/MAP

-

O

The following table shows the function options available.

Options

Default Value

Other Values

Create record

Y

N

Bypass key screen

N

Y

Exit after add

N

Y

Change record

Y

N

Delete record

Y

N

Dynamic program mode

N

Y

Send all error messages

M(YSNDMSG)

Y, N

Confirm prompt

Y

N

Confirm initial value

M(YCNFVAL)

Y, N

If action bar, what type?

M(YABRNPT)

A, D

Commit control

N(*NONE)

M(*MASTER), S(*SLAVE)

Generate error routine

M(YERRRTN)

Y, N

Reclaim resources

N

Y

Closedown program

Y

N

Copy back messages

M(YCPYMSG)

Y, N

Generation mode

A

D, S, M

Screen text constants

M(YPMTGEN)

L, I

Generate help

M(YGENHLP)

Y, N, O

Help type for NPT

M(YNPTHLP)

T, U

Workstation implementation

M(YWSNGEN)

N(NPT), G(GUI), J(JAVA), V(VB)

Distributed file I/O Control

M(YDSTFIO)

S, U, N

For more information about: