BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Alexxxxxxx
Pyrite | Level 9

hello all,

 

do you know why I read the English character into SAS but shown as Chinese character?

 

I use the following code,

proc import datafile = "G:\Raw_data\SIC_Code\SIC_CODE_LIST.xlsx"
OUT=SIC_CODE_LIST DBMS=XLSX replace;
Sheet='Sheet1';
RANGE='A1:A1421';
GETNAMES=YES;
RUN;

to read the following table,

des
Industry Group 011: Cash Grains
0111 Wheat
0112 Rice
0115 Corn
0116 Soybeans
0119 Cash Grains, Not Elsewhere Classified
Industry Group 013: Field Crops, Except Cash Grains
0131 Cotton

 

the result shows as below,

屏幕截图(2).png

but when I click on the text, it is still English character.

屏幕截图(4).png

Do you know why, and how could I fix it? I would appreciate it if you could give me some advice.

 

many thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What encoding if your SAS session using?  Check the macro variable SYSENCODING.

What encoding is the XLSX file using?  I have no idea how to check that.

Can you save the XLSX file as a delimited text file instead?  Then you could set the encoding of the text file in the INFILE statement you use when reading the text into SAS.

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

What encoding if your SAS session using?  Check the macro variable SYSENCODING.

What encoding is the XLSX file using?  I have no idea how to check that.

Can you save the XLSX file as a delimited text file instead?  Then you could set the encoding of the text file in the INFILE statement you use when reading the text into SAS.

Ksharp
Super User
As Tom pointed it out. It is encoding problem .
Try change your SAS encoding into UTF-8 .
Or Save it as a CSV file and import it with UTF-8 encoding in FILENAME .

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1073 views
  • 4 likes
  • 3 in conversation