- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I got this error when I'm importing a text data file to SAS.
I know how to solve it by specifying the option
options validvarname=any;
but I want to know why these variables' names don't fit with SAS variables rules
ERROR: The name RELIF is not a valid SAS name
ERROR: The name LVEF is not a valid SAS name.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@mona4u wrote:
I got this error when I'm importing a text data file to SAS.
I know how to solve it by specifying the option
options validvarname=any;
but I want to know why these variables' names don't fit with SAS variables rules
ERROR: The name RELIF is not a valid SAS name
ERROR: The name LVEF is not a valid SAS name.
When there does not appear to be a character but the error message seems to display an extra character then one possible culprit is a null character, ASCII value 255. Please see:
15 data junk; 16 x =123; ERROR: The name x is not a valid SAS name. 17 y=345; ERROR: The name y is not a valid SAS name. 18 run;
Notice in the second error there is an extra 'space' before the y and compared with the first error no space after y but is after x.
I typed the variable names, in Windows, alt-255 (hold the alt key and enter 255 using the numeric key pad) to add one character before or after y and x.
I think you might get a similar behavior if copying code from a non-text file format under some conditions.
We would have to see your code to have a shot at telling if this is the case. If you post code paste it into the code box opened on the forum with the {I} as it is possible that the main message window reformats such characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can we please see the relevant parts of the SASLOG so we can see what code was submitted and what the error messages were?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
just edited it
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So from now on, in every post you make, we want to see code and SASLOGs posted in the {i} or running man window. No exceptions. Every single time you should do this. Otherwise, we are going to scream.
Something like this:
19 LVEF $6 20 LVEFM $50 ERROR: The name LVEF is not a valid SAS name.
It's not clear to me how this happened, but it appears there are special characters in the variable name that show as spaces. Note the extra spaces after LVEF (but not after LVEFM). Also see the extra spaces after LVEF in the ERROR message.
You might want to try retyping the LVEF and RELIF lines making sure there are no special characters in the line.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@mona4u wrote:
I got this error when I'm importing a text data file to SAS.
I know how to solve it by specifying the option
options validvarname=any;
but I want to know why these variables' names don't fit with SAS variables rules
ERROR: The name RELIF is not a valid SAS name
ERROR: The name LVEF is not a valid SAS name.
When there does not appear to be a character but the error message seems to display an extra character then one possible culprit is a null character, ASCII value 255. Please see:
15 data junk; 16 x =123; ERROR: The name x is not a valid SAS name. 17 y=345; ERROR: The name y is not a valid SAS name. 18 run;
Notice in the second error there is an extra 'space' before the y and compared with the first error no space after y but is after x.
I typed the variable names, in Windows, alt-255 (hold the alt key and enter 255 using the numeric key pad) to add one character before or after y and x.
I think you might get a similar behavior if copying code from a non-text file format under some conditions.
We would have to see your code to have a shot at telling if this is the case. If you post code paste it into the code box opened on the forum with the {I} as it is possible that the main message window reformats such characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It was minor things when I delete the variables and wrote them again it works.