<?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 Re: Sql passthrough not displaying non ascii characters correctly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902248#M356536</link>
    <description>&lt;P&gt;There is likely something missing in your connect statement that instructs SAS how to convert such characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've got already a working libname then why not use this libref instead in your connect statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change below from:&lt;/P&gt;
&lt;PRE&gt;connect to mysql as myconn (user=&amp;amp;user. password=&amp;amp;password. server=&amp;amp;server. port=3306 database=core);&lt;/PRE&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;PRE&gt;connect using &amp;lt;working libref&amp;gt; as myconn;&lt;/PRE&gt;
&lt;P&gt;From the docu for the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0rn6hhsizv3trn1cl3e0ofosawi.htm" target="_self"&gt;connect statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1699500928372.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89569iDBF948E4A12A7144/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1699500928372.png" alt="Patrick_0-1699500928372.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2023 03:37:10 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-11-09T03:37:10Z</dc:date>
    <item>
      <title>Sql passthrough not displaying non ascii characters correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902215#M356521</link>
      <description>&lt;P&gt;I'm using the following code using a sql passthrough but it is not correctly displaying the non ascii characters - see code sample A. But when I run the same code using libnames (much much slower so not an option for me to use when looking at larger timeframes and more countries) the characters all display correctly - see sample code B. It feels I need an extra option or piece of code added - any ideas please from this wonderful group of SAS Whizz's would be very welcome. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;connect to mysql as myconn (user=&amp;amp;user. password=&amp;amp;password. server=&amp;amp;server. port=3306 database=core);&lt;BR /&gt;create table memships as&lt;BR /&gt;select * from connection to myconn&lt;BR /&gt;(&lt;BR /&gt;select a.invoice_reference, a.invoice_date, a.period_date, a.id_invoice_type, a.id_invoice_status, a.to_id_user,&lt;BR /&gt;a.from_id_company, g.bu_name, a.total_amount, a.to_tax_reference, a.from_id_org,&lt;BR /&gt;a.to_id_person, a.to_company_name, a.to_person_name, a.to_address_line1, a.to_address_line2, a.to_address_state,&lt;BR /&gt;a.to_address_postcode, c.id_payment_status, d.email_address, e.email_address as email_1&lt;BR /&gt;from invoice as a&lt;BR /&gt;left outer join membership_application as b&lt;BR /&gt;on a.id_membership_application = b.id_membership_application&lt;BR /&gt;left outer join payment as c&lt;BR /&gt;on a.id_invoice = c.invoice_id_invoice&lt;BR /&gt;left outer join user as d&lt;BR /&gt;on a.to_id_user = d.id_user&lt;BR /&gt;left outer join person as e&lt;BR /&gt;on a.to_id_person = e.id_person&lt;BR /&gt;left outer join org_region as f&lt;BR /&gt;on a.from_id_org = f.id_region&lt;BR /&gt;left outer join company as g&lt;BR /&gt;on a.from_id_company = g.id_company&lt;BR /&gt;where date(period_date)&amp;gt;= '2023-10-01' and date(period_date) &amp;lt;= '2023-10-31' and f.id_country = 10987 and c.id_payment_status in (1,3)&lt;BR /&gt;and a.id_invoice_type in (1,2);&lt;BR /&gt;);&lt;BR /&gt;disconnect from myconn;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code B&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table memships1 as&lt;BR /&gt;select a.invoice_reference, a.invoice_date, a.period_date, a.id_invoice_type, a.id_invoice_status, a.to_id_user,&lt;BR /&gt;a.from_id_company, g.bu_name, a.total_amount, a.to_tax_reference, a.from_id_org,&lt;BR /&gt;a.to_id_person, a.to_company_name, a.to_person_name, a.to_address_line1, a.to_address_line2, a.to_address_state,&lt;BR /&gt;a.to_address_postcode, c.id_payment_status, d.email_address, e.email_address as email_1&lt;BR /&gt;from core.invoice as a&lt;BR /&gt;left outer join core.membership_application as b&lt;BR /&gt;on a.id_membership_application = b.id_membership_application&lt;BR /&gt;left outer join core.payment as c&lt;BR /&gt;on a.id_invoice = c.invoice_id_invoice&lt;BR /&gt;left outer join core.user as d&lt;BR /&gt;on a.to_id_user = d.id_user&lt;BR /&gt;left outer join core.person as e&lt;BR /&gt;on a.to_id_person = e.id_person&lt;BR /&gt;left outer join core.org_region as f&lt;BR /&gt;on a.from_id_org = f.id_region&lt;BR /&gt;left outer join core.company as g&lt;BR /&gt;on a.from_id_company = g.id_company&lt;BR /&gt;where datepart(period_date)&amp;gt;= '01Oct2023'd and datepart(period_date) &amp;lt;= '31Oct2023'd and f.id_country =10987 and c.id_payment_status in (1,3)&lt;BR /&gt;and a.id_invoice_type in (1,2);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've uploaded a screenshot of the 2 output datasets to show the issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScoobieR_1-1699485567349.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89559i34DE849FE0AC2A7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScoobieR_1-1699485567349.png" alt="ScoobieR_1-1699485567349.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 23:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902215#M356521</guid>
      <dc:creator>ScoobieR</dc:creator>
      <dc:date>2023-11-08T23:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sql passthrough not displaying non ascii characters correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902218#M356522</link>
      <description>&lt;P&gt;Probably should show the definitions of the libname statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One connection is likely defaulting to use of ASCII and the other isn't but why/how may want a few more details.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 23:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902218#M356522</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-11-08T23:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sql passthrough not displaying non ascii characters correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902248#M356536</link>
      <description>&lt;P&gt;There is likely something missing in your connect statement that instructs SAS how to convert such characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've got already a working libname then why not use this libref instead in your connect statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change below from:&lt;/P&gt;
&lt;PRE&gt;connect to mysql as myconn (user=&amp;amp;user. password=&amp;amp;password. server=&amp;amp;server. port=3306 database=core);&lt;/PRE&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;PRE&gt;connect using &amp;lt;working libref&amp;gt; as myconn;&lt;/PRE&gt;
&lt;P&gt;From the docu for the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0rn6hhsizv3trn1cl3e0ofosawi.htm" target="_self"&gt;connect statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1699500928372.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89569iDBF948E4A12A7144/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1699500928372.png" alt="Patrick_0-1699500928372.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 03:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902248#M356536</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-11-09T03:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sql passthrough not displaying non ascii characters correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902282#M356554</link>
      <description>&lt;P&gt;Awesome- thanks Patrick - this works. I didn't know "connect using" was an option. I really appreciate you taking the time to reply.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 08:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902282#M356554</guid>
      <dc:creator>ScoobieR</dc:creator>
      <dc:date>2023-11-09T08:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sql passthrough not displaying non ascii characters correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902283#M356555</link>
      <description>hi there - thank you for replying. Just checked and libnames are using non ascii characters. Have got a solution now from another reply.&lt;BR /&gt;Appreciate your time</description>
      <pubDate>Thu, 09 Nov 2023 08:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sql-passthrough-not-displaying-non-ascii-characters-correctly/m-p/902283#M356555</guid>
      <dc:creator>ScoobieR</dc:creator>
      <dc:date>2023-11-09T08:37:23Z</dc:date>
    </item>
  </channel>
</rss>

