ILE COBOL Language Reference

CRT STATUS Clause Considerations

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:

CRT Status Key 1
The first two bytes of data-name-2. It indicates the condition that caused the termination of the ACCEPT operation.

CRT Status Key 2
The next two bytes of data-name-2. It gives further details of the condition that caused the termination of the ACCEPT operation.

CRT Status Key 3
The last two bytes of data-name-2. It contains the code for the keyboard key that terminated the ACCEPT operation.

CRT Status Key 1

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:

0
Indicates a terminating key such as an enter key, or an auto skip from the final field

1
Indicates a function key

9
Indicates an error

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.

CRT Status Key 2

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)
Note:
1 When auto skip from the last field takes place, the value of 1 for CRT STATUS KEY 2 is returned to supported controllers, and the value of 0 is returned to those controllers not supported. This relationship is shown in Table 4.

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

CRT Status Key 3

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----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]