Enterprise Guide - Macro in column name

Reply
Occasional Contributor
Posts: 6

Enterprise Guide - Macro in column name

Hello,

I want to know if its possible to include a macro variable into a column name in enterprise guide when using query builder. I have tried it and it does not resolve.

I know its possible via sql code.

Example

proc sql;

     select column_1 as test_&rep_date

     from work.table1;

run;

The sql generated by the query builder is as below:

proc sql;

     select column_1 as 'test_&rep_date'n

     from work.table1;

run;

Any help would be appreciated.

Super User
Posts: 19,167

Re: Enterprise Guide - Macro in column name

Why are you trying to do this?

Occasional Contributor
Posts: 6

Re: Enterprise Guide - Macro in column name

I have users that use the query builder only. If this is done in sql then they will not be able to maintain it. I can include a program node to do this but if they continue in query builder then the column name will become static and if the macro result changes then the builder will error.

Super User
Posts: 7,446

Re: Enterprise Guide - Macro in column name

The query builder is good for one-off queries. Maintainable code is, well, code.

The helpers in EG are good for getting a starting point, serious work is done in a code window.

At some point your users need to come out of the nursery.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 3 replies
  • 177 views
  • 0 likes
  • 3 in conversation