Hi,
I am working on a little VB.NET program to automate some stuff we are doing on a regular basis with SAS EG 5.1. The SAS EG projects contains a process flow that first imports an excel xlsx file into the WORK library and then I run some SAS code on this file.
The VB.NET code looks like this:
Dim app As SAS.EG.Scripting.Application Dim prjObject As SAS.EG.Scripting.Project app = New SAS.EG.Scripting.Application() prjObject = app.Open("Test.egp", "") prjObject.Run()
When I look into the log file of the code I run in the debugger (prjObject.ContainerCollection.Item("Prozessfluss").Items(2).Log.Text) I find the following error:
[...] 41 proc sql; 42 select * 43 from work.test 44 ; ERROR: File WORK.TEST.DATA does not exist. [...]
But I can export the file with the following code:
Dim file As SAS.EG.Scripting.File = prjObject.ContainerCollection.Item("Process Flow").Items("Test.xlsx")
file.Tasks(0).Run()
file.Tasks(0).OutputDatasets(0).SaveAs("C:\temp\test.html")
What's going on here?
No, we ar not running a SAS Grid Computing environment. My solution now is, thanks for your suggestion, to import the file to a permanent library.
Thanks everyone for your help!
I don't speak VB.net but the third snippet of code does not appear to reference a SAS data set. Is the result perhaps SAS Log items or proc output?
Does the TEST.egp have a hard coded reference to read a specific XLSX file? If so I would examine the log for that bit way before the Proc SQL you show.
It looks like the Project.Run() isn't executing the Import Data task -- or the task is creating WORK data in a session that's different than the next step uses. Are you running in a SAS Grid Computing environment, where you might need to target a shared WORK location or permanent library for the data that you import?
No, we ar not running a SAS Grid Computing environment. My solution now is, thanks for your suggestion, to import the file to a permanent library.
Thanks everyone for your help!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.