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
Azurite | Level 17

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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 4186 views
  • 3 likes
  • 3 in conversation