Hi Folks:
I'd like to use English in writing SAS programs. But I have about 10 excel datasets sorted on the ID variables that are written in Korean characteristics. I'd like to merge these 10 data sets by ID in Korean characteristics. After merging, I'll have to proc export the resulting merged dataset into excel keeping ID in Korean characteristics.
I found u8 folder in my SASFoundation folder.
Can you please help what needed to be done from here? I find SAS documentation on the topic complex. One of excel sheets that I'm trying to import and export is attached for example.
If they setup your laptop right in addition to a command to launch SAS using single byte encoding you should have one to launch using
unicode support. Just start SAS with than icon/command.
I'm not allowed to change nls/en to nls/u8 in the SASFoundation. This is my personal laptop but still not allowed to make changes. Maybe I should try linking the tables in Excel.
Did you try Administrator mode for Notepad++? You should have administrator access to your own personal laptop.
Yes, I was able to change in the notepad+++. ThenI tried following based on SAS help center's blog with no success. Resulting test dataset has nonsensical symbols instead Korean characteristics.
FILENAME IN "D:\mydata.txt" Encoding="utf-16";
PROC IMPORT OUT= WORK.test
DATAFILE= IN
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
proc options option=encoding; run;
proc options option=encoding; run;
SAS (r) Proprietary Software Release 9.4 TS1M5
ENCODING=WLATIN1
If they setup your laptop right in addition to a command to launch SAS using single byte encoding you should have one to launch using
unicode support. Just start SAS with than icon/command.
This is what i see. It seems that all I have is SAS with DBCS. Opening 'SAS with DBCS' version help?
Yay, I found one with unicode support. Can you show me in SAS code how to import the file that I attached to this post for example? Given that I now have opened Unicode Support SAS, please?
@Tom this worked. I can't believe my eyes!!!! Thank you so much. I struggled whole 5 hours. The problem was solved in just couple minutes. Thank you.
FILENAME IN "camp1.txt";
PROC IMPORT OUT= WORK.test
DATAFILE= IN
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
Yes, you're right. It didn't work with .xlsx datasets that I actually have unless I open them one by one and save to unicode.txt. I tried the code below which created non-sensical dataset. Any suggestion as to how to make/modify this code to work for .xlsx files?
PROC IMPORT OUT=test_excel
DATAFILE="camp.xlsx"
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
I am sure that is a good representation of what it would like if you read the binary XLSX file as if it was a text file.
You need to tell PROC IMPORT to use the XLSX engine.
proc import dbms=xlsx datafile="&path\&fname"
out=test replace
;
run;
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!
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.