BookmarkSubscribeRSS Feed
Jay
Calcite | Level 5 Jay
Calcite | Level 5
The first step of a project is to subset the data using the query builder and a macro variable (term_code_key) built using the prompt manage. The macro resolves in the query builder and works fine.

In subsequent programs I wanted to use the macro to label the output data i.e.
Title1 "&term_code_key";

however this returns a warning: Apparent symbolic reference TERM_CODE_KEY not resolved.

How do you, or can you, use a macro created in the prompt manager in subsequent code with out prompting for the same information again?

I did note in the log of the original query this tell tale note: %SYMDEL Term_code_Key;
6 REPLIES 6
Patrick
Opal | Level 21
Is this EG 4.1 or 4.2 (SAS 9.1 or 9,2)?

For EG 4.2:
I've seen the %symdel in the log as well and couldn't find a way to prevent EG to add this deletion of the macro var.

The "work around" which worked:
- Add a program node before your query.
- Add the prompt to the program node (I called it "Test").
- Create in the program node code like: %let retainTest=&Test;
- In the Query builder use &retainTest (not as prompt value) instead of &Test

HTH
Patrick
Jay
Calcite | Level 5 Jay
Calcite | Level 5
It is EG 4.2

The problem with the "work-around" is that it removes the "interactive" nature of using the prompt....

But, I haven't found any solution either...
RichardH_sas
SAS Employee
Check out the following note about the problem:

http://support.sas.com/kb/36/020.html

As it mentions, the workaround is to right-click on each task/code you want to use the prompt, select Properties, then manually add the prompt in the prompt pane.

I believe the next version of EG will let you choose whether those %symdel statements get generated. Turning them off is a pretty common request in EG 4.2.
Jay
Calcite | Level 5 Jay
Calcite | Level 5
That works - Thanks Richard !
Patrick
Opal | Level 21
I don't get it!
Is the user now prompted several times for the same value?
Jay
Calcite | Level 5 Jay
Calcite | Level 5
It depends....
The results of some quick testing, after setting up the prompts the way Richard described, this is what I saw:

1) If it's run from an ordered list or the top of the process flow: I was prompted once for the macros (there were three in this project) at the very start and the macros were used and resolved in all of the other nodes without further prompts.

2) If I ran the project "node by node" manually, it will put a prompt up in every node that uses one of the macros.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1322 views
  • 0 likes
  • 3 in conversation