Previous Topic: Action=EDIT Class=DATA

Next Topic: Action=LOAD Class=COMMAND


Action=EXECUTE Class=COMMAND

Executes a command if it is known. When a user requests help, help text associated with the specified application ID, function name, and message ID (if specified) is displayed.

This statement has the following format:

&CONTROL SHRVARS=($FK,$CM)
-EXEC $CACALL      OPT=ACTION
                   ACTION=EXECUTE
                   CLASS=COMMAND
                   [NAME=‘COMMAND=command’]
                   [PARMS=‘APPL=application id]
                            [FUNC=function name]
                            [KEY=key]
                            [MESSAGE=messageid]
                            [CURSFLD=cursorfield value]]
APPL=application id

An optional parameter giving the application identifier (required for the HELP command).

FUNC=function name

An optional parameter indicating the function currently being performed (required for the HELP command).

COMMAND=command

An optional parameter giving the command to be executed (required if the KEY keyword is not used). If you use both the COMMAND and KEY keywords, and a command is assigned to the function key specified in KEY, the command assigned to the function key takes precedence.

The following commands (or any command defined using the CAS Command Definition facility) can be specified:

CMD

Invokes the Command Entry facility.

EX[EC]

Executes an NCL procedure.

DISC[ONN]

Disconnects the session.

HELP

Display help information.

KEYS

Switches FKA display.

LOCK

Locks the session.

NOTEPAD

Displays the CAS Notepad.

PASSWORD

Sets the user password.

PQ[UEUE]

Displays the PSM print queue.

PSKIP

Skips panels.

RETRIEVE

Retrieves the last command.

SPLIT

Splits the window.

START

Starts an NCL procedure.

SWAP

Swaps the window.

WHERE

Displays NCL procedure details.

KEY=key

An optional parameter giving the last function key (&INKEY value) that was pressed (required if the COMMAND keyword is not used). If you use both the COMMAND and KEY keywords, and a command is assigned to the function key specified in KEY, the command assigned to the function key takes precedence.

MESSAGE=message id

An optional parameter giving the message identifier of the currently displayed message (for example, when a user requires help on a message).

CURSFLD=cursorfield value

An optional parameter containing the value of the field in which the cursor is located.

Input Variables

This statement has no input variables.

Return Variables

This statement contains the following return variables:

&$FK1...&$FK24

The function key actions for keys F1 to F24.

&$FKLAB1...&$FKLAB24

The function key labels for keys F1 to F24.

&$FKA1

Function key area line 1.

&$FKA2

Function key area line 2.

&$CMDI

Set to Y or N to indicate if an action was performed. For example, a command is not executed if it is not in the command table.

&$CMDS

Set to C, K, or N indicating the source of the action (Command, Key, or None).

&$CMD

The first word of the action.

&$CMDPARMS

The remaining operands or parameters of the action.

&$CMDR

The retrieved command (when COMMAND=RETRIEVE).

&SYSMSG

System message. Contains the error message (for return code 8).

Feedback Codes

If a return code of 8 is set, then additional information is available as one of the following feedback codes, set in &$CAFDBK:

7

User not authorized

8

Processing error

9

Return requested

10

Nesting level exceeded

Example

The following statements execute the command in variable &COMMAND or assigned to the key indicated in variable &INKEY; the APPL, FUNC, and MESSAGE keywords are specified and are referenced if the command is HELP.

&CONTROL SHRVARS=($FK,$CM)
-EXEC $CACALL   OPT=ACTION +
                ACTION=EXECUTE +
                CLASS=COMMAND +
                NAME=‘COMMAND=&COMMAND’ +
                PARMS=‘APPL=ZPR +
                       FUNC=UPDATE +
                       KEY=&INKEY +
                       MESSAGE=PV7014