![]() | ![]() | ![]() | ![]() |
When you use the SAS Stored Process Server to run a SAS Stored Process, the process ID and port number for a SAS Stored Process Server can be helpful. For example, this information could be used to monitor the SAS Stored Process Server processes if one process is not working correctly.
The stp_info.sas sample SAS Stored Process code provides information about the process ID and more for the SAS Stored Process Server. See the Full Code tab above for this sample code. When you run this SAS Stored Process code multiple times, you can find information about all of the SAS Stored Process Server processes that are running.
As an alternative to using Task Manager to list Windows processes, type the following command at the MS-DOS command prompt to list the processes that are running under the sassrv user account:
tasklist /v /fi "USERNAME eq sassrv"
The following DOS command can be used to list all processes that are running the sas.exe image:
tasklist /v /fi "IMAGENAME eq sas.exe"
Under Windows, the following command can be used to find the process ID that is associated with a specific port number and to find the state of the port:
netstat -nao | find "8611"
In the example above, replace 8611 with the port number that you want to find.
The following command can be used to find the port number that is associated with a specific process ID:
netstat -nao | find "process-id"
In the example above, replace process-id with the process ID.
For sample code of the netstat command, see stp_port_check.bat on the Full Code tab above. In SAS 9.2, this sample code retrieves a blank value because of the logging facility used for the SAS Stored Process Server.
In UNIX environments, the following command can be used to identify SAS Stored Process Server processes:
ps -ef | grep sassrv
| Product Family | Product | System | SAS Release | |
| Reported | Fixed* | |||
| SAS System | SAS Integration Technologies | 64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |
| 64-bit Enabled AIX | 9.1 TS1M3 SP4 | |||
| Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |||
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |||
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |||
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |||
| Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |||
| Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |||
| Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |||
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |||
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |||
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |||
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |||
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |||
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |||
| z/OS | 9.1 TS1M3 SP4 | |||
| 64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |||
| HP-UX IPF | 9.1 TS1M3 SP4 | |||
| Linux | 9.1 TS1M3 SP4 | |||
| Linux on Itanium | 9.1 TS1M3 SP4 | |||
| Solaris for x64 | 9.1 TS1M3 SP4 | |||
| Tru64 UNIX | 9.1 TS1M3 SP4 | |||
| Microsoft® Windows® for x64 | 9.2 TS2M0 | |||
| Microsoft Windows Server 2003 for x64 | 9.2 TS2M0 | |||
| Microsoft Windows Server 2008 for x64 | 9.2 TS2M0 | |||
| Windows Vista | 9.2 TS2M0 | |||
| Windows Vista for x64 | 9.2 TS2M0 | |||
| Linux for x64 | 9.2 TS2M0 | |||
The first sample code is stp_info.sas, which provides information about the process ID and more for the SAS Stored Process Server. The second sample code is stp_port_check.bat, which displays the states of the ports that are running and the process ID for each port.
Name: stp_info.sas
data _null_;
stp_log=getoption('log');
pid = symget('sysjobid');
workdir = pathname('WORK');
file _webout ;
put '<HTML>';
put '<h3>Stored Process Server Information</h3>';
put '<h3>About the STP Server process on which this request was executed.</h3>';
put '<ul>';
put '<li><p><strong>PID is: ' pid '</strong>';
put '<li><p><strong>Log file: ' stp_log '</strong>';
put '<p><strong>NOTE: The log file contains information about the PORT Number'
' on which the STP Server process is running</strong>';
put '<li><p><strong>WORK Directory: ' workdir '</strong>';
put '</ul>';
put '</HTML>';
run;
NAME: stp_port_check.bat
This script displays the states of the ports that the SAS Stored Process Server
processes are using. It also displays the process ID that is associated
with each port.
rem /---------------------------------------------------
rem | NAME: stp_port_check.bat
rem |
rem | This script displays the states of the ports
rem | that the SAS Stored Process Server processes are
rem | using (ports 8611, 8621 and 8631).
rem | It also displays the Process ID that is associated
rem | each port.
rem \---------------------------------------------------
netstat -nao | find "8611"
netstat -nao | find "8621"
netstat -nao | find "8631"
pause
| Type: | Usage Note |
| Priority: |
| Date Modified: | 2010-10-07 11:46:12 |
| Date Created: | 2010-07-13 13:49:59 |



