BookmarkSubscribeRSS Feed
nrose
Quartz | Level 8

Hi,

Is it possible to pass macro variable values that are present during a SAS Enterprise Guide session to a stored process that is run in that session? In other words, I don’t want to pass parameters manually into a stored process using prompts, but automatically using macro variables that exist within the SAS EG session from which it is run by the user?

Thanks,

Nick

3 REPLIES 3
Patrick
Opal | Level 21

Couldn't you just set up hidden prompts and then use the macro variables as parameter values?

nrose
Quartz | Level 8

Thanks Patrick,

I have tried that, but it appears that when you run a stored process, it spawns a new SAS session, which is seperate from the SAS EG session from which it is run. Therefore, macro variables within the SAS EG session are not passed to the stored process.

Therefore, my impression is that there is no way to automatically pass macro variable or other values from a SAS session to a stored process unless entered by a user from a prompt or, unless proc STP is used from a SAS program, which doesn't really solve my problem. Is this correct, or am I missing something?

Nick

Patrick
Opal | Level 21

I believe you are correct.

What you could try to do is to create a text file or a SAS dataset with these key/value pairs (eg. as part of an autoexec) which is also accessible via the stored process server - and then use these information in your code.

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
  • 915 views
  • 0 likes
  • 2 in conversation