CAnn (Command Attention) keyword for display files

Use this file- or record-level keyword to specify that the function key specified in the keyword (CA01 through CA24) is available for use.

It is to be used as a command attention (CA) key. No input data is transmitted from the device. Response indicators 01 through 99 are valid.

See the System/36 environment considerations for display files topic for special considerations when you specify the CAnn keyword in files that are used in the System/36™ environment.

The format of the keyword is:
CAnn[(response-indicator ['text'])]
If you specify this keyword and the display station user presses the specified function key, the following situation happens:
  • All other function key response indicators in the input buffer are set off (hex F0).
  • The response indicator, if specified with the CAnn keyword, is set on (hex F1).
  • The i5/OS™ data management feedback area is updated.
  • Data already in the input buffer remains unchanged except that the response indicator (if specified) is set on.
  • Control is returned to your program.

If you specify a response indicator and the key is pressed, the response indicator is set on and returned to your program. (The text information is associated with the indicator and is used by high-level language compilers to help in program documentation.)

If the display station user presses a function key and you have not specified it as either a command function (CF) key or a command attention key, the i5/OS operating system displays a message to the display station user indicating that the key is not valid at that time.

You can use combinations of CA and CF keywords within the same display file, but you cannot specify the same key number as both CA and CF keys. For example, CA02 and CF02 are not valid in the same display file.

Note: File level CA and CF keys are extended to the record level. This must be considered when assigning key numbers. For example, if CA02 is specified at file level and CF02 is specified at record level, CF02 is an error.

If you specify a key in the range 1 through 9, you must supply the leading zero in the keyword (for example, CA04).

Option indicators are valid for this keyword.

Validity checking

When the display station user presses a CF key, the data from fields with their MDT set on is placed into the input buffer before validity checking is done. Any errors in the data are then detected, and the appropriate error messages are sent to the display. Because validity checking is not done until after the data is placed in the input buffer, pressing a valid CA key after the CF key can cause incorrect data to be returned to your program. This condition is not a problem as long as your program does not process the input data when the CA key is pressed.

This condition can be prevented in either of two ways:
  • Do not allow the use of CA keys. Specify CF keys, which cause validity checking to be done on the data.
  • Do not specify any of the following validity checking keywords if CA keys are allowed:

    CHECK(M10)
    CHECK(M11)
    CHECK(VN)
    CHECK(VNE)
    COMP (EQ, NE, LT, NL, GT, NG, LE, GE)
    RANGE
    VALUES

Function keys valid for command attention keys at processing time

As a general rule, the last output operation determines which function keys are valid. However, the following list shows exceptions to this rule:

Note: The following keywords function like CA keys: CLEAR, HELP, HOME, and PRINT (with response indicator specified).

Example

The following example shows how to specify the CAnn keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00011A                                      CA01(91 'End of Program')
00012A                                      CA02(92)
00013A                                      CA03
     A
Related concepts
RETKEY (Retain Function Keys) and RETCMDKEY (Retain Command Keys) keywords