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?

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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