The working and limitations of EDTRCD2/EDTRCD3/DSPRCD2/DSPRCD3 function types.

Document ID : KB000049760
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document deals in detail with the workings and limitations of EDTRCD2, EDTRCD3, DSPRCD2 and DSPRCD3 function types with regards to initialization of fields in the DTL, 2ND and 3RD contexts. It also notes differences between the COBOL and RPG implementations.

Solution:

The Working and Limitations of EDTRCD2, EDTRCD3, DSPRCD2 and DSPRCD3 device functions

The EDTRCD2/EDTRCD3/DSPRCD2/DSPRCD3 device functions behave, as one might expect, when there is no involvement of access path field(s) initialization, under either the *CHANGE or *ADD modes. The description of the functions within the manual holds good in this scenario. In the *CHANGE mode, the record details are retrieved and displayed correctly in separate panels, as per the device design. In the *ADD mode, the record details entered are obtained correctly from the separate panels and the record is created.

A summary of the EDTRCD2/DSPRCD2 device function behavior, when no initializations are involved, is given below.

Function Name Generation Language Mode of field(s)
in DTL screen
Mode of field(s)
in 2ND screen
Mode of Program Limitation Exists (Y/N) Remarks on Limitations
EDTRCD2 COBOL/ILE COBOL I/H/O I/H/O *ADD/*CHANGE N The Function behaves as desired.
RPG/ILE RPG I/H/O I/H/O *ADD/*CHANGE N The Function behaves as desired.
 
DSPRCD2 COBOL/ILE COBOL I/H/O I/H/O *DISPLAY N The Function behaves as desired.
RPG/ILE RPG I/H/O I/H/O *DISPLAY N The Function behaves as desired.

A summary of the EDTRCD3/DSPRCD3 device function behavior, when no initializations are involved, is given below.

Function Name Generation Language Mode of field(s)
in DTL screen
Mode of field(s)
in 2ND screen
Mode of field(s)
in 3RD screen
Mode of Program Limitation Exists (Y/N) Remarks on Limitations
EDTRCD3 COBOL/ILE COBOL I/H/O I/H/O I/H/O *ADD/*CHANGE N The Function behaves as desired.
RPG/ILE RPG I/H/O I/H/O I/H/O *ADD/*CHANGE N The Function behaves as desired.

DSPRCD3 COBOL/ILE COBOL I/H/O I/H/O I/H/O *DISPLAY N The Function behaves as desired.
RPG/ILE RPG I/H/O I/H/O I/H/O *DISPLAY N The Function behaves as desired.

However, limitations exist when context based initialization of access path field(s) in Detail Panel 1 (DTL)/Detail Panel 2 (2ND)/Detail Panel 3 (3RD) contexts, is carried out, irrespective of the *CHANGE or *ADD modes. The limitations that come up are dependent on both the function and the language that is used for generating the function. The function behavior, based on the function and the generation language being used, is given below.

EDTRCD2 Device Function

  1. Generation language CBL/CBI

    A limitation exists when initialization is carried out for a field(s) in the 2ND context. When this field(s) is present in Input/Hidden mode on Detail Panel 1 and is also present on Detail Panel 2 in any mode (Input/Hidden/Output), the initialization in 2ND context is not reflected at runtime. This is because the 2ND context initialization on Detail Panel 2 is overwritten with value(s) from Detail Pane 1 if modified/DTL context initialization.

    A limitation exists when initialization is carried out for a field(s) in the DTL context. When this field(s) is present in Output mode on Detail Panel 1 and Input/Hidden mode on Detail Panel 2, the field(s) is populated correctly on both panels on first time display, based on the relevant initializations. However, on a subsequent page up, the DTL initialization on Detail Panel 1 is overwritten with value(s) from Detail Panel 2 if modified/2ND context initialization.

    When the field(s) is present in Output mode on both Detail Panel 1 and Detail Panel 2, all the initializations are carried out correctly.

  2. Generation language RPG/RP4

    A limitation exists when initialization is carried out for a field(s) in DTL context. When this field(s) is present on both Detail Panel 1 and Detail Panel 2, in any mode on either panel, the initialization in DTL context is not reflected at runtime, when there is 2ND context initialization. The 2ND context initialization overwrites the DTL context initialization in this case. Where there is no 2ND context initialization, the DTL context initialization is retained.


DSPRCD2 Device Function

  1. Generation language CBL/CBI

    The initializations are retained correctly on all screens.

  2. Generation language RPG/RP4

    A limitation exists when initialization is carried out for a field(s) in DTL context. When this field(s) is present on both Detail Panel 1 and Detail Panel 2, in any mode on either panel, the initialization in DTL context is not reflected at runtime, when there is 2ND context initialization. The 2ND context initialization overwrites the DTL context initialization in this case. Where there is no 2ND context initialization, the DTL context initialization is retained.

A summary of the EDTRCD2/DSPRCD2 device function behavior, when context initializations are involved, is given below.

Function Name Generation Language Mode of field(s)
in DTL screen
Mode of field(s)
in 2ND screen
Mode of Program DTL Initialization done correctly? (Y/N) 2ND Initialization done correctly? (Y/N) Limitation Exists (Y/N) Remarks on Limitations
EDTRCD2 COBOL/ILE COBOL I/H I/H/O *ADD/*CHANGE Y N Y

The limitation is with 2ND ctx initialization. DTL ctx initialization/Detail Panel 1 value if modified, is carried forward to Detail Panel 2, overwriting any 2ND ctx initialization, for related field(s).

COBOL/ILE COBOL O I/H *ADD/*CHANGE N Y Y

The limitation is with DTL ctx initialization. DTL and 2ND ctx initializations are retained correctly on both panels on first time display. However, on a subsequent page up, the DTL ctx initialization on Detail Panel 1 is overwritten with 2ND ctx initialization/Detail Panel 2 value(s) if modified, for related field(s).

COBOL/ILE COBOL O O *ADD/*CHANGE Y Y N

The Function behaves as desired.

RPG/ILE RPG I/H/O I/H/O *ADD/*CHANGE N Y Y

The limitation is with DTL ctx initialization. 2ND ctx initialization is retained on Detail Panel 1, overwriting any DTL ctx initialization, for related field(s).

 
DSPRCD2 COBOL/ILE COBOL O O *DISPLAY Y Y N

The Function behaves as desired.

RPG/ILE RPG O O *DISPLAY N Y Y

The limitation is with DTL ctx initialization. 2ND ctx initialization is retained on Detail Panel 1, overwriting any DTL ctx initialization, for related field(s).

EDTRCD3 Device Function

  1. Generation language CBL/CBI

    A limitation exists when initialization is carried out for a field(s) in the 2ND and/or 3RD contexts. When this field(s) is present in Input/Hidden mode on Detail Panel 1 and is also present on Detail Panel 2 and Detail Panel 3, in any mode on either panel, the initializations in 2ND/3RD contexts are not reflected at runtime. This is because the 2ND/3RD context initialization on Detail Panel 2/Detail Panel 3 is overwritten with value(s) from Detail Panel 1 if modified/DTL context initialization.

    A limitation exists when initialization is carried out for a field(s) in the 3RD contexts. When this field(s) is present in Output mode on Detail Panel 1, Input/Hidden mode on Detail Panel 2, any mode on Detail Panel 3, the initialization comes up correctly until the Detail Panel 2. However, the initialization in 3RD context on Detail Panel 3 is not reflected at runtime as the value(s) on Detail Panel 3 is overwritten with value(s) from Detail Panel 2 if modified/2ND context initialization.

    A limitation exists when initialization is carried out for a field(s) in the DTL and 2ND contexts. When this field(s) is present in Output mode on Detail Panel 1 and Detail Panel 2 and Input/Hidden mode on Detail Panel 3, the field(s) is populated correctly on all three panels on first time display, based on the relevant initializations. However, on a subsequent page up, the DTL and 2ND initialization on Detail Panel 1 and Detail Panel 2 is overwritten with value(s) from Detail Panel 3 if modified/3RD context initialization.

    When the field(s) is present in Output mode on Detail Panel 1, Detail Panel 2 and Detail Panel 3, all the initializations are carried out correctly.

  2. Generation language RPG/RP4

    A limitation exists when initialization is carried out for a field(s) in the DTL and/or 2ND contexts. When this field(s) is present on all three Detail Panel screens in any mode, the initialization in DTL and 2ND contexts is not reflected at runtime, when there is 3RD context initialization. The 3RD context initialization overwrites the DTL/2ND context initialization in this case. Where there is no 3RD initialization, the DTL and 2ND initialization is retained.


DSPRCD3 Device Function

  1. Generation language CBL/CBI

    The initializations are retained correctly on all screens.

  2. Generation language RPG/RP4

    A limitation exists when initialization is carried out for a field(s) in DTL and/or 2ND context. When this field(s) is present on all three Detail Panel screens in any mode, the initialization in DTL and 2ND contexts is not reflected at runtime, when there is 3RD context initialization. The 3RD context initialization overwrites the DTL/2ND context initialization in this case. Where there is no 3RD initialization, the DTL and 2ND initialization is retained.

A summary of the EDTRCD3/DSPRCD3 device function behavior, when context initializations are involved, is given below.

Function Name

Generation Language

Mode of field(s)
in DTL screen

Mode of field(s)
in 2ND screen

Mode of field(s)
in 3RD screen

Mode of Program

DTL Initialization done
correctly?(Y/N)

2ND Initialization done
correctly? (Y/N)

3RD Initialization done
correctly? (Y/N)

Limitation Exists (Y/N)

Remarks on Limitations

EDTRCD3

COBOL/ILE COBOL I/H I/H/O I/H/O *ADD/*CHANGE Y N N Y

The limitation is with 2ND/3RD ctx initializations. DTL ctx initialization/Detail Panel 1 value(s) if modified, is carried forward to Detail Panel 2 and Detail Panel 3, overwriting any 2ND/3RD ctx related initialization, for related field(s).

COBOL/ILE COBOL O I/H I/H/O *ADD/*CHANGE Y Y N Y

The limitation is with 3RD ctx initialization. DTL and 2ND ctx initializations are retained correctly on Detail Panel 1 and Detail Panel 2 on first time display. However, 2ND ctx initialization/Detail Panel 2 value(s) if modified, is carried forward to Detail Panel 3, overwriting any 3RD ctx initialization, for related field(s).

COBOL/ILE COBOL O O I/H/O *ADD/*CHANGE N N Y Y

The limitation is with DTL/2ND ctx initialization. DTL, 2ND and 3RD ctx initializations are retained correctly on all three panels on first time display. However, on a subsequent page up, the DTL and 2ND ctx initializations on Detail Panel 1 and Detail Panel 2 are overwritten with value(s) from 3RD ctx initialization/Detail Panel 3 value(s) if modified, for related field(s).

COBOL/ILE COBOL O O O *ADD/*CHANGE Y Y Y N

The Function behaves as desired.

RPG/ILE RPG I/H/O I/H/O I/H/O *ADD/*CHANGE N N Y Y

A limitation is with DTL/2ND ctx initializations. 3RD ctx initialization is retained on Detail Panel 1 and Detail Panel 2, overwriting any DTL/2ND ctx initializations, for related fields.

 

DSPRCD3

COBOL/ILE COBOL O O O *DISPLAY Y Y Y N

The Function behaves as desired.

RPG/ILE RPG O O O *DISPLAY N N Y Y A limitation is with DTL/2ND ctx initializations. 3RD ctx initialization is retained on Detail Panel 1 and Detail Panel 2, overwriting any DTL/2ND ctx initializations, for related fields.

Workarounds for overcoming the limitations mentioned above

As mentioned earlier, the limitations in the EDTRCD2/EDTRCD3/DSPRCD2/DSPRCD3 functions occur when context based initialization of access path field(s) is carried out. When there is no context based initialization, the device functions work correctly.

To overcome the said limitations, the following workarounds can be used, irrespective of the language being used for function generation

  1. EDTRCD2/DSPRCD2 Device Functions

    Initialize the required field(s) on all screens, by using the DTL context. Then execute *MOVE ALL to move all field(s) from DTL to 2ND context.

  2. EDTRCD3/DSPRCD3 Device Functions

    Initialize the required field(s) on all screens, by using the DTL context. Then execute *MOVE ALL to move all field(s) from DTL to 2ND context and subsequently from DTL to 3RD context.