What @Reeza proposes works in my EG version (7.11) only if changing the table name via Options/Change Button as shown below.
If I just enter the name into the "Output name" field then it get's quoted as name literal and generates code like
CREATE TABLE WORK.'test&test'n AS
Only after the rename via "options" drop-down I'm getting the table name generated without quoting.
CREATE TABLE WORK.test&test AS
First of all thanks for answering so quickly.
I just tried this but I get the following error:
Any clues?
It works in my 7.11 EG version.
Do I have to set up a special condition under the Prompt Manager option or Tools>Options?
Do you think it might be due to the EG version that I have which is earlier than yours?
--
DLP
I've run first the following code for my test.
%let test=myTest;
data test;
set sashelp.class;
run;
Then I've used the query builder as alredy posted.
If this doesn't work for you then I must assume it's caused by an earlier version of SAS EG.
I'm using version 5.1. Could that be the reason it does not work?
I will try calling Tech Support. Any other help on this is deeply appreciated.
Thanks
The solution that @Patrick supplied is creative, but it's a bit of a trick that might be working by accident, and not by design.
As far as I know, there isn't an official method to substitute in a macro value for the output data name in the Query Builder. My suggested workaround would be:
- Create the query to output to a known, static name (ex: work.currentmonth).
- Link a subsequent program node that renames/copies that data set to the name you want, using the macro variable that you supply. You could do this with DATA step or PROC COPY or PROC DATASETS.
Chris
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.