Contents Developing Windows Clients  

HostSystem Object

The server on which this SAS Workspace is running.

HostSystem Full Description

Attributes

Parent Property
Extensions Property
DNSName Property

Methods

GetInfo Method
GetEnv Method
ServerTime Method

Enumerations

SoftwareInfoIndex Enumeration
HardwareInfoIndex Enumeration

Description

SAS Workspaces may be local or remote. When remote, they may run on many different types of servers such as Windows NT, UNIX and IBM OS/390. This object gives access to the server on which this SAS Workspace is running. It provides information about hardware and system software. In the future, it will also support extensions that vary based on the type of host.



Readonly Property Parent

The parent of this object.

Type: Utilities

Description

The Utilities object that is the parent of this object.

Example

Usage


Readonly Property Extensions

Host-specific extensions to the SAS Workspace. May be unimplemented.

Type: Object

Description

This property provides access to host-specific interfaces on the server. Accessing this property will return an "unimplemented" failure if a particular host does not have any extensions.

Example

Usage


Readonly Property DNSName

TCP/IP host name of the server.

Type: String

Description

The TCP/IP Domain Name System host name of the server.

Example: marketing.xyz.com

Example

Dim obHost as SAS.HostSystem
Debug.Print "Host name is: " & obHost.DNSName
Here is some sample output:
Host name is: lgnsrv24.xyz.com

Usage


Method GetInfo

Get information about the host system.

Description

This method returns details about the host on which the SAS Workspace is running. It returns two arrays of strings that describe the server.

Usage

Parameters

Name Direction Type Description
softwareInfo  out  String(index)  An array of strings containing information about the server on which the Workspace is running. If the information is not available or meaningful for a given host, an empty string is returned. The SoftwareInfoIndex contains an enumeration constant for the index of each slot in the array.  
hardwareInfo  out  String(row,col)  A two dimensional array of strings. The rows represent processors in the server configuration. The columns represent information fields describing those processors. The HardwareInfoIndex contains an enumeration constant for the index of each column. When the information is not available or meaningful, an empty string is returned.  

Example

Public Sub hsysex()
Dim obWSMgr As New SASWorkspaceManager.WorkspaceManager
Dim obWS As SAS.Workspace
Dim errString As String
Dim obHost As SAS.HostSystem
Dim sysItems() As String, processorItems() As String
Dim sasverDesc As String, OSDesc As String
Dim jobDesc As String
Dim CPUDesc() As String
Set obWS = obWSMgr.Workspaces.CreateWorkspaceByServer("My workspace", VisibilityNone, Nothing, "", "", errString)
Set obHost = obWS.Utilities.HostSystem
obHost.GetInfo sysItems, processorItems
sasverDesc = "SAS Version: " & sysItems(HostSystemSoftwareInfoIndexSASSupervisorVersion)
OSDesc = "OS: [" & sysItems(HostSystemSoftwareInfoIndexOSFamily)
OSDesc = OSDesc & " " & sysItems(HostSystemSoftwareInfoIndexOSName)
OSDesc = OSDesc & " " & sysItems(HostSystemSoftwareInfoIndexOSVersion) & "]"
jobDesc = "Server UserID: " & sysItems(HostSystemSoftwareInfoIndexServerUserID)
jobDesc = jobDesc & "   Client UserID: " & sysItems(HostSystemSoftwareInfoIndexClientUserID)
jobDesc = jobDesc & "   Job or Process: " & sysItems(HostSystemSoftwareInfoIndexJobOrProcessID)
Dim nProc As Integer, i As Integer
maxProc = UBound(processorItems, 1) ' Determine number of rows (=number of CPUs)
ReDim CPUDesc(maxProc)
For i = 0 To maxProc
   ' Fix subscript order on next three stmts
   CPUDesc(i) = "CPU " & Str(i) & "==> "
   CPUDesc(i) = CPUDesc(i) & "  ModelName: " & processorItems(i, HostSystemMachineInfoIndexHardwareModelName)
   CPUDesc(i) = CPUDesc(i) & "  ModelNumber: " & processorItems(i, HostSystemMachineInfoIndexHardwareModelNum)
   CPUDesc(i) = CPUDesc(i) & "  SerialNumber: " & processorItems(i, HostSystemMachineInfoIndexHardwareSerialNumber)
Next i
obWS.Close
Debug.Print sasverDesc
Debug.Print OSDesc
Debug.Print jobDesc
For Each cpuLine In CPUDesc
   Debug.Print cpuLine
