Previous Topic: SCRIPT CommandNext Topic: Commands for Utilities


SESSCMD Command

The SESSCMD command sends a text string (such as a command) to a specified session, and then retrieves a screen image from that session after the text string has been processed. (To fetch the screen image, an executing SESSCMD command invokes the GETSCRN command automatically.)

This command has the following format:

"SESSCMD 'keystring' SESSION(sessname) 
  [CMDWAIT(nn)]
  [PREFIX(prefix|LINE|NO)]
  [SCREEN(YES|NO)]"
keystring

Specifies the text of the command to be issued to the session. The string can contain up to 234 characters. If you execute the SESSCMD command from within a REXX program and the keystring contains quotation marks, specify the command by using different delimiter characters of your choice to enclose the text.

As part of the command text, you can include one of the following:

Besides text, the string can also contain key abbreviations and keyboard operation instructions. A key abbreviation consists of the @ character followed by a letter (uppercase or lowercase), a digit, or the @ character itself. When specifying a key abbreviation, enter it exactly as shown in the key abbreviation table found in the appendix on customizing special CA Automation Point files in the Administrator Guide.

Note: The SESSCMD command automatically appends an ENTER keystroke (@E) to your keystring value.

SESSION

Specifies the name of the target session (sessname) to receive the command text.

CMDWAIT

(Optional) Specifies the number of seconds (up to 60) that CA Automation Point waits for the keyboard to unlock after the SESSCMD executes. After the specified waiting period, CA Automation Point then captures the current screen image of the current session.

If the time period you specified with the CMDWAIT operand expires before CA Automation Point issues the command, the SESSCMD command produces a return code of 32, meaning that the keyboard is locked. If CA Automation Point issues the command but the session does not respond to that command, the SESSCMD command generates a return code of 36.

Default: 15

PREFIX

(Optional) Creates a stem variable to store the lines of a screen image returned to CA Automation Point. CA Automation Point stores each line of the screen in a separate variable and numbers the variables consecutively (for example, LINE.1, LINE.2, and so on).

Note: The variable numbered 0-for example, LINE.0-always contains the total number of elements in the stem variable.

Valid PREFIX values are:

prefix

Specifies he name that you want to assign to the line variables. For example, specifying PREFIX(ROW) causes CA Automation Point to create a set of variables named ROW.0, ROW.1, ROW.2, and so on through ROW.n.

LINE

Tells CA Automation Point to create stem variables named LINE1 through LINEn to store lines of a screen image.

NO

Creates no variables. Specifying PREFIX(NO) saves memory if you do not intend to use the variables.

Default: LINE

Note: For compatibility with earlier versions of CA Automation Point, the SESSCMD command also creates the old-style, non-stem variables. For example, suppose that the PREFIX variable is LINE. In addition to the stem variables described above, SESSCMD also creates the nonstem variables LINE1, LINE2, and so on through LINEn. In this case, the variable LINE (equivalent to the stem variable LINE.0) contains the total number of elements in the variable.

Each time you issue the SESSCMD command, CA Automation Point creates SCREEN and LINE.n variables automatically unless you specify otherwise.

SCREEN

(Optional) Specifies whether CA Automation Point creates the variable SCREEN to store the character portion of the screen image. Valid SCREEN values are:

YES

Creates the SCREEN variable and other variables. For more information on those other variables, see the description of the GETSCRN command.

NO

Creates no variables. This option saves memory if you do not intend to use the variables.

Default: YES

Usage Notes:

A keyboard operation instruction consists of the @ character followed by a keyboard operation name enclosed in quotation marks. For example, the instruction for the MODE SELECT key is @"MODE_SEL". The Administrator Guide lists valid operation names

Examples: