Hello,
I am teaching SAS to students and one of them has the following problem, which i have never seen.
We all use the same csv file to import and we all use SAS studio.
Importing the table is a success for everyone, and we can all look at our dataset.
But when the student wants to do
PROC FREQ Data = house;
By bathrooms / missing;
RUN;
The following message appears, just for her (For everyone else the code works) :
"Invalid statement due to first character being unprintable (hexadecimal representation [...]"
I don't know how to help her, could you help us?
She quit and restarted SAS, without success.
Thank you !
Bérangère
Hi Bérangère,
How did the student get the CSV file into SAS or onto the server?
My guess is they did something different from all the other students and the CSV file or SAS Dataset (house) that was created from it has some issues.
Hello @bberangere and welcome to the SAS Support Communities!
I had never seen this error either, but found it mentioned in the forum archives. Thanks to this 2020 post, which included the hex code, I was able to reproduce it in the Display Manager interface of SAS 9.4:
47 proc freq data=sashelp.class; 48 tables age / missing; - 217 ERROR 217-322: Invalid statement due to first character being unprintable (hexadecimal representation: 9D). 49 run;
Showing the actual log (in a code window opened with the </> button) as above is helpful because the position of the unprintable character is underlined. (I had inserted it with Alt+157 before the "t" of "tables.")
To remove the unwanted character, just move the cursor to the underlined position and press the Del key (as if you wanted to delete the first visible character of the statement in question, i.e., the "t" in the example above). Repeat this a few times if more unprintable characters are found in the same place.
Alternatively, you may want to try the "auto-format code trick" mentioned in this 2018 thread or retype or copy and paste the code from a source which contains just plain text without unwanted characters.
Thank you !
Indeed, maybe it is an invisible special character that has slipped into the code
I will check this with her
Please post the complete log of that step, and post it by copy/pasting into a window opened with this button:
You must do this directly from the log window of the student's computer. We need to see the position of the error marker, and the complete hexadecimal representation of the unprintable character(s).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.