Hi Chris,
Thanks for your great solution. It's working!
Just like you said, It's because EG could not detect the encoding in my SAS program by default.
@Kurt_Bremser You are right. The editor save file in UTF-8 without BOM by default. Thanks for you advice! I think my confuse has been completely addressed.
.
I had a related issue with thousands of *.sas files from external sources in UTF8 that were incorrectly handled by the EG due to the missing Byte Order Mark (BOM) in the files. Opening and saving them manually in EG with the correct encoding information was not an option.
I added the BOM programmatically which made EG detect the encoding correctly. Due to my personal preferences I coded it in linux bash. Powershell should look similiar.
echo -ne '\xEF\xBB\xBF' > prog_utf8_BOM.sas && cat prog_utf8.sas >> prog_utf8_BOM.sas && mv prog_utf8_BOM.sas prog_utf8.sas
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.