Chapter Contents

Previous

Next
WAITFOR

WAITFOR



Specifies a pause until conditions are met

All connections


Syntax
Syntax Description
Syntax
Syntax
Syntax
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.

Details

The WAITFOR statement directs the SAS System on the local host to do one of the following:

Typically, a WAITFOR statement is used after a TYPE statement sends input to the remote host that causes the local host to wait for the remote host's response to the input. For example, in the sample scripts in Starting and Stopping SAS/CONNECT Software, a WAITFOR statement follows the TYPE statement that invokes the SAS System on the remote host. The WAITFOR statement is also used after any TYPE statement that sends a 3270 AID key to the remote host.

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.

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

time-clause<:timeout-label>
where
time-clause
specifies a time period in the form n SECONDS.

n is the number of seconds that the local host is to wait. If you specify 0 SECONDS, a time-out 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 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 time-out occurs. If no label is specified, execution proceeds with the statement that follows the WAITFOR statement.

<screen-location> text-clause<:text-label>

where
screen-location
indicates the screen location at which the specified text clause should be found. This specification applies only to 3270 connections. If screen-location is specified, it must precede the text-clause to which it applies. The screen location is specified by the following, where n is any valid column or row number:

<COL n><ROW n>

Maximum values depend on the 3270 model being emulated (see the following table). If you specify a row without a column, the WAITFOR statement scans all columns of the given row. If you specify a column without a row, all rows of the column are scanned. The entire screen is scanned if you do not include a screen specification.

text-clause
specifies a string that the local host waits to receive from the remote host. The string can be

  • a character literal enclosed in quotes

  • a hex string enclosed in quotes.

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

:text-label
specifies the label of a statement 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 time-out (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 follows the WAITFOR statement.

Maximum Values for Screen Rows and Columns by 3270 Model Number
3270 Model Maximum Row Maximum Column
model 2 24 80
model 3 32 80
model 4 43 80
model 5 27 132


Usage Notes


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.