Sign-On Scripts |
Syntax |
For details about writing scripts, see the topic about sign-on script files in the SAS/CONNECT User's Guide.
Like other SAS statements, all script statements must end with a semicolon (;).
Script statements have a free format, which means that there are no spacing or indention requirements. A statement can be contained within a single line or it can span several lines. Statement keywords are not case sensitive.
Enclose case-sensitive text strings in quotation marks. For example, if your script defines a text string in a WAITFOR statement, ensure that the uppercase and lowercase characters in the text string exactly match the text string from the server.
You can use either single or double quotation marks to quote a string, such as a server command, in a script statement. The rules that you use to embed quotation marks in a SAS statement and to embed quotation marks in a script statement are the same.
Any script statement can include a label specification. The label must be a valid SAS name, with a maximum of eight characters. The first character must be an alphabetic character or an underscore. A label must be followed immediately by a colon (:) and it can be defined only once in the script.
Specifying Time |
Some script statements specify time in seconds, as follows:
n SECONDS |
n can be any number, including decimal fractions. SECOND is an alias for SECONDS. Here are some examples of valid time specifications:
0 SECONDS | |
0.25 SECONDS | |
1 SECOND | |
3.14 SECONDS |
Using the WAITFOR and TYPE Statements |
When writing a script or modifying an existing script, pay special attention to the WAITFOR and the TYPE statements. To ensure that the script recognizes the expected prompt during each stage of sign-on, specify the exact sequence of prompts and responses for the server.
You might test the sequence by experimenting at the server by going through the process that you want to capture in the WAITFOR and the TYPE statements. For each display at the server, choose a word from that display for the WAITFOR statement. Capture in a TYPE statement the information that you type in response to a display. Be sure to note all carriage returns or other special keys.
For example, if TSO is the server and you need to use a TYPE statement in a sign-on script whose length is greater than 80 characters, divide the TYPE statement into two or more TYPE statements.
To divide the TYPE statement, insert a hyphen (-) at the division point. The remote TSO machine interprets the hyphen as the continuation of the TYPE statement from the previous line.
For example, consider the following TYPE statement:
type "sas options ('dmr comamid=tcp')" enter;
To divide the statements, change it to the following:
type "sas options ('dmr comamid=-" enter; type "tcp')" enter;
Note: Do not insert spaces around the hyphen.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.