- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
With the system option VALIDVARNAME=ANY, which of the following variable
names is valid?
a. 4BirthDate
b. $Cost
c. Tax-Rate
d. all of the above
The answer is 'd' but i cannot use A as a variable name and the rules don't state that a number can be included.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what guide book you mean. It's clearly mentioned in the SAS documentation.
Any time you have a variable that doesn't comply with the SAS variable naming rules, you need VALIDVARNAME=ANY and then enclose the variable name in quotes and follow it with the letter N.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can't use it?
Did you enclose the variable names in quotes and follow it with the letter N? These won't work unless you do that.
If that's not it, then show us the LOG (all of it) so we can see what you did and what the error message is. Please copy the log as text and paste it into the window that appears when you click on the </> icon. DO NOT SKIP THE PART IN RED.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
not sure what you mean by window with </> icon, but here's the log:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The </> icon is in the row of icons immediately above where you type your text. Please re-post your log following the instructions.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok, so I tried it with quotation marks and the n. BUT, what I'm wondering is why the guide doesn't book doesn't even mention this...
Also it doesn't mention we can use numbers so I'm confused if by the word characters that includes numbers?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what guide book you mean. It's clearly mentioned in the SAS documentation.
Any time you have a variable that doesn't comply with the SAS variable naming rules, you need VALIDVARNAME=ANY and then enclose the variable name in quotes and follow it with the letter N.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It's the prep guide for the exam.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Could you please provide a URL or exact name of this guide?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS Certified Specialist Prep Guide
(subtitle) Base Programming Using SAS 9.4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't have this book. So I can't answer any questions about it.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@jaliu wrote:
SAS Certified Specialist Prep Guide
(subtitle) Base Programming Using SAS 9.4
This book? https://sasinstitute.redshelf.com/book/1830659
Did you check the errata page? https://support.sas.com/content/dam/SAS/support/en/books/errata-base-certified.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
No, but thank you for pointing this out. I couldn't get the practice data to load and i'm surprised they made such an egregious mistake with the instructions in the published book.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also here is where i really dislike the exam questions. I know it doesn't apply to this questions, but if there were no all of the above choice I would have thought that the options needed the quotation marks and n in order to be valid names. Maybe it's not technically asking for syntax, but I could easily see the question being unclear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@jaliu wrote:
Also here is where i really dislike the exam questions. I know it doesn't apply to this questions, but if there were no all of the above choice I would have thought that the options needed the quotation marks and n in order to be valid names. Maybe it's not technically asking for syntax, but I could easily see the question being unclear.
It is a subtle distinction. If you look at printouts, say from PROC CONTENTS, and metadata tables, like DICTIONARY.COLUMNS, you will see that the names are just the text that is like the text in the question. It is only when trying to reference the variable in CODE that you need to use the name literals. That is to avoid confusing the SAS compiler that you indented something other than a name. For example if you had a variable named "457" and typed just 457 into the code the compiler would see a numeric constant instead of a variable. So the name literals are required when the name does not follow the "V7" rules.