Chapter Contents

Previous

Next
SIGNON Command and Statement

SIGNON Command and Statement


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

Local


Syntax
Syntax Description
Examples of the SIGNON Command and the SIGNON Statement
Examples of SIGNON, RSUBMIT, ENDRSUBMIT, and SIGNOFF Statements

Syntax

SIGNON <options>;

Syntax Description

options
specifies the options to be used as defaults for initiating the link and interactions between the local and the remote sessions.

Details

The SIGNON command and the SIGNON statement initiate a link between a local SAS session and a remote SAS session and execute a script file if you are using an access method that requires a script file. Issue the SIGNON command from the command line of a local SAS window. You can also issue a SIGNON statement from the local SAS session, which is especially useful for interactive line-mode sessions or non-interactive jobs.

The primary difference between the 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.

The following options or any combination of the following options may be used in a SIGNON command:

remote-session-id
CONNECTREMOTE=remote-session-id
CREMOTE=remote-session-id
REMOTE=remote-session-id
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.

When you specify remote-session-id, the script that is associated with the default fileref RLINK is executed. In this case, you must have a valid script file associated with the fileref RLINK.

CONNECTWAIT=value
CWAIT=value
WAIT=value
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 CONNECTWAIT 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 CONNECTWAIT= option must be one of these:
YES|Y indicates to execute RSUBMITs synchronously.
NO|N indicates to execute RSUBMITs asynchronously.

If CONNECTWAIT=NO is specified, it is also useful to specify the CMACVAR= 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 (CONNECTWAIT=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 (CONNECTWAIT=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.

CMACVAR=value
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 CMACVAR= 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 CMACVAR=, 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.

CONNECTSTATUS=value
CSTATUS=value
STATUS=value
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.

CSCRIPT=value
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 CSCRIPT= 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 
COMPLETE.

fileref
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.

'filespec'
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.

NOSCRIPT
NOCSCRIPT
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.


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=ahost;

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:


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

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;

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 two filerefs for script files on remote hosts, one for the Windows NT remote host and the other for the 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                                   */
   /******************************************/
filename winscr '!sasroot/misc/connect/tcpwin.scr';
signon wnt cscript=winscr;

   /******************************************/
   /* initiates link to an OS/390 remote host*/
   /******************************************/
filename tsoscr '!sasroot/misc/connect/tcptso.scr';
signon tso cscript=tsoscr;

   /******************************************/
   /* submit statements to a Windows NT      */
   /* remote host                            */
   /******************************************/
rsubmit wnt;
   statements to be processed by Windows NT
    remote host
endrsubmit;

   /******************************************/
   /* submit statements to OS/390 remote host*/
   /******************************************/
rsubmit tso;
   statements to be processed by OS/390 remote host
endrsubmit;

   /******************************************/
   /* 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, OAKONE will be     */
   /* set to 0 to indicate success.          */
   /******************************************/
signon oak cmacvar=oakone;

   /******************************************/
   /* sign on fails because we have already  */
   /* signed on to this remote session,      */
   /* so OAKTWO will be set to 2 to          */
   /* indicate this, but OAKONE will         */
   /* still be the CMACVAR associated        */
   /* with OAK                               */
   /******************************************/
signon oak cmacvar=oaktwo;

rsubmit oak cwait=no;
   data a;
   x=1;
   run;
endrsubmit;

   /******************************************/
   /* OAKONE is still the default and        */
   /* will indicate the progress of the      */
   /* RSUBMIT                                */
   /******************************************/
%put &oakone;


Chapter Contents

Previous

Next

Top of Page

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