SAS RFC Server on Windows

Overview

In a Windows environment, the SAS RFC Server and the Unicode SAS RFC Server are installed in the !SASROOT\access\sasexe directory.

Starting and Stopping the SAS RFC Server

To start or stop the SAS RFC Server using a command line in the Windows environment, use the sassfc_server command. The command syntax follows:
sasrfc_server [-i n] [-r] [-s] [-k] [-t n] [-d n] [-n name[,desc]] [-p port_number] [-V variant] [-help] [-c dialog_compat_port] [-b "-p port_number -V variant_name -R report_name"] [-B number_of_bytes] [-S "-a program_id -g gateway_host -x gateway_service"]

Starting and Stopping the Unicode SAS RFC Server

To start or stop the Unicode SAS RFC Server using a command line in the Windows environment, use the sasrfc_serveru command. Note that the Unicode SAS RFC Server is used to access Unicode SAP Systems, and it cannot be used to access non-Unicode SAP Systems. The command syntax follows:
sasrfc_serveru [-i n] [-r] [-s] [-k] [-t n] [-d n] [-n name[,desc]] [-p port_number] [-V variant] [-help] [-c dialog_compat_port] [-b "-p port_number -V variant_name -R report_name"] [-B number_of_bytes] [-S "-a program_id -g gateway_host -x gateway_service"]

Command Parameters

The parameters for the SAS RFC Server command and the options for the Unicode SAS RFC Server for Windows are as follows:
-i n
installs the program as a Windows service and specifies the startup option for a new service. Startup options are as follows:
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 startup option for an existing service. Startup options are as follows:
n=2
starts the service automatically.
n=3
starts the service on demand.
n=4
disables the service.
-d n
causes the program to run as a normal command line program and 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. Note that if you are running sasrfc_server as a service, the server sends error messages (and other informational messages) to the Windows Event Log. You can view the log by using the Windows Event Viewer.
-n name,description
specifies the name and description of the service.
-p port_number
specifies the port number on which the server listens. The default port number is 6999.
-V variant
specifies the report variant that is assigned to this server. You must assign a report variant for each SAS RFC Server that accesses an SAP 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 must be different than the one used for the SAS 9 requests. If the -c option is omitted, no dialog compatibility will be available.
-b "-p port_number -V variant_name -R report_name"
enables batch compatibility so that you can process SAS 8 ACCR3 requests while you are using a SAS 9 SAS RFC Server. You must use the double quotation marks in the batch compatibility option to separate the batch compatibility parameters from the SAS 9 parameters that use the same syntax. The port parameter is optional. If you omit it, the port number defaults to 6995. The report variant parameter is required and must be a valid variant of the report. The report parameter is optional and is usually omitted. If you omit the report parameter, then report_name defaults to /SAS/ZSASV8BCOMPAT. The values in port_number, variant_name, and report_name must be different from the values used by SAS 9 and different from the values used by dialog compatibility.
-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 10000 and no more than eight digits or it will be ignored. If the -B option is omitted, the default is 10000 bytes. If you specify a value for the G_BUFMAX parameter that is less than the value of -B in batch mode, then the -B value is used.
-S "-a program_id -g gateway_host -x gateway_service"
permanently registers the SAS RFC Server at an SAP gateway. You must specify the -S option to use the SAS RFC Monitor in the SAP NetWeaver Portal. The option enables the server to receive requests for information from the SAS RFC Server Monitor through a remote function call that uses an SM59 destination. To register the server at more than one gateway, specify the -S option multiple times.
-a program_id
the program_id that you specify must match the program ID that you assign in the SM59 destination of type registration. The destination that you use must not be the same as other destinations that are used for batch extractions.
-g gateway_host
A valid SAP gateway host.
-x gateway_service
A valid SAP service.

Examples

For example, if you want to start the SAS RFC Server with a debug level of 1 on port number 6991, use the command below. Note that the following examples also work using the Unicode server command sasrfc_serveru.
sasrfc_server -d 1 -p 6991
To install the SAS RFC Server as a service with automatic startup on port 6991 using the name test and a description of 'Test SAS RFC server', use the following command:
sasrfc_server -i 2 -n "test,Test SAS RFC server" -p 6991
To uninstall the server that was started in the previous example, use the following command:
sasrfc_server -r -n "test"