Using the SAS RFC Server on Windows

In a Windows environment, the SAS RFC Server for SAP is installed in the !SASROOT\access\sasexe directory.
To start or stop the SAS RFC Server using a command line in the Windows operating environment, use this command:
sasrfc_server [-i n] [-r] [-s] [-k] [-t n] [-d n] [-n name[,desc]] [-p port] 
     [-N namespace] [-V variant] [-help] [-c dialog_compat_port] 
     [-b "-p port-number -V variant_name -R report_name"] 
     [-B number_of_bytes]  
Here are the options for the SAS RFC Server command for Windows.
-i n
installs the program as a Windows service and specifies the start-up option for a new service. Here are the start-up options.
n=2
starts the service automatically
n=3
starts the service on demand
n=4
disables the service
-r
removes the program from the Service Manager.
-s
starts the service.
-k
stops the service
-t n
sets the start-up option for an existing service. Here are the start-up options.
n=2
starts the service automatically
n=3
starts the service on demand
n=4
disables the service.
-d n
specifies the diagnostic level. When you specify the -d n option where n= any number between 1 and 6, the program runs as an application and messages are routed to standard error. Higher diagnostic levels route more detailed messages to standard error.
-n name,desc
specifies the name and description of the service.
-p port
specifies the port number on which the server listens. The default is 6999.
-N namespace
specifies the namespace for ABAP functions and programs that SAS uses. The default is /SAS/. If the ABAP programs are installed in the customer namespace instead of in the /SAS/ namespace, this parameter identifies where the ABAP programs are installed.
-V variant
specifies the R/3 report variant that is assigned to this server. You must assign a report variant for each SAS RFC Server that accesses an R/3 application server in batch mode. The variant parameter G_DEST specifies a unique destination to call back to the SAS RFC Server.
-help
specifies that you want to display command line Help.
-c dialog_compat_port
identifies the option that, when specified, runs the SAS RFC Server in SAS 8 compatibility mode on the port indicated by the dialog_compat_port parameter. The port number for a SAS 9.1 request must be different than the one that was used for the SAS 9 requests. If you omit the -c option, no dialog compatibility is available.
-b“-p port_number [optional] -V variant_name [required] -R report_name” [optional]
enables batch compatibility so that you can process SAS 8 ACCR3 requests while you are using a SAS 9 RFC Server. You must use double quotation marks in the batch compatibility option to separate batch compatibility parameters from SAS 9 parameters that use the same syntax. If you omit the port parameter, the port number defaults to 6999. The report variant parameter must be a valid variant of the report. If you omit the report parameter, the report name defaults to /SAS/ZSASV8COMPAT.
-B number_of_bytes
sets the minimum buffer size for data transfers in batch and dialog modes. The number of bytes should be greater than 10,000 and no more than 8 digits, or it is ignored. If you omit the -B option, the default is 10,000 bytes. In batch mode, if you specify a value for the G_BUFMAX parameter that is less than the value of -B, the -B value is used.
For example, if you want to start the SAS RFC Server with a debug level of 1 on port number 6991, use this command:
sasrfc_server -d 1 -p 6991
To install the SAS RFC Server as a service with automatic start up on port 6991 and use the name test and a description of 'Test RFC Server', use this command:
sasrfc_server -i 2 -n “test,Test RFC Server” -p 6991
To uninstall the server that was started in the previous example, use this command:
sasrfc_server -r -n “test”