Desktop productivity for business analysts and programmers

SASEG from MS Access

Reply
Occasional Contributor
Posts: 11

SASEG from MS Access

I'm looking at using Access as an office automation tool for managing regular reports, Access not being used to hold transaction data but data to do with the reports themselves. We use it to log and manage the requests for data and reports coming into the area.

We run SAS EG 4.1 still (along with a host of other studff compared with which 4.1 is a spring chicken) with SAS on a Unix box. Some of the directories there are mapped to the Windows LAN so the idea as a first stage semi-automation is in the first instance for the Access application to write a parameter text file from which the SAS program can read the parameters and populate its macro variables before getting to the meat of the SAS. It works well and is pretty simple but we still need to open the SAS code in SAS EG, submit the job, wait for it to finish and then exit from SAS.

We have the MS Office Add-in for Office and from Excel I can read the SAS tables on the server in Excel etc but   when I try to run sample code such as Chris's
Script.JPG

it bombs out on the CreateObject line with an ActiveX error, with 4.1 or just 4 as the version number making no difference.

I've seen various specifications regarding what references one must configure to invoke a SAS.

This one is about the minimum but copying what it specifies makes no difference

References.JPG

Using ActiveX2.8 doesn't help and going in and selecting all the SAS the SAS references that dialog box offers does not help either, i.e. as per this example

ReferencesFull.JPG

Any pointers to the missing link would be greatly appreciated.


Script.JPG
Community Manager
Posts: 2,884

SASEG from MS Access

In EG 4.1, the automation model is a bit different. The complete reference information is at:

http://support.sas.com/documentation/onlinedoc/guide/SASEGScripting41.zip

(There is a CHM file in the ZIP archive.  Extract it, then right-click, select Properties, and "unblock" it - else you won't be able to view the content...)

Here is an example VB Script:

Dim prjName
Dim prjObject
Dim app

prjName = "C:\EG 4.1 projects\mailinghtml.egp"    'Project Name
Set app = CreateObject("SASEGObjectModel.Application.4")
Set prjObject = app.Open(prjName,"")
prjObject.Run
' Save the new project results
prjObject.Save
prjObject.Close
app.Quit

First try to create a standalone VBS file and confirm that it runs with cscript.exe or wscript.exe.  If it does, then the equivalent script in VBA should work as well.

Chris

Occasional Contributor
Posts: 11

SASEG from MS Access

VBS first was a good suggestion as the error still occurred with "SASEGObjectModel.Application.4" but the dialog was a bit more informative: Error code 800A01AD. Googling that lead me to searching the registry (its Windows XP Professional at work) and there is no occurrence of "SASEG", let alone that string followed by anything else. There are a few entries commencing with "SAS.EG*" and "SASObjectManager" though. Is there a DLL which needs to be on the machine to support the object model? If there is but it is not there that would be indicative of the need to look elsewhere, or just manually run SASEG and click on the run icon.

Community Manager
Posts: 2,884

SASEG from MS Access

You might try to remedy that issue with this note:

http://support.sas.com/kb/34/194.html

Chris

Ask a Question
Discussion stats
  • 3 replies
  • 485 views
  • 0 likes
  • 2 in conversation