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

I connect mysql(utf8 encoding) with libname

libname rdm mysql server=.....  dbconinit='set names gbk'

 

('set names utf8' fails but 'se names gbk' works when I appends data to MySQL)

 I append data to MySQL tables(utf8) 

There are errors about encoding when appending data.(There are other languages or '€' etc)

 

proc append base=rdm.wdj data=source.wdj force  force;
run;

he appending  procedure stops whenever there is an error.

How do I skip the error data and keep appending the next data?

1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

Check your SAS Session encoding.

 

proc options option=encoding;run;

Also check your dataset encoding,

 

/*Check your data set encoding*/
%let dsn=jliang1.group_info;
%let dsid=%sysfunc(open(&dsn,i));
%put &dsn ENCODING is:
%sysfunc(attrc(&dsid,encoding));
/*Or*/
proc contents data=jliang1.group_info;run; 

What SAS Application are you using, EG or Base SAS? If Base SAS then open SAS UTF-8 application and run the code.

 

FYI.....http://support.sas.com/kb/51/586.html

Thanks,
Suryakiran

View solution in original post

2 REPLIES 2
SuryaKiran
Meteorite | Level 14

Check your SAS Session encoding.

 

proc options option=encoding;run;

Also check your dataset encoding,

 

/*Check your data set encoding*/
%let dsn=jliang1.group_info;
%let dsid=%sysfunc(open(&dsn,i));
%put &dsn ENCODING is:
%sysfunc(attrc(&dsid,encoding));
/*Or*/
proc contents data=jliang1.group_info;run; 

What SAS Application are you using, EG or Base SAS? If Base SAS then open SAS UTF-8 application and run the code.

 

FYI.....http://support.sas.com/kb/51/586.html

Thanks,
Suryakiran
SullivanC
Calcite | Level 5

Thanks.

I use EG to connect to MySQL(UTF8)

My dataset is euc-cn Simplified Chinese.

Can I change the dataset from euc-cn to UTF8?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1856 views
  • 0 likes
  • 2 in conversation