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

Hello everybody.

I need to import a SQL Server table in SAS. I've done this import with an ODBC connector, but in SQL Server table, there are rows with special characters, like ç, á, é, í...

When I've imported this table to SAS, all the values with special char have changed. For example the value ÍNDIO was changed for ¿NDIO.

 

How do I solve this problem with special character?

Are there any people with the same problem?

 

Import code is like this.

 

proc sql;
connect to odbc as mycon
   (datasrc=ora7 user=testuser password=testpass);

create table SAS_TABLE as
select *   from connection to mycon
      (select *  from sasdemo.employees);

disconnect from mycon;
quit;

 

 

Thank you so much.

Best regards,

1 ACCEPTED SOLUTION

Accepted Solutions
thiagoglima
Obsidian | Level 7

Hi,

 

which encode configuration you are using in your SqlServer database?

 

It seems to me that you have encoding problem. Maybe this link can help you: http://support.sas.com/kb/36/652.html

 

To understand more about encoding: 

 

https://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Edmonton-User-Group/SAS9UTF-8...

 

 

View solution in original post

2 REPLIES 2
thiagoglima
Obsidian | Level 7

Hi,

 

which encode configuration you are using in your SqlServer database?

 

It seems to me that you have encoding problem. Maybe this link can help you: http://support.sas.com/kb/36/652.html

 

To understand more about encoding: 

 

https://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Edmonton-User-Group/SAS9UTF-8...

 

 

JuanS_OCS
Amethyst | Level 16

Hello @Mozart_Sindeaux,

 

I concur with @thiagoglima, the link provided should be able to help you.

 

You need to focus on: the encoding (specially if single-byte or double-byte) from origin data source (MSQL) and destination (the SAS table, bases in your SAS sessions encoding, which you can check with %put _ALL_;

 

Then, you need to use the transcoding.

 

Indeed, problem is that SAS-ODBC connections have trouble with trans-coding but the referred SAS note 36652 provides a great example to workaround it.

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 2 replies
  • 3267 views
  • 3 likes
  • 3 in conversation