Morning!
I have transcoding problem.
A CSV(contain English and Chinese character) to be imported to SAS format.
1. workable code
data &filename ; ;
infile "&filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;
2.failure code
libname dw "..." Inencoding=any;
data dw.&filename ; ;
infile "&filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;
3. error log
ERROR: Some character data was lost during transcoding in the dataset DW.TRANSACTIONS_HIST_TABLE_20200325.
Either the data contains characters that are not representable in the new encoding or truncation occurred
during transcoding.
As you can see, if import to work, code runs OK without error;(English/number/Chinese are imported correctly)
while import to libname DW, code runs with error. (English/number are imported correctly, Chinese character not imported)
SAS 9.3/EG 5.1 used. Chinese language supported.
Can anyone give a solution?
Thanks and Regards,
Dawn
Morning All,
To make up.
error accurred when libname is a share folder on server other than local ;
no error when libname is any folder of local PC.
Regards,
Dawn
1. > error accurred when libname is a share folder on server other than local
How do you access the server location?
UNC path such as \\server\path ?
2. What OS for the local machine and for the server?
3. libname dw "..." Inencoding=any;
Why use inencoding= (please use a lower case i to make things more legible) when you use the library for output?
outencoding= would seem more useful here.
4. Why not use encoding='UTF-8' as a libname or as a data set option, rather than encoding=any ?
Do you mean the libref is using the REMOTE engine to connect to a SAS/Share server? What encoding is the remote session using?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.