Reputation: 8513
How do I select the user
column from my table and not select the surprise 'feature' SAS added to their SQL syntax:
data have;
user = 'huh??';
run;
proc sql ;
select user from have;
quit;
Result:
rob
Bonus, the field name in the result table (if you create one) gets a temporary name... ie. something like _TEM001
.
Upvotes: 3
Views: 567
Reputation: 27516
Use the name literal syntax, '<name>'n
select 'user'n from have;
Name literals in other systems, such as in pass through:
"user"
[user]
Upvotes: 3
Reputation: 8513
You can use column literals to refer specifically to the field name rather than the reserved keyword:
proc sql ;
select 'user'n from have;
quit;
Result:
huh??
Upvotes: 2