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
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.
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.