The text of a message or a code associated with a message that has already been defined in the message dictionary can be specified in a PUT DETAIL command. When the dialog is executed, the runtime system moves the appropriate message to the message field in the dialog's map.
A message field is defined by the $MESSAGE map field.
Note: For more information, see the CA IDMS Mapping Facility Guide.
If no message field is defined for the detail area of the pageable map, the runtime system places the message in the header or footer message field or, if neither the header nor the footer has a message field, the runtime system ignores the message. If more than one message is placed in the header or footer message field, the messages are concatenated up to the length of the message field.
Considerations
The following considerations apply to specifying a message code in a PUT DETAIL command:
User-defined messages added to the message dictionary can have a prefix other than DC and digits in the range 900001 through 999999.
|
Severity code |
Action |
|---|---|
|
0 |
Processes the PUT DETAIL command |
|
1 |
Snaps all CA ADS resources and processes the PUT DETAIL command |
|
2 |
Snaps all system areas and processes the PUT DETAIL command |
|
3 |
Snaps all CA ADS resources and terminates CA ADS with a task abend code of D002 |
|
4 |
Snaps all system areas and terminates CA ADS with a task abend code of D002 |
|
5 |
Terminates CA ADS with a task abend code of D002 |
|
8 |
Snaps all system areas and terminates the DC system with an operating system abend code of 3996 |
|
9 |
Terminates the DC/UCF system with an operating system abend code of 3996 |
Within the message definition in the dictionary, symbolic parameters are identified by an ampersand (&) followed by a two-digit numeric identifier. These identifiers can appear in any order. The position of the replacement values in the PARMS parameter must correspond directly to the two-digit numeric identifiers in the message; the first value corresponds to &01, the second to &02, and so forth. For example, assume that the stored message text is as follows:
THIS IS TEXT &01 AND &03 OR &02
The PARMS parameter reads PARMS=('A','B','C'). The resulting text would read as follows:
THIS IS TEXT A AND C OR B
Example
The following example illustrates the map and the premap and response processes of a dialog that:
The paging type in this example is WAIT. If the user makes a paging request and no MDTs are set, the runtime system displays the requested page. If the user makes a nonpaging request or if any MDTs are set, the runtime system initiates the response process. The response process is associated with the control keys ENTER, FWD (paging forward), and BWD (paging backward).
The pageable map associated with the dialog is shown in the screen that follows. The following considerations apply to the detail area map fields:
┌─ │ 1 │ DEPT. ID: _____ │ └─ ┌─ 2 3 4 │ EMP. ID: _____ LAST NAME: _______________ ACTION CODE: ___ │ 5 6 │ START DATE: ________ MESSAGE: ________ │ │ │ │ │ │ │ │ └─ ┌─ 7 │ PAGE: _____ │ │ │ 8 │ ____________________________________________________________________________ └─
Note:
Sample Premap Process
The premap process shown below performs the following:
OBTAIN CALC DEPARTMENT.
IF DB-REC-NOT-FOUND
THEN
DO.
MOVE 'DEPARTMENT NOT FOUND' TO WK-MESSAGE.
DISPLAY.
END.
MOVE SPACES TO WK-ACTION.
OBTAIN FIRST EMPLOYEE WITHIN DEPT-EMPLOYEE.
WHILE NOT DB-END-OF-SET
REPEAT.
MOVE EMP-ID TO WK-EMP-ID.
MOVE EMP-LNAME TO WK-EMP-LNAME.
MOVE EMP-START-DATE TO WK-EMP-START-DATE.
ACCEPT DB-KEY INTO WK-KEY FROM CURRENCY.
PUT NEW DETAIL KEY WK-KEY.
IF $PAGE-READY
THEN
DO.
MOVE 'MORE EMPLOYEES EXIST FOR THIS DEPT' TO WK-MESSAGE.
DISPLAY.
END.
OBTAIN NEXT EMPLOYEE WITHIN DEPT-EMPLOYEE.
END.
MOVE 'ALL EMPLOYEES DISPLAYED FOR THIS DEPT' TO WK-MESSAGE.
DISPLAY.
Sample Response Process
The response process shown below performs the following:
READY USAGE-MODE UPDATE.
MOVE $PAGE TO WK-PAGE.
GET DETAIL FIRST RETURN KEY WK-KEY.
WHILE NOT $END-OF-DATA
REPEAT.
OBTAIN EMPLOYEE DB-KEY IS WK-KEY.
IF WK-ACTION EQ 'DEL'
THEN
DO.
ERASE EMPLOYEE.
PROTECT (WK-EMP-ID WK-EMP-LNAME
WK-EMP-START-DATE WK-ACTION) PERMANENT.
MOVE SPACES TO WK-ACTION.
PUT CURRENT DETAIL TEXT 'DELETED'.
END.
ELSE
DO.
MOVE WK-EMP-LNAME TO EMP-LNAME.
MOVE WK-EMP-START-DATE TO EMP-START-DATE.
MODIFY EMPLOYEE.
MOVE SPACES TO WK-ACTION.
PUT CURRENT DETAIL TEXT 'MODIFIED'.
END.
GET DETAIL NEXT RETURN KEY WK-KEY.
END.
MOVE WK-PAGE TO $PAGE.
DISPLAY.
|
Copyright © 2014 CA.
All rights reserved.
|
|