Published on :

Remote SAS Session Management and System Command

This code is also available in: Deutsch Español Français
Attention : This code requires administrator privileges.
The script initially configures the `noxwait` and `noxsync` options to control the behavior of the X statement. It then executes a system command (`X` statement) to launch the SAS© `spawner.exe` executable on a Windows system, which is essential for establishing remote connections. Subsequently, it uses the `signon` statement to establish a connection to a remote SAS© session identified as 'jvc'. The `rsubmit` block submits instructions to the remote session (here, displaying the SAS© version using `%put &sysver`). After remote execution, the local SAS© session version is also displayed, and the remote session is properly terminated with `signoff`.
Data Analysis

Type : AUCUNE


The script does not perform traditional data processing or manipulation. It primarily interacts with the SAS environment (local and remote) and the operating system via system commands.

1 Code Block
COMMANDE SYSTÈME / OPTIONS
Explanation :
This block configures the `noxwait` and `noxsync` options to disable system command waiting and synchronization. Then, the `X` command is used to execute an external program (`spawner.exe`) from the Windows operating system. This is typical for administrative tasks managing the SAS/CONNECT environment.
Copied!
1options noxwait noxsync ;
2x '"C:\Program Files\SAS Institute\SAS\V8\spawner.exe" -comamid tcp' ;
3 
2 Code Block
SAS/CONNECT
Explanation :
This block manages a remote SAS session via SAS/CONNECT. `signon jvc` establishes a connection to a remote session named 'jvc'. The code within `rsubmit ... endrsubmit` is executed on the remote session to display its version (`&sysver`). After remote execution, the local version is displayed. Finally, `signoff` terminates the connection to the remote session, freeing up resources.
Copied!
1signon jvc;
2rsubmit ;
3 %put REMOTE: &sysver;
4endrsubmit ;
5%put LOCAL: &sysver;
6signoff ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Banner
Expert Advice
Expert
Simon
Expert SAS et fondateur.
« The choice of noxwait and noxsync is critical here. These options allow SAS to launch spawner.exe in the background and immediately proceed to the next line of code. Without them, your SAS session would hang indefinitely waiting for the spawner to close, making the subsequent SIGNON impossible. »