AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Reply
Occasional Contributor
Posts: 13

AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Hi all!

 

I am new to SAS AMO in Excel and I'm trying to run a Stored Process (STP) and get the results back to my spreadsheet. Running the STP works fine but the results not. The error message is that it can't find the server -->

Capture.PNG

 

The VBA code that I'm using:

 

Sub InsertStoredProcess()
  Dim sas As SASExcelAddIn
  Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
  sas.InsertStoredProcess "/Solvens 2 : Verksamheten/Aktuarie/BI Content/ClaesExcelAMO_DEV", Sheet1.Range("A1")

  Dim displayData As SASDataView
 Set displayData = sas.InsertDataFromLibrary("SASApp", "slasklib", "Yalla", Sheet2.Range("A5"), 25, False, "", False)
End Sub

 

(if I use the SASHELP library and dataset CLASS, it works fine)

 

Do I need to define my library in another way? (they are pre-assinged, type "By native library Engine")

 

Anyone knows what I'm doing wrong?

 

(SAS 9.3 M2 and SAS Add-In 7.1)

 

Regards,

Claes

Super User
Posts: 7,422

Re: AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Start Enterprise Guide, use the same credentials you use in the AMO, connect to SASApp and look for library slasklib.

The only thing that comes to mind is that the user used in AMO does not have the same permissions as sassrv (which is most probably used to start the STP server instances)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 13

Re: AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Hi!
Good point, didn't think about this (the user in STP session isn't the same as the user used in AMO).

I shall speak to my DBA,

Thank you very much!
/Claes
Super User
Posts: 7,422

Re: AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Keep in mind that there are possibly three UserIDs in play here:

1) sassrv, a user on the OS level that physically runs the STP server processes

2) the metadata user ID that is used to call the STP; this might even be an internal ID (no OS account assigned)

3) the userid used from the AMO. Since the AMO most probably connects to a non-pooled workspace server, this userID needs to be in metadata and OS

 

1) and 3) need physical access to the path, 2) and 3) need metadata permissions for the library.

2) and 3) might be identical, of course

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 13

Re: AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Excellent, mange tack :-)
Occasional Contributor
Posts: 13

Re: AMO Excel - How do I read table in SAS library and put results back to Excel spreadsheet

Solved!
Spoke to my DBA and he figured it out. The solution was to use the metadata name (library) instead of the its physical name, works like a Dream!
Ask a Question
Discussion stats
  • 5 replies
  • 310 views
  • 0 likes
  • 2 in conversation