Macro- creating a table name with two macro variables

Reply
New Contributor
Posts: 2

Macro- creating a table name with two macro variables

Hi,

 

Here is the first part of a macro I’m trying to create. However I get an error trying to run the &a._&b part i.e. create a table in WORK. Can someone let me know what is going on? What am I missing? I’ve never created SAS macros before so this all new to me.  

 

Thank you

 

%macro xyz(a,b);

PROC SQL;

   CREATE TABLE &a._&b AS

   SELECT DISTINCT t1.&b,

New Contributor
Posts: 2

Re: Macro- creating a table name with two macro variables

Apologies.  I've solved this. 

Grand Advisor
Posts: 17,342

Re: Macro- creating a table name with two macro variables

Perhaps post the solution, but please mark it solved as well Smiley Happy

Esteemed Advisor
Posts: 5,198

Re: Macro- creating a table name with two macro variables

I guess that the solution is to have double periods after the &a. A single period is being eated by the macro variable resolution.
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 251 views
  • 0 likes
  • 3 in conversation