Desktop productivity for business analysts and programmers

SAS EG4 and vb/vba

Not applicable
Posts: 0

SAS EG4 and vb/vba

Hi guys,

We have some SAS EG programs that deal with data conversion/ manipulation which require some variable parameters e.g. library names and paths of input/output files. I want to create a vb/ asp front end to input these parameters and runs the EG project from this vb front end.

Any ideas how I can do this... I have researched and found some vb examplesி

But I don't know how sas eg takes or reads the parameters as input. Basically how do I feed these parameters/variables into SAS EG to use?

Hope someone can help?
Community Manager
Posts: 3,462

Re: SAS EG4 and vb/vba

Posted in reply to deleted_user
As you probably know, you can add parameters in an EG project and associate them with your SAS programs, queries, and tasks. Once those parameters are in place, you can use the automation interface to discover and assign values for those parameters.

Here is a simple example of scripting an EG project with parameters:
Option Explicit
Dim app
Dim prjName
Dim prjObject
Dim parmList
Dim parm

prjName = "C:\temp\autowithparams.egp" 'Project Name

' start the app and open the project
Set app = CreateObject("SASEGObjectModel.Application.4")
Set prjObject = app.Open(prjName,"")

' discover the parameters
Set parmList = prjObject.Parameters
Wscript.Echo "Project has " & parmList.Count & " parameters."

' work with the first parameter
Set parm = parmList.Item(0)
WScript.Echo parm.Name & " parameter has default value of " & parm.DefaultValue
parm.Value = "M"

WScript.Echo parm.Name & " parameter has been set to value of " & parm.Value

' run the project

WScript.Echo parm.Name & " parameter has been set after Run to value of " & parm.Value


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation