zhuoer
zhuoer

Reputation: 617

SAS macro error

I submit the following program

%let col1 = dept; %let data = company; proc sql; select * from &data, employee where &data.&col1 = employee.name; quit;

And I get this error:

ERROR: The following columns were not found in the contributing tables: companydept.

What caused such error?

Upvotes: 1

Views: 552

Answers (1)

cmjohns
cmjohns

Reputation: 4475

The first period after the macro variable is used as a macro delimiter. You need to add another period like this.

&data..&col1 =

Upvotes: 3

Related Questions