Chapter Contents |
Previous |
Next |
SIGNOFF Command and Statement |
Local |
Syntax | |
Syntax Description | |
Examples |
Syntax |
SIGNOFF <remote-session-id> <MACVAR=value> <CSCRIPT=value> fileref<'filespec'> <NOSCRIPT>; |
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:
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.
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.
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.
Examples |
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 script='noexist.scr';
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 cscript='noexist.scr';
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 COMPLETE.
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:
signoff;
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 |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.