Previous Page | Next Page

SAS/CONNECT Script Statements

WAITFOR



Specifies a pause until specific conditions are met.

Syntax
Syntax Description
Usage Notes

Syntax

WAITFOR pause-specification-1<. . . pause-specification-n >;

Syntax Description

pause-specification

is the criteria used to determine when the pause is terminated for the WAITFOR statement and processing continues.

The value of pause-specification can be either of the following:

time-clause<:timeout-label>
time-clause

specifies a time period in the form n SECONDS.

n is the number of seconds that the client waits before processing continues. If you specify 0 SECONDS, a timeout occurs almost immediately. In most cases, you should specify a value greater than 0. You can specify only one time clause in a WAITFOR statement.

:timeout-label

specifies the label of a statement that exists later in the script. The label must be preceded by a colon (:). When you specify a label, script execution passes to the labeled statement after a timeout occurs. If no label is specified, execution proceeds with the statement that is specified after the WAITFOR statement.

text-clause<:text-label>
text-clause

specifies a string that the client waits to receive from the server. The string can be the following

  • a character string that is enclosed in quotation marks

  • a hexadecimal string that is enclosed in quotation marks

When text-clause is specified, SAS on the client reads input from the server, searching for the specified string. With 3270 connections, SAS on the client scans the server screen (instead of reading characters sequentially).

:text-label

specifies the label of a statement that exists later in the script. The label must be preceded by a colon (:). When you specify a label, script execution passes to the labeled statement after a timeout (if the label follows a time clause) or after the specified string has been read (if the label follows a text clause). If no label is specified, execution proceeds with the statement that is specified after the WAITFOR statement.

Details

The WAITFOR statement directs SAS on the client to do one of the following:

Usually, a WAITFOR statement is used after a TYPE statement sends input to the server that causes the client to wait for the server's response to the input. For example, in the sample scripts in Starting and Stopping SAS/CONNECT, a WAITFOR statement follows the TYPE statement that invokes SAS on the server.

You can include one or more pause specifications in a WAITFOR statement. When you include more than one pause specification, use commas to separate the clauses.


Usage Notes

Previous Page | Next Page | Top of Page