Certain commands accept KSL and/or AutoEdit variables. When both KSL and AutoEdit variables are specified, KSL variables are resolved (replaced) first.
Table 2 KSL Screen Commands
Command |
Description |
---|---|
CLEAR |
Equivalent to pressing the Clear key on the keyboard. |
CURSOR |
Depending on the parameters listed below, CURSOR moves the cursor to the
|
ENTER |
Equivalent to pressing the Enter key on the keyboard. |
FIND{‘textstring’|expression} |
Searches for text on the screen from the current position of the cursor. If the text is found, the cursor is positioned at the beginning of the text. For more information, see special variable %FINDRC, described in Table 6 in Special KSL Variables.
|
PA01-PA03 |
Equivalent to pressing program attention keys on the keyboard. |
PF01-PF24 |
Equivalent to pressing program function keys on the keyboard. |
SCREENSIZE line-no col-no |
Defines the logical terminal size. Valid terminal sizes are:
|
TYPE{‘textstring’ | expression} |
Operates the keyboard by "typing" the text on the screen from the current position of the cursor. If the text is too long for the current data field, an error message is produced and the script stops executing.
|
Table 3 KSL Flow Commands
Command |
Description |
---|---|
CALL progname [argument1 argument2 ... argumentn] |
Calls an external program (progname). The arguments are optional. A maximum of nine arguments can be passed. Use command CALL when the called program expects to receive a list of parameters. The parameters are passed in a format compatible with ASSEMBLER, COBOL and FORTRAN.
|
Note: The return code of the called program is stored in special variable %CALLRC, which is described in Table 6. |
|
CALLMEM memname [argument1 argument2 ... argumentn] |
Calls a predefined KSL script that is located in the member memname in the library allocated to the DACALL DD statement. The arguments are optional. A maximum of nine arguments can be passed. |
Note: The return code of the called program is stored in special variable %CALLRC, which is described in Table 6. |
|
END |
Indicates the end of the KSL script. This is a mandatory command in the main script commands list. When activated at any level, the script is terminated. |
EXEC progname [argument1 argument2 ... argumentn] |
Calls an external program (progname). The arguments are optional. A maximum of nine arguments can be passed. Use command EXEC when the called program expects to receive an argument in a format similar to JCL’s EXEC PGM argument format. (All arguments are merged into a single argument.)
(Described later in this chapter). |
Note: The return code of the called program is stored in variable %CALLRC, which is described in Table 6 in Variables. |
|
GOTO label_name |
Branches to the specified label name, which must be in the same command member. |
The IFSCREEN command allows elements of the screen display to be used for flow control. If all parts of the conditional expression evaluate to true, script flow branches to the specified label name, which must be in the same command member. A parameter cannot be specified more than once within the same conditional expression. Each part of the conditional expression is true if the:
|
|
IFSCREEN (continued) |
|
IFVAR operand operator operand GOTO labname |
Where:
|
Note: Operands are compared as character strings from left to right. For example, 91 is greater than 1000, because 9 is greater than 1. IFVAR is used together with command GOTO to permit branching based on different runtime conditions. If the condition is true, flow branches to the specified label name (must be in the same command member). |
|
LABEL name |
Defines a label to which script flow can branch. |
MAXCOMMAND number |
number is the maximum number of commands that can be executed in the script. Default: 400. This is designed to prevent an accidental loop. |
PAUSE n |
Where n= hundredths of seconds. Causes the script to "wait" the specified amount of time. |
RETURN [return-code] |
Returns to the calling script. return-code must be a number from 0 through 4095. When command RETURN is activated, control is passed to the command after the CALLMEM command in the calling member. The variable %CALLRC in the calling member is set to the value of the return code. Default: 0. |
Table 4 KSL Print Commands
Command |
Description |
---|---|
BOTTOMLINE line-no pos-in-line {‘textstring’|varname} |
Assigns contents to a line in the page footer. The footer contents are valid throughout the script until overridden by another BOTTOMLINE command for the same line in overlapping positions. Command BOTTOMSIZE overrides the current BOTTOMLINE specifications.
|
BOTTOMSIZE line-no |
Specifies the number of lines in the report bottom (footer) (1 minimum – 15 maximum). The bottom size is valid throughout the script until a new BOTTOMSIZE command is activated. |
HEADERLINE line-no pos-in-line {‘textstring’|varname} |
Assigns contents to a line in the page header. The header contents are valid throughout the script until overridden by another HEADERLINE command for the same line in overlapping positions. Command HEADERSIZE overrides the current HEADERLINE specifications.
|
HEADERSIZE line-no |
Specifies the number of lines in the report header (1 minimum – 15 maximum). The header size is valid throughout the script until a new HEADERSIZE command is activated. |
PAGESIZE line-no col-no |
Defines the maximum size of a printed page.
|
PRINTLINE line-no |
Prints the contents of the line identified by line-no (a number from 1 through 9999). |
PRINTNEWPAGE |
Skips to a new page. Each occurrence of command PRINTNEWPAGE in a KSL script must be preceded by commands SCREENSIZE, PAGESIZE, HEADERSIZE and BOTTOMSIZE. |
PRINTSCREEN from-line until-line |
Prints the screen contents of the specified line range.
|
SETLINE identifier pos-in-line font {‘textstring’|varname} |
Assigns contents to a line that is about to be printed.
|
TRACE {ON|OFF} |
Simplifies problem resolution using the TRACE (debug) facility while defining a script.
|
Table 5 KSL Processing Commands
Command |
Description |
---|---|
ALLOC DD ddname DS dsname[MEM memname][{SHR|OLD|MOD}] |
Dynamically allocates the data set dsname to the specified DD name.
Before a data set can be accessed (for example, with OPENFILE, GETFILE), it must be allocated and assigned a DD name. Similarly, when the data set no longer needs to be accessed, the data set and DD name must be released (for more information, see command FREE in this table). This DD name is local to the script that creates it. |
CLOSEFILE ddname |
Closes sequential data set ddname. ddname is any DD name consisting of a constant, KSL variable, or AutoEdit variable. |
FREE DD ddname |
Dynamically frees the data set allocated to the specified DD name. (The DD name is assigned by command ALLOC.) Activate this command when a data set no longer needs to be accessed by the script. |
GETFILE ddname INTO varname |
Stores in the specified variable the contents of the next record in the sequential file referenced by ddname, where
|
The OPENFILE command opens sequential data set ddname for access.
|
|
PUTFILE ddname FROM varname |
Writes the contents of variable varname in the next record of the sequential file referenced by ddname.
Note: AutoEdit variables (that is, variables beginning %%) cannot be used with a PUTFILE command. Instead, such a variable must be passed to a KSL variable (that is, a variable beginning with a single %). The KSL variable must be specified in the PUTFILE command. |
Assigns the appropriate value to the variable name. The SETOGLB command is used to create (set) a global AutoEdit variable. expression can contain a KSL variable. Note: This command is only available if Control-O is installed at your site. Global AutoEdit variables can only be used when the Control-O monitor is online. For further information, see the DO SET statement in the Control-O User Guide. |
|
Assigns the value of the expression to the variable name. The SETOLOC command is used to create (set) a Local AutoEdit variable. expression can contain a KSL variable. |
|
SETVAR varname CURSOR length |
Assigns extracted text to variable varname. This command is used to create (set) variables.
|
SETVAR varname DATA{‘textstring’|expression} |
Assigns a text string to variable varname. This command is used to create (set) variables.
|
SETVAR varname SCREEN from-line from-col length |
Assigns extracted text to variable varname. This command is used to create (set) variables.
Variable value is determined by the screen contents at a specific screen position. The screen position is specified by:
|
SHOUT TO destination [URG urgency] TEXT {textstring|expression} |
Sends ("shouts") textstring to the specified destination.
|
Parent Topic |