• Aucun résultat trouvé

IF-THEN-ELSE Sequence

Dans le document TSO Extensions (Page 141-146)

Use the IF-THEN-ELSE sequence to define a condition, test the truth of that condition, and initiate an action based on the test results. Do not code THEN and ELSE on the same logical line.

[label: ] IF logical-expression THEN [action]

[ELSE [action]]

label

a name the CLIST can reference in a GOTO statement to branch to this IF-THEN-ELSE sequence. label is one-to-eight alphameric characters, beginning with an alphabetic character.

logical-expression

a group of comparative expressions grouped by logical operators. The minimal entry for a logical expression is a comparative expression.

action

an executable command, subcommand, or CLIST statements. (Enclose an action consisting of more than one statement in a DO-group.) The THEN action is invoked if the logical expression is true. The ELSE action is invoked if the logical expression is false. If a null THEN or null ELSE statement is executed, control passes to the next sequential statement after the IF-THEN-ELSE sequence.

OPENFILE Statement

Use the OPENFILE statement to open a file for I/O. The file must have been allocated during the session and assigned a file name. Each execution of OPENFILE can open only one file.

Note: The OPENFILE statement sets any I/O variables to nulls. Always execute the OPENFILE statement before using any SET statements to create I/O records.

Complete your file I/O on a specific file before changing from command to subcommand mode and vice versa. Cross-mode file I/O is not supported and causes miscellaneous abnormal terminations.

Specify NOFLUSH for a CLIST that uses file I/O. (See the CONTROL statement.)

If a system action causes TSO to flush the input stack because you did not specify NOFLUSH, a user may have to log off the system to recover. The user will recognize the condition by receiving a message similar to "FILE NOT FREED, DATA SET IS OPEN."

[label: ] OPENFILE {file-name }

{

INPUT }

label

OUTPUT

&symbolic-variable-name UPDATE

a name the CLIST can reference in a GOTO statement to branch to this OPENFILE statement. label is one-to-eight alphameric characters, beginning with an alphabetic character.

file-name

the file name (ddname) you assigned to the file (data set) when allocating it in the current session.

symbolic-variable-name

the symbolic variable to which you assigned file-name INPUT

open the file for input.

OUTPUT

open the file for output.

UPDATE

open the file for updating in place; that is, the CLIST can execute GETFILE and PUTFILE statements before closing the file.

PROC Statement

Use the PROC statement to define parameters to be passed to the CLIST using the EXEC command. PROC is optional. If you use it, it must be the first executable statement in the CLIST.

If the name of a positional parameter on the PROC statement is the same as the name of a GLOBAL variable, an error occurs. You cannot predefine a GLOBAL variable.

PRoe

positional-specification [positional-pararnetern] ...

[keyword-pararnetern[([default-valuen])]] ...

positional-specification

the number of required positional parameters to be passed. Enter 1-5 decimal digits. Enter 0 if none.

positional-parameter

a positional parameter passed to the CLIST.

A positional parameter name may be 1-252 alphameric characters in length, beginning with an alphabetic character.

keyword-parameter

a keyword parameter passed to the CLIST.

A keyword parameter name may be 1-31 alphameric characters in length, beginning with an alphabetic character.

default-value

the value assigned to the corresponding variable in the CLIST if the user does not specify a value on the associated keyword on the EXEC command.

omitted value (empty parentheses)

the user may supply a value on the associated keyword on the EXEC command

All parameters have an initial value at the time the CLIST begins execution.

Each parameter name becomes the name of a symbolic variable that has the initial value of the associated parameter. The values of passed parameters are in effect only while the CLIST is active. Values passed in lower case are translated to upper case by the the EXEC command.

PUTFILE Statement

Use the PUTFILE statement to write a record to an open file. Each execution of PUTFILE transfers one record. Unless the user wants the same record sent more than once, the file name variable must be initialized to a different record using an assignment statement before the next PUTFILE statement is issued.

[label: ] PUTFILE file-name

label

a name the CLIST can reference in a GOTO statement to branch to this PUT FILE statement. label is one-to-eight alphameric characters, beginning with an alphabetic character.

file-name

the file name (ddname) assigned to the file (data set) when it was allocated in the current session. Do not specify a symbolic variable containing the file name.

READ Statement

Use the READ statement to read input from the terminal and store it in symbolic variables. These variables may be created on the READ statement or elsewhere in the CLIST. The READ statement is usually preceded by a WRITE statement that requests the expected input from the terminal.

[label: J READ [variable, [variablenJ ... ]

label

a name the CLIST can reference in a GOTO statement to branch to this READ statement. label is one-to-eight alphameric characters, beginning with an alphabetic character.

variable

any valid variable name. The variables are positional in that values in the input data entered by the terminal user are stored sequentially into the specified variables.

omitted operand

store the input in the &SYSDV AL control variable

Dans le document TSO Extensions (Page 141-146)

Documents relatifs