Chapter Contents


SIGNOFF Command and Statement

SIGNOFF Command and Statement

Terminates the link between a local SAS session and a remote SAS session.


Syntax Description


SIGNOFF <remote-session-id> <MACVAR=value> <CSCRIPT=value> fileref<'filespec'> <NOSCRIPT>;

Syntax Description

Options specify defaults for terminating the link between the local and the remote sessions.


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

The following options or any combination of these options may be used in a SIGNOFF command:

specifies the name of the remote session from which you want to sign off. 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.

PROCESS= was made an alias for REMOTE= in order to give you the option of differentiating between a SIGNOFF from a remote session on a local host (MP CONNECT) and a SIGNOFF from a remote session on a remote host. REMOTE= and PROCESS= can be used interchangeably.

specifies the name of the macro variable to be associated with this remote session. The macro variable is NOT set if the SIGNOFF command fails due to incorrect syntax. Other than this one exception, the macro variable is set when the SIGNOFF command is completed. The variable will have one of the following values:
0 indicates that the SIGNOFF was successful.
1 indicates that the SIGNOFF failed.

If the SIGNOFF is successful, the macro variable is set to 0. However, because the link is now terminated, the macro variable is no longer associated with that remote session. If the SIGNOFF fails, the macro variable that is specified in the SIGNOFF is set to 1. Even though it was an unsuccessful SIGNOFF, the macro variable is not associated with that remote session; instead the default MACVAR= (if any) is used.

specifies the script file to be used during SIGNOFF. CSCRIPT may be a fileref or a quoted, fully-qualified pathname. If the fileref, the filespec, and the CSCRIPT= options are specified, the last specification takes precedence over the others.

is a filename associated with the script that terminates the link. The fileref must be defined by a previously executed FILENAME statement.

At many computing installations, you use the same script to start and terminate a link. If you use one script to do both, you need to assign only one fileref.

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

is the filename of the script that you want to execute. Use the filespec in the SIGNOFF 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 off. This is useful if you do not need any additional script functionality. When you use NOSCRIPT, the SIGNOFF command executes faster and requires less memory, but no special functions such as logging off the remote host or error processing, are performed.


The following example demonstrates that the MACVAR variable is used if the sign off is unsuccessful:

   /* Sign on successful, rhost1 will be */
   /* set to 0 to indicate success, and  */
   /* macro variable rhost1 is now       */
   /* associated with this remote        */
   /* session.                           */
signon rhost macvar=rhost1;

   /* Sign off will fail, and rhost2     */
   /* will be set to 1 to indicate this, */
   /* but because it was unsuccessful,   */
   /* rhost1 is still the default macro  */
   /* variable associated with this      */
   /* remote session.                    */
signoff rhost macvar=rhost2 

In this example, no macro variable was assigned at sign on, therefore if the sign off is not successful, no macro variable will be set for this remote session.

   /* No macro variable associated with  */
   /* remote session                     */
signon rhost;

   /* Sign off will fail, and ABC will   */
   /* be set to 1 to indicate this,      */
   /* but because it was unsuccessful,   */
   /* the default of no macro variable   */
   /* will go into effect for this       */
   /* remote session.                    */
signoff rhost macvar=abc 

When the SIGNOFF command executes, the usual SAS log messages for the remote SAS System appear in the Log window on your local host. When the link has been terminated, the following message is displayed:

NOTE: REMOTE SIGNOFF TO remote-session-id 

Suppose you assign the fileref RLINK to your script with the following FILENAME statement, where external-file-name is the name of your script:

filename rlink 'external-file-name';

Then you can use the short form of the SIGNOFF command or statement to terminate the link:


If you have multiple remote sessions executing, you can specify which session to sign off by using the remote-session-id.

signoff ahost;

Suppose that you assign some other fileref to the script:

filename endit 'external-file-name';

Then you must specify the fileref in the SIGNOFF command or statement because it is not the default script fileref:

signoff cscript=endit;

When you are using a fileref other than RLINK for the signoff script and you have multiple remote sessions executing, use the CREMOTE= option to specify which session should be ended.

signoff cremote=ahost cscript=endit;

If you are using RLINK or any other fileref in the SIGNOFF statement, remember that you can define the script's fileref in a FILENAME statement in the SAS autoexec file. Then you do not have to type and execute the FILENAME statement before you use the SIGNOFF command.

If you do not assign any fileref to the script, you must specify the filespec in the SIGNOFF command. For example, you can use the following command:

signoff 'external-file-name';

If you do not want to perform any special processing when you sign off, you can omit the script that is used for signing off, as in this example:

signoff noscript;

Chapter Contents



Top of Page

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