Next cpuLine
End Sub
Here is the output of this program from an NT workstation.
SAS Version: 8.00.00B1D051399
OS: [WIN WIN_NT ]
User Name: user23   Job or Process: 219
CPU  0==>   ModelName:   ModelNumber:   SerialNumber:
Here is the output of this program when modified to invoke an HP UNIX server:
SAS Version: 8.00.00B1D051299
OS: [HP 800 HP-UX B.10.20]
User Name: user23   Job or Process: 25898
CPU  0==>   ModelName: HP  ModelNumber: 9000/782  SerialNumber: 2004437611

See Also


Method GetEnv

Get a host environment variable.

Description

Fetch value of host environment variable. See the host documentation for the meaning of "environment variable" on each type of host.

Usage

Parameters

Name Direction Type Description
variable  in  String  The environment variable name.  
value  out  String  If found, the variable's value. If not found, an empty string.  

Returns Boolean

Returns True if the environment variable was found or False if it was not found.

Example

Dim obWS as SAS.Workspace
Dim obHost as SAS.HostSystem
Dim homeval As String
' obtain a workspace in obWS
set obHost = obWS.Utilities.HostSystem
If obHost.GetEnv("HOME", homeval) Then
   Debug.Print "HOME set to: " & homeval
Else
   Debug.Print "HOME is not defined"
End If
Here is some sample output for a UNIX server:
HOME set to: /nfs/fs1.xyz.com/vol/vol1/u/user23

See Also


Method ServerTime

Get Greenwich Mean Time and server local time.

Description

Usage

Parameters

Name Direction Type Description
GMT  out  Date  Greenwich Mean Time  
serverLocal  out  Date  Server local time  

Example

Dim obWS as SAS.Workspace
Dim obHost as SAS.HostSystem
Dim homeval As String
Dim gmt as Date
Dim localTime as Date
' obtain a workspace in obWS
set obHost = obWS.Utilities.HostSystem
obHost.ServerTime gmt, localTime

See Also


Enum SoftwareInfoIndex

Provides constants that identify slots in an array of system information strings.

Description

This enumeration provides named constants for the slots in the GetInfo::softwareInfo array parameter that is returned by the GetInfo method.

Usage

Member Description
SoftwareInfoIndexSASVersion   
SoftwareInfoIndexSASVersionLong  This slot describes the version number of the SAS Supervisor. This version number identifies both the release and the particular build of the SAS System that is running on the server. Build version information is helpful for problem determination by SAS Technical Support.

Example: "8.00.00P1D02298"

The SYSVLONG macro is the SAS language equivalent.  

SoftwareInfoIndexOSName  This slot contains a specific operating system name for the server.

Example: "OS/390"

The SYSSCPL macro is the SAS language equivalent.  

SoftwareInfoIndexOSFamily  This slot contains a generic operating system name for the server.

Example: "OS"

The SYSSCP macro is the SAS language equivalent.  

SoftwareInfoIndexOSVersion  The string in this slot is a version number for the operating system. The format of the string depends on the operating system.

Example: "V02R04M00"  

SoftwareInfoIndexJobOrProcessID  This slot contains an operating system-specific identifier for the process, job or address-space in which the SAS System is executing.

Example: "APPCM3"

The SYSJOBID macro is the SAS language equivalent.  

SoftwareInfoIndexServerUserID  This slot contains the operating system user name under which the SAS server is executing.

Example: "USER05"

The SYSUSERID macro is the SAS language equivalent.  

SoftwareInfoIndexClientUserID  The operating system user name of the client.  
SoftwareInfoIndexNumIndices  The number of slots in the GetInfo::softwareInfo array output parameter.  


Enum HardwareInfoIndex

Named constants for slots in an array of processor information strings.

Description

This enumeration provides named constants for the columns in the GetInfo::softwareInfo two-dimensional array parameter that is returned by the GetInfo call. The rows represent the processors of the host machine on which the SAS System is executing.

Usage

Member Description
HardwareInfoIndexModelName  This column contains the hardware model name of each processor in the server computer. If the server has multiple processors, they are very likely to have the same model name. The format of this name will vary by hardware vendor.

Example: IBM  

HardwareInfoIndexModelNumber  This column contains the hardware model identifier for each processor in the server computer. If the server has multiple processors, they are very likely to have the same model number. The format of this identifier will vary by hardware vendor.

Example: 9672  

HardwareInfoIndexSerialNumber  This column contains the hardware serial number for each processor in the the server computer. The format of this identifier will vary by hardware vendor.

Example: 001111  

HardwareInfoIndexNumIndices  The number of columns in the GetInfo::hardwareInfo array output parameter.  

Contents Developing Windows Clients