Chapter Contents |
Previous |
Next |
SIGNON Command and Statement |
Local |
Syntax | |
Syntax Description | |
Username and Password Naming Conventions | |
Examples of the SIGNON Command and the SIGNON Statement | |
Examples of SIGNON, RSUBMIT, ENDRSUBMIT, and SIGNOFF Statements |
Syntax |
SIGNON <remote-session-id><CONNECTWAIT=YES|NO> <MACVAR=value><CONNECTSTATUS=value> <SCRIPT=value> <fileref> <'filespec'> <NOSCRIPT> <USER=username|_PROMPT_> <PASSWORD=password|_PROMPT_> <SASCMD=SAS-command1...SAS-commandn'>; |
The options are used for initiating the link and interactions between the local and the remote sessions. The following options or any combination of the following options may be used in a SIGNON command:
PROCESS= was made an alias for REMOTE= in order to give you the option of differentiating between a SIGNON to a remote session on a local host (MP CONNECT) and a SIGNON to a remote session on a remote host. REMOTE= and PROCESS= can be used interchangeably.
In synchronous processing, you must wait for the remote processing to complete before control in the local SAS session is returned to you. This is the default processing technique for RSUBMIT if the WAIT option is not specified. In asynchronous processing, after the RSUBMIT block begins to execute on the remote host, you will regain control of your local SAS session to continue local processing or to continue to RSUBMIT to other remote sessions.
The value for the WAIT= option must be one of these:
YES|Y | indicates to execute RSUBMITs synchronously. |
NO|N | indicates to execute RSUBMITs asynchronously. |
If WAIT=NO is specified, it is also useful to specify the MACVAR= option in the RSUBMIT statement. This allows you to test the status of the current asynchronous RSUBMIT by determining whether processing has completed or is still in progress.
When %SYSRPUT executes within a synchronous WAIT=YES) remote submit, the macro variable is defined to the local SAS session as soon as it executes.
When %SYSRPUT is executed within an asynchronous (WAIT=NO) remote submit, the macro variable, by default, is not set in the local session until a synchronization point. See %SYSRPUT Statement for more information about synchronization points.
0 | indicates that the SIGNON was successful. |
1 | indicates that the SIGNON failed. |
2 | indicates that you have already signed on to this remote session. |
If the SIGNON is successful, the macro variable is set, and it becomes the default macro variable for this remote session. This default can only be overridden by a subsequent successful RSUBMIT command that has the MACVAR= option specified. There is no other way to change the default for this remote session. Therefore, if the user attempts to sign on to the same remote session a second time and specifies a different value for MACVAR=, the macro variable associated with the second sign on attempt does not become the default, but the macro variable will be set to indicate that the user had already signed on.
YES|Y | Status window is displayed during file transfers. |
NO|N | Status window is not displayed during file transfers. |
If this option is omitted from the SIGNON statement, the Status window is displayed during transfers by default. This option can also be specified on subsequent RSUBMIT and PROC UPLOAD and DOWNLOAD statements so that the default may be overridden for specific transfers.
When the SIGNON command executes, the usual SAS log messages for the remote SAS System display in your local LOG window. When the link has been successfully established, the following message is displayed:
NOTE: REMOTE SIGNON TO remote-session-id COMPLETE.
If the fileref you define for the script is the default fileref RLINK, omit this specification in the SIGNON command.
Note: SASCMD= is also a global SAS system option.
If the SASCMD= global system option is already set, a locally set SASCMD=
option in the SIGNON command would take precedence over the globally set option.
See SASCMD=
for more information.
Here is a typical SASCMD option setting:
SASCMD="sas"
The primary difference between the SIGNON command and the statement is that the command can be used only from the command line of the windowing environment or within the DM statement. The SIGNON statement must be followed by a semicolon (;) and can be used in any SAS session on the local host.
Username and Password Naming Conventions |
Each username and password is limited to 256 characters that follow these conventions:
Examples:
user=joe password=Born2run user=joe password='' # null space specified by contiguous quotation marks user='joe black' password='Born 2 run' user='joe?black' password='Born 2 run' user='apexdomain\joe' password=born2run # Win NT username user='"crazy joe"' pw=_prompt_; user=_prompt_;
Examples of the SIGNON Command and the SIGNON Statement |
These examples use the SIGNON statement, which requires a semicolon (;). The SIGNON command does not use the semicolon.
Suppose you specify the name of the session in an OPTIONS statement:
options remote=rhost;
You then assign the fileref RLINK to your script by using the following FILENAME statement, where external-file-name is your script:
filename rlink 'external-file-name';
Now you can use the short form of the SIGNON command or statement to initiate a link, assuming that the default access method for your host is TCP/IP.
signon;
If you assign the fileref RLINK to your script, you can specify the remote-session-id in the SIGNON statement without having to issue an OPTIONS statement:
signon rhost;
You can assign some other fileref to the script, as in the following example:
filename startup 'external-file-name';
You can now issue this SIGNON command or statement:
signon startup cremote=ahost;
In Version 8, the ability to provide USER= and PASSWORD= options directly to the SIGNON statement and command supercedes the use of the Version 7 host-specific security option.
For example, in Version 7, if using the TCP/IP access method to make a secure connection between a local host that runs on a Windows NT and a secure spawner running on a remote UNIX host that runs onUNIX, you set this security option:
options set tcpsec=_prompt_;In Version 8, the preferred method for making a secure connection is to specify security options directly to the SIGNON command or statement. Here is a Version 8 example:
signon user=_prompt_;
At signon, the user is prompted for username and password.
If you are using RLINK or any other fileref in the SIGNON command or statement, remember that you can define the fileref for the script in a FILENAME statement in the SAS autoexec file.
The SIGNON statement is particularly useful for running SAS/CONNECT from an interactive line-mode session or a non-interactive job. For line-mode and non-interactive sessions, use the SIGNON statement in combination with the SIGNOFF, RSUBMIT, and ENDRSUBMIT statements.
Examples of SIGNON, RSUBMIT, ENDRSUBMIT, and SIGNOFF Statements |
Suppose you want to use two remote hosts to execute SAS programs and download data to a local host. This example assigns a fileref for script files on remote hosts; one on a on a Windows NT remote host that runs an unsecured spawner , and another for an OS/390 remote host. The local host is a UNIX system, so the remote-session-ids are the names of the host machines at the site. In this example, the two remote hosts are named TSO and WNT.
The following program can be submitted on a local UNIX host from the Program Editor window, interactive, or non-interactive line-mode session:
/******************************************/ /* set communications access method */ /******************************************/ options comamid=tcp; /******************************************/ /* initiates link to a Window NT remote */ /* host */ /******************************************/ signon wnt; /******************************************/ /* initiates link to an OS/390 remote host*/ /******************************************/ filename tsoscr '!sasroot/misc/connect/tcptso.scr'; signon tso script=tsoscr; /******************************************/ /* submit statements to a Windows NT */ /* remote host */ /******************************************/ rsubmit wnt wait=no; statements to be processed by Windows NT remote host endrsubmit; /******************************************/ /* submit statements to OS/390 remote host*/ /******************************************/ rsubmit tso wait=no; statements to be processed by OS/390 remote host endrsubmit; waitfor _ALL_ wnt tso; /******************************************/ /* terminates both links */ /******************************************/ signoff tso cscript=tsoscr; signoff wnt cscript=winscr;
The statements enclosed by the RSUBMIT and ENDRSUBMIT statements are processed by the remote host. The remaining statements are processed by the local host.
The following example illustrates that the macro variable from a successful SIGNON will be used if an unsuccessful attempt is made.
/******************************************/ /* sign on successful, rhost1 will be */ /* set to 0 to indicate success. */ signon rhost macvar=rhost1; /******************************************/ /* sign on fails because we have already */ /* signed on to this remote session, */ /* so rhost2 will be set to 2 to */ /* indicate this, but rhost1 will */ /* still be the MACVAR associated */ /* with rhost. */ /******************************************/ signon rhost macvar=rhost2; rsubmit rhost wait=no; data a; x=1; run; endrsubmit; /******************************************/ /* rhost1 is still the default and */ /* will indicate the progress of any */ /* subsequent RSUBMITs. */ /******************************************/ %put &rhost1;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.