- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can.
No, you shouldn't. Simply because using name literals is an unnecessary PITA. Put fancy wordings in labels, where they belong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!