<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connect to SQL Server: Special Characters not correct in CAS but correct in Compute in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/960843#M2765</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am on Viya 2024.09&amp;nbsp; on AKS.&lt;/P&gt;
&lt;P&gt;I am connecting to a SQL Server with Collation="SQL_Latin1_General_CP1_CI_AS".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code to connect to extract the database using Compute:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*COMPUTE - Libname statement*/
libname sqlComp odbc
  complete="driver=SAS ACCESS to MS SQL Server;
    port=1433;
    server=&amp;amp;_SQLSR_SRV.;
    database=&amp;amp;_SQL_DB.;
    stringdates=no;
    read_lock_type=nolock;" 
  schema=&amp;amp;_SQL_SCHEMA. 
  authdomain="&amp;amp;_authDomain."
;

proc sql;
  select TableVersionLabel as Compute_Label
  from sqlComp.TableVersion 
  where TableVID =2328;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which returns the following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a_SAS_sin_0-1741100341688.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105142i82F7196C6054745C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a_SAS_sin_0-1741100341688.png" alt="a_SAS_sin_0-1741100341688.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To connect CAS to SQL Server and extract data I sue the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* CAS - libname  statement*/
caslib odbccasl 
     datasource=( 
      srctype = "odbc" 
      authenticationDomain = "&amp;amp;_authDomain."
      catalog = "*"
      schema = "&amp;amp;_SQL_SCHEMA."
      conopts="driver=SAS ACCESS to MS SQL Server;
          port=1433;
          server=&amp;amp;_SQLSR_SRV.;
          database=&amp;amp;_SQL_DB.;
          stringdates=no;
          read_lock_type=nolock;" 
    ) ;

/*Loads the data in casuser using fedsql*/
proc fedsql sessref=mySession _method ;
   select a.TableVersionLabel as CAS_Label
   from odbccasl."TableVersion" a  
    Where TableVID =2328;;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which returns the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a_SAS_sin_1-1741100479776.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105143iB1A3DA64DDFCAC99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a_SAS_sin_1-1741100479776.png" alt="a_SAS_sin_1-1741100479776.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see the "long-dash" character is not shown correctly.&lt;BR /&gt;How can I make sure the values in CAS are shown correctly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FYI, the odbc driver is installed in a mounted share that is used by both the compute and CAS.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 15:06:49 GMT</pubDate>
    <dc:creator>a_SAS_sin</dc:creator>
    <dc:date>2025-03-04T15:06:49Z</dc:date>
    <item>
      <title>Connect to SQL Server: Special Characters not correct in CAS but correct in Compute</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/960843#M2765</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am on Viya 2024.09&amp;nbsp; on AKS.&lt;/P&gt;
&lt;P&gt;I am connecting to a SQL Server with Collation="SQL_Latin1_General_CP1_CI_AS".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code to connect to extract the database using Compute:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*COMPUTE - Libname statement*/
libname sqlComp odbc
  complete="driver=SAS ACCESS to MS SQL Server;
    port=1433;
    server=&amp;amp;_SQLSR_SRV.;
    database=&amp;amp;_SQL_DB.;
    stringdates=no;
    read_lock_type=nolock;" 
  schema=&amp;amp;_SQL_SCHEMA. 
  authdomain="&amp;amp;_authDomain."
;

proc sql;
  select TableVersionLabel as Compute_Label
  from sqlComp.TableVersion 
  where TableVID =2328;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which returns the following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a_SAS_sin_0-1741100341688.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105142i82F7196C6054745C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a_SAS_sin_0-1741100341688.png" alt="a_SAS_sin_0-1741100341688.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To connect CAS to SQL Server and extract data I sue the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* CAS - libname  statement*/
caslib odbccasl 
     datasource=( 
      srctype = "odbc" 
      authenticationDomain = "&amp;amp;_authDomain."
      catalog = "*"
      schema = "&amp;amp;_SQL_SCHEMA."
      conopts="driver=SAS ACCESS to MS SQL Server;
          port=1433;
          server=&amp;amp;_SQLSR_SRV.;
          database=&amp;amp;_SQL_DB.;
          stringdates=no;
          read_lock_type=nolock;" 
    ) ;

/*Loads the data in casuser using fedsql*/
proc fedsql sessref=mySession _method ;
   select a.TableVersionLabel as CAS_Label
   from odbccasl."TableVersion" a  
    Where TableVID =2328;;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which returns the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a_SAS_sin_1-1741100479776.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/105143iB1A3DA64DDFCAC99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="a_SAS_sin_1-1741100479776.png" alt="a_SAS_sin_1-1741100479776.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see the "long-dash" character is not shown correctly.&lt;BR /&gt;How can I make sure the values in CAS are shown correctly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FYI, the odbc driver is installed in a mounted share that is used by both the compute and CAS.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/960843#M2765</guid>
      <dc:creator>a_SAS_sin</dc:creator>
      <dc:date>2025-03-04T15:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to SQL Server: Special Characters not correct in CAS but correct in Compute</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/961049#M2774</link>
      <description>&lt;P&gt;I work in SAS Technical Support (TS). As discussed in the TS case:&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #151920; font-family: Lato, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;Firstly I would suggest using the dedicated module SAS/Access to MS SQL Server. In order to use this module you'd need to change your SAS code to use:&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #151920; font-family: Lato, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;srctype=’sqlserver’ in caslib and also sqlsvr engine in libname (instead of odbc)&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #151920; font-family: Lato, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;and then:&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #151920; font-family: Lato, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;- set IANAAppCodePage=106 to reflect utf-8 in Viya,&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #151920; font-family: Lato, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;- column type names in SQL Server are expected to begin with n like nchar, nvarchar.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 10:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/961049#M2774</guid>
      <dc:creator>splslb</dc:creator>
      <dc:date>2025-03-06T10:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Connect to SQL Server: Special Characters not correct in CAS but correct in Compute</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/961054#M2775</link>
      <description>Adding the option `IANAAppCodePage=106` fixed the issue. &lt;BR /&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37531"&gt;@splslb&lt;/a&gt;</description>
      <pubDate>Thu, 06 Mar 2025 11:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Connect-to-SQL-Server-Special-Characters-not-correct-in-CAS-but/m-p/961054#M2775</guid>
      <dc:creator>a_SAS_sin</dc:creator>
      <dc:date>2025-03-06T11:32:59Z</dc:date>
    </item>
  </channel>
</rss>

