Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a workspace session using SAS IOM & VBA

Tags:

vba

sas

I am trying to connect to a workspace server using Excel VBA. Using the information on this page, I have produced the following:

Dim obSAS As SAS.Workspace
Dim obWorkspaceManager As New SASWorkspaceManager.WorkspaceManager
Private Sub Form_Load()
   Dim obConnection As New ADODB.Connection
   Dim obRecordSet As New ADODB.Recordset
   Dim obServerDef As New SASWorkspaceManager.ServerDef
   Dim xmlString As String
   obServerDef.Port = 28561
   obServerDef.Protocol = ProtocolBridge 
   obServerDef.MachineDNSName = "blah.server.com"
   Set obSAS = obWorkspaceManager.Workspaces.CreateWorkspaceByServer( "Ref", _
      VisibilityProcess, obServerDef, "me@saspw","MyPass", xmlStr)
end sub

My first response was this:

<xml id="combridgeOutput"><connectionAttempts><connectionAttempt>
  <sasserver></sasserver>
  <sasmachinednsname>blah.server.com</sasmachinednsname>
  <sasport>28561</sasport>
  <saslogin>me@saspw</saslogin>
  <status>0x80041001</status>
  <description><Exceptions><Exception>
  <SASMessage severity="Error">
    The client has connected to a SAS (9.2) Metadata Server (v1.0) when 
    it intended to connect to a SAS Workspace Server.
  </SASMessage>
  </Exception></Exceptions></description>
</connectionAttempt></connectionAttempts></xml>

So I updated the port number to point at the workspace server, and now I get this:

  <same XML tags as above >
  <SASMessage severity="Error">
    Client me@saspw does not have permission to use server 
    SASMeta - Workspace Server (A5DPDN69.AV000069).
  </SASMessage>

Would rather not set special permissions for this exercise. How else can one connect VBA to a SAS workspace server session?

like image 986
Allan Bowe Avatar asked Oct 22 '22 00:10

Allan Bowe


1 Answers

Doh! I was using the wrong machine name. For reference, here is the process for getting the correct machine name!

  1. Log into SMC
  2. Expand Server Manager
  3. Expand SASApp
  4. Expand SASApp - Logical Workspace Server

There you will see the correct machine, and will also show the port details..

like image 51
Allan Bowe Avatar answered Oct 30 '22 14:10

Allan Bowe