BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mbunse
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
mbunse
Obsidian | Level 7

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!

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

ChrisHemedinger
Community Manager

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?

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
mbunse
Obsidian | Level 7

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!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3035 views
  • 0 likes
  • 3 in conversation