SAS Object Manager Error Reporting

Overview of Error Reporting

If a call succeeds in obtaining an object, then the method returns S_OK. However, there are many reasons an error might occur. Sometimes an error might occur even before the connection attempt is made. Here is an example of such an error:
Requested logical name was not found
Other errors can occur during the connection attempt. Examples include the following:
  • Invalid userid/password
  • Couldn't connect to a SAS server
  • Invalid hostname
  • Server configuration error
Errors can occur even though a successful connection is established. Errors that occur during connection can be reported through the logging mechanism. To enable logging, set the ObjectFactory.LogEnabled property to TRUE. When LogEnabled equals TRUE, both successful and failed connection attempts are recorded in the log. To obtain error information, call GetCreationLog as follows:
ObjectFactory.GetCreationLog(erase,allThreads)
Here are the parameters for GetCreationLog:
erase
indicates whether to erase all of the accumulated logging information. Values are TRUE or FALSE.
allThreads
indicates the threads for which to obtain connectionAttempts log information. Here are values for the allThreads parameter:
FALSE
Obtain log information for your current thread.
TRUE
Obtain log information for all threads in the process.

Error XML

The error information returned through XML allows applications to fix detected problems. Applications can be used to fix these errors by parsing the XML and possibly providing a user interface or sending a message to an administrator to have the errors fixed.
The following example is an output from GetCreationLog. The first attempt establishes an IOM Bridge connection to the SAS Metadata Server, and the second attempt establishes a COM connection to a workspace server. Note that the sasport and sasmachinednsname are not reported for COM connections.
<connectionAttempts>
<connectionAttempt>
<description>Connected.</description>
<status>0x0</status>
<saslogin>myDomain\myLogin</saslogin>
<sasmachinednsname>myMachine</sasmachinednsname>
<sasport>1235</sasport>
<sasclassid>2887E7D7-4780-11D4-879F-00C04F38F0DB</sasclassid>
<sasprogid>SASOMI.OMI.1</sasprogid>
<sasserver>SAS Metadata Server</sasserver>
<threadid>3324</threadid>
<name>OMR</name>
</connectionAttempt>
<connectionAttempt>
<description>Connected.</description>
<status>0x0</status>
<saslogin></saslogin>
<sasmachinednsname>myOtherMachine</sasmachinednsname>
<sasclassid>440196D4-90F0-11D0-9F41-00A024BB830C</sasclassid>
<sasprogid>SAS.Workspace.1</sasprogid>
<sasserver>myOtherMachineCOM - Workspace Server</sasserver>
<threadid>3324</threadid>
</connectionAttempt>
</connectionAttempts>
The following error message shows a failed IOM Bridge connection attempt. Note that the port number, machine name, and login are listed for IOM Bridge connections.
<connectionAttempts>
<connectionAttempt>
<description>Could not establish a connection to the SAS server on
the requested machine. Verify that the SAS server has been
started with the -objectserver option or that the SAS
spawner has been started. Verify that the port Combridge is
attempting to connect to is the same as the port SAS (or the
spawner) is listening on./description>
<status>0x8004274d/status>
<saslogin>Username/saslogin>
<sasmachinednsname>machineName/sasmachinednsname>
<sasport>1234/sasport>
<sasclassid>440196D4-90F0-11D0-9F41-00A024BB830C/sasclassid>
<sasprogid>SAS.Workspace.1/sasprogid>
<sasserver>myWorkspace - Workspace Server/sasserver>
<threadid>3324/threadid>
</connectionAttempt>
</connectionAttempts>