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. Here is the command syntax:
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. You use the Unicode SAS RFC Server to access Unicode SAP systems; you cannot use it to access non-Unicode SAP systems. Here is the command syntax:
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

Here are the parameters for the SAS RFC Server command and the options for the Unicode SAS RFC Server 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 and causes the program to run as a normal command-line program. 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. If you are running sasrfc_server as a service, the server sends error 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 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 from the one that is used for the SAS 9 requests. If the -c option is omitted, no dialog compatibility is 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, report_name defaults to /SAS/ZSASV8BCOMPAT. The values in port_number, variant_name, and report_name must be different from the values that SAS 9 and dialog compatibility use.
-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 eight digits or it is ignored. If you omit this option, the default is 10,000 bytes. If you specify a value for the G_BUFMAX parameter that is less than the value of -B in batch mode, 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 this option to use the SAS RFC Monitor in the SAP NetWeaver Portal. It 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 this 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

Examples in this section also work using the sasrfc_serveru Unicode server command.
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 using the name test and a description of 'Test SAS RFC Server', use this 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 this command:
sasrfc_server -r -n "test"