Coding with SAS Studio 9.4, I got the following error message:
@dkcundiffMD wrote:
The ";" at the end of the equation was the spot with the
___ 22However, when I did some further unrelated work on the code and when back, it worked. That has occasionally happened before. I'm still puzzled why.
Thanks.
You should always paste Log or Code entries into a code box opened with either the forum's {I} or "running man" icon. The main message windows reformat text and have been known to introduce HTML, or interpret certain characters as HTML for display, characters (seemingly at random) so what you paste may not actually be what the code actually was.
Since your posting shows what appears to be Call execute generated code your source code may have an invisible character that only sometimes gets inserted depending on your code or the value in your data set contains a character not valid for names. If you are using Call execute it may help to share both the code and some example data. If you use a data set for generating code you really want to validate the values for use in variable or data set names. Luckily SAS supplies functions MVALID (to test if a string is valid for a member {specify catalog, data set, itemstor, access descriptor etc.} name) and NVALID to check the validity of a string as use in a variable name.
In your log what is being underlined with
___ 22
Proportional font does not work for SASLOG.
Show your log using {i} box.
The ";" at the end of the equation was the spot with the
___ 22
However, when I did some further unrelated work on the code and when back, it worked. That has occasionally happened before. I'm still puzzled why.
Thanks.
Figure out where these characters are coming from.
@dkcundiffMD wrote:
The ";" at the end of the equation was the spot with the
___ 22However, when I did some further unrelated work on the code and when back, it worked. That has occasionally happened before. I'm still puzzled why.
Thanks.
You should always paste Log or Code entries into a code box opened with either the forum's {I} or "running man" icon. The main message windows reformat text and have been known to introduce HTML, or interpret certain characters as HTML for display, characters (seemingly at random) so what you paste may not actually be what the code actually was.
Since your posting shows what appears to be Call execute generated code your source code may have an invisible character that only sometimes gets inserted depending on your code or the value in your data set contains a character not valid for names. If you are using Call execute it may help to share both the code and some example data. If you use a data set for generating code you really want to validate the values for use in variable or data set names. Luckily SAS supplies functions MVALID (to test if a string is valid for a member {specify catalog, data set, itemstor, access descriptor etc.} name) and NVALID to check the validity of a string as use in a variable name.
So I just put {I} in front of anything I'm coding? Or wait till is get a bogus syntax error and then redo with {I}?
Thanks.
David K. Cundiff
CLICK on the Insert Code icon or the Insert SAS code icon on the editor menu and a window will pop-up where you can paste the lines of text you copied from your SAS log or program editor.
639
640 BMI17f6s=
641 +pmeat17KCs *0.0257616*0.59026594*100
642 +rmeat17KCs *0.28559643606*0.59026594*100
___
22
ERROR: The name is not a valid SAS name.
ERROR: The name is not a valid SAS name.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, LE,
LT, MAX, MIN, NE, NG, NL, OR, ^=, |, ||, ~=.
643 +fish17KCs *0.001355444*0.59026594*100
644 +milk17KCs *0.152948*0.59026594*100
645 +poultry16KCs *0.32966*0.59026594*100
646 +eggs16KCs *0.076896*0.59026594*100
647
648 - fruits17KCs *0.022533*0.59026594*100
649 -vegetables17KCs *0.0311578*0.59026594*100
650 -nutsseeds17KCs *0.0029001*0.59026594*100
651 - wgrains17KCs *0.0032282*0.59026594*100
652 -legumes17KCs *0.010995*0.59026594*100
653 -corn16KCs*0.00005218*0.59026594*100
654 -potatoes16KCs*0.00021426*0.59026594*100
655 -rice16KCs *0.075717*0.59026594*100
656 -swtpot16KCs *0.001059*0.59026594*100
657
658 -PAMets17ms*0.21541 *0.59026594*100
659 ;
It happened again. Is this what you mean?
Thanks.
There are three characters between 6 and * that are not being displayed. I think your issue may be related to file encoding but I don't know enough about that to be helpful. @Tom is someone who I believe will be able to explain the issue.
That code E280AC is pop-directional format. It does not really have a glyph.
https://en.wikipedia.org/wiki/Bidirectional_text
Are you by any chances using languages like Arabic or Hebrew that are written from right to left on the page?
I removed the non displaying code that you pointed out and it worked!
Thank you very much.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.