Chapter Contents


SIGNON Command and Statement

SIGNON Command and Statement

Initiates a link between a local SAS session and a remote SAS session.


Syntax Description
Username and Password Naming Conventions
Examples of the SIGNON Command and the SIGNON Statement


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'>;

Syntax Description

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:

specifies the name of the remote session in which you want to sign on. After the remote-session-id has been specified by either the SIGNON command or as a system option, subsequent RSUBMIT, SIGNON, or SIGNOFF commands or statements that omit remote-session-id default to the specified session id.

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.

specifies whether remote submits are to be executed synchronously or asynchronously by default during a SAS session. The default setting can be overridden by specifying the CONNECTWAIT= option in subsequent RSUBMIT statements for a specific remote submit.

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.

specifies the name of the macro variable to associate with this remote session. The macro variable will NOT be set if the SIGNON command fails due to incorrect syntax. Other than this one exception, the macro variable is set when the SIGNON command is completed. The variable will have one of the following values:
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.

specifies the default setting for the display of the status window. The value for this option must be one of these:
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.

specifies the script file to be used during sign on. It may either be a fileref or a quoted, fully-qualified pathname. If the fileref, the filespec, and the SCRIPT= option are specified, the last specification overrides and takes precedence over the others.

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 

is the name of the reference file associated with the script that starts the link. The fileref must be defined by a previously executed FILENAME statement.

If the fileref you define for the script is the default fileref RLINK, omit this specification in the SIGNON command.

is the name of the script you want to execute. Use the filespec in the SIGNON command when no fileref has been defined for the script that you want to execute. The filespec can be either a fully qualified filename or the name of a file in the current working directory. Do not specify both a fileref and a filespec.

specifies that no script should be used to sign on. This is useful if you have already invoked the SAS session on the remote host, and you do not need any additional script functionality. When you use NOSCRIPT, the SIGNON command executes faster and requires less memory, but no special functions invoke a SAS session on the remote host or perform any special functions such as error processing or logging on to the remote host.

valid values that can be assigned to USER are

For details about a valid username, see Username and Password Naming Conventions.

a secure method, specifies that SAS prompt the user for a valid username.

valid values that can be assigned to PASSWORD are:

For details about a valid password, see Username and Password Naming Conventions.

a secure method, specifies that SAS prompt the user for a valid password.

SASCMD="SAS-command1" ... "SAS-commandn"
For MP CONNECT signon only, is the command that invokes the remote SAS session.

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.  [cautionend]
Here is a typical SASCMD option setting:



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:


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_;

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.


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.


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

   /* submit statements to OS/390 remote host*/
rsubmit tso wait=no;
   statements to be processed by OS/390 remote host
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;

   /* rhost1 is still the default and        */
   /* will indicate the progress of any      */
   /* subsequent RSUBMITs.                   */
%put &rhost1;

Chapter Contents



Top of Page

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