BookmarkSubscribeRSS Feed
Ricardo_Neves
Obsidian | Level 7

Hi,

 

I'm using prompts to define some variables to use in a SAS EG project. I managed to configure them to show on every program I need.

 

One of those prompts ('camp') is a text where I list a number of IDs separated by spaces that will then be used as input for a macro function.

 

I sometimes change the values of the macro variable 'camp' using code on a program but when I run other program that uses the same prompt, the default value it shows is the value I entered and not the value stored in the macro variable. Is there a way to change the default value of the prompt when I change the macro variable value using code?

 

Thanks,

 

RN

5 REPLIES 5
lethcons
Obsidian | Level 7

I don't think so. The prompt sets the initial value of the macro variable, but the macro variable does not set the initial value of the prompt. If there is a way I've never seen it.

tomrvincent
Rhodochrosite | Level 12

sure.  set it as a %global variable and, after you change the value, the next time you run a program that prompts for it you'll see the new value.

lethcons
Obsidian | Level 7

I don't think that's correct. The value in the prompt is what was most recently set in the prompt, it does not get the value from a global macro variable.

Ricardo_Neves
Obsidian | Level 7
The prompt shows the default value we define. I'm guessing that when I run a program and set a different value it change the definitions of the prompt for that session so every time I run a program that calls the same prompt it shows the last inserted value. I read somewhere that it is possible to right a program that changes the definitions of the prompt but I couldn't find anything on how to do it.
I even tried looking at the log to see if I could find how the system is doing it, but I don't think it is there.
tomrvincent
Rhodochrosite | Level 12

I do it regularly...it works just fine.  You just can't set the value before the prompt screen comes up the first time.

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
  • 5 replies
  • 2251 views
  • 1 like
  • 3 in conversation