Hi,
I'm using Enterprise Guide 7.1 (16 bit) and would like to change VARIABLE_NAME to VARIABLE NAME.
The reason is that I have reports in Visual Analytics that are using tables imported from Excel. I'm currently trying to replace the Excel tables with tables created in SAS.
Right now I'm expecting that I'm going to have to use underscores and then manually point all of the new variables to the tables in those reports that currently use variables with spaces. I'd like to avoid this if possible.
Thanks!
Okay, I have it figured out. It was pretty simple. I was missing a semicolon and thought I was having a syntax issue.
Code:
Rename VARIABLE_NAME = 'VARIABLE NAME'n;
As stated in the replies, this is not good practice. However, my SAS Visual Analytics dashboard is already utilizing variable names with spaces, and it'll be too much work to go through the effort of renaming all of them in the dashboard.
I plan to do this as a final step in my code in order to rename all of the variables to match the tables already used in my dashboards so that I can replace them seamlessly.
Thanks!
Yes, you can, but .....
From that point forward you will have to refer to the variable as "Variable Name"n. That's a little clumsy. Is it worth the effort?
Agreeing with @Astounding, and adding that you want to use labels in the case where you need a "nice" appearance to your results, you don't want variable names to be used for that purpose.
Thanks Paige. If I under understand things correctly, labels would only effect a SAS output like proc print, or some other way to maybe look at a report through Web Report Studio. Instead I'm viewing everything in SAS Visual Analytics, which would, I *think* be reading the variable names, not the labels.
In the future when I'm doing more and more SAS coding, I believe it makes sense to use variables without spaces and then later rename then in SAS VA rather than in the code.
I was thinking of doing it on as a final step.
ie Write my code, and then before the final output table change the variable names where needed. This will save me probably a day of work on my dashboards.
So how do I rename them?
@BarryP wrote:
I was thinking of doing it on as a final step.
ie Write my code, and then before the final output table change the variable names where needed. This will save me probably a day of work on my dashboards.
So how do I rename them?
rename name_with_underlines = 'name without underlines'n;
Similar for the rename dataset option.
Yes, you can.
No, you shouldn't. Simply because using name literals is an unnecessary PITA. Put fancy wordings in labels, where they belong.
Okay, I have it figured out. It was pretty simple. I was missing a semicolon and thought I was having a syntax issue.
Code:
Rename VARIABLE_NAME = 'VARIABLE NAME'n;
As stated in the replies, this is not good practice. However, my SAS Visual Analytics dashboard is already utilizing variable names with spaces, and it'll be too much work to go through the effort of renaming all of them in the dashboard.
I plan to do this as a final step in my code in order to rename all of the variables to match the tables already used in my dashboards so that I can replace them seamlessly.
Thanks!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.