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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 3657 views
  • 3 likes
  • 3 in conversation