Hi All,
I recently faced an issue with SAS and I am not sure about the cause of the issue.
I ran the same inputs twice and SAS strangely created extra symbols instead of the comma in the second time. Even though I didn't change anything in my code.
I have attached both outputs. Please let me know if there is a soln for this problem.
So the text file you posted is using UTF-8 encoding. You can tell because curly quote in
Barrett’s Esophagus
is stored as the three byte sequence 'E28099'x instead of the single byte '92'x that it would require in WLATIN1 encoding.
Add this option to your INFILE statement.
encoding='utf-8'
If the data has many other UTF-8 characters then you might need to run your SAS session using UTF-8 encoding instead of running it with WLATIN1 (or whatever single byte encoding you are using) since you might encounter Unicode strings that could not be mapped to single byte codes in the encoding that your SAS session is using.
Please post:
Hi,
I have attached all files input-output and the program.
I don't know how to save the log.
Thanks.
So the text file you posted is using UTF-8 encoding. You can tell because curly quote in
Barrett’s Esophagus
is stored as the three byte sequence 'E28099'x instead of the single byte '92'x that it would require in WLATIN1 encoding.
Add this option to your INFILE statement.
encoding='utf-8'
If the data has many other UTF-8 characters then you might need to run your SAS session using UTF-8 encoding instead of running it with WLATIN1 (or whatever single byte encoding you are using) since you might encounter Unicode strings that could not be mapped to single byte codes in the encoding that your SAS session is using.
Those are not commas. A comma sits on the baseline and has a tail that extends below the baseline. It is is period with a tail.
Those look like single quotes in your first example. In the second one perhaps somehow the text went through something that decided it should replace the simple single quotes with something "prettier".
Check the ENCODING settings of the two SAS sessions. And if you are actually reading the data from text files then check the encoding (if any) that is stored in BOM (https://en.wikipedia.org/wiki/Byte_order_mark) of the files.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.