If the CRT STATUS clause is specified in the SPECIAL-NAMES paragraph, every extended ACCEPT statement places a value into data-name-2 to indicate the outcome of the ACCEPT operation. Data-name-2 consists of status keys which are set to indicate possible conditions resulting from the completion of the operation.
There are three CRT status keys:
The first two bytes of data-name-2 form CRT Status Key 1 and should be described as PIC 99. It indicates the condition that caused the termination of the ACCEPT operation. The possible values are:
If the ACCEPT statement contains an ON EXCEPTION phrase, any value in CRT Status Key 1, except 0, will cause the execution of the imperative statement in the ON EXCEPTION phrase.
The next two bytes of data-name-2 form CRT Status Key 2, and contain a code
giving further details of the condition that terminated the ACCEPT
operation. Its format and possible values depend on the value in CRT
Status Key 1, as shown in the following table.
Table 3. Valid Combinations of CRT STATUS Keys 1 and 2
| KEY 1 | KEY 2 | Meaning | |
|---|---|---|---|
| Format | Value | ||
| 0 | PIC 99 | 0 | The operator pressed a terminating key |
| 0 | PIC 99 | 1 | Auto skip from the last field1 |
| 1 | PIC 99 | 1-24 | The function key number |
| 9 | PIC 99 | 0 | Error condition (no items fall within the screen) |
| |||
Table 4. Auto Skip Value Returned by Controller Type
| Type of Controller | Auto Skip Value of 1 Returned |
|---|---|
|
controllers: Local workstation controllers Remote 5251 model 12 Remote 5294 Remote 5394 Remote 3174 Remote 3274 |
Yes Not applicable No Yes, if installed with new workstation controller code No, with *NOUNDSPCHR option No, with *NOUNDSPCHR option |
|
PC attachments: DOS and Operating System/2(R) (OS/2) operating environments |
No |
|
System to system passthru: iSeries server to iSeries server System/36(TM) to iSeries server System/38(TM) to iSeries server |
Yes No No |
The last two bytes of data-name-2 form CRT Status Key 3. If CRT Status Key 1 is 0, CRT Status Key 3 contains the code for the keyboard key that terminated the ACCEPT operation. Otherwise, if CRT Status Key 1 is 9, an error is signaled by the operating system, and CRT Status Key 3 will be set to 99.
The codes for the keys are:
Help and Clear keys accept data only on local workstations.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.