<?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 SAS, Athena, and Hyphens in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/686829#M19589</link>
    <description>&lt;P&gt;Hi, I am running the following statements and received an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;LIBNAME athena ODBC DATAsrc=athena schema="aws-catalog-test";&lt;BR /&gt;proc sql;&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM athena.table;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;SQL statement: SELECT * FROM aws-catalog-test.table&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that SAS does not like the hyphens in the name of the schema? Could anyone confirm? Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 20:56:30 GMT</pubDate>
    <dc:creator>SASUser_86</dc:creator>
    <dc:date>2020-09-25T20:56:30Z</dc:date>
    <item>
      <title>SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/686829#M19589</link>
      <description>&lt;P&gt;Hi, I am running the following statements and received an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;LIBNAME athena ODBC DATAsrc=athena schema="aws-catalog-test";&lt;BR /&gt;proc sql;&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM athena.table;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;SQL statement: SELECT * FROM aws-catalog-test.table&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My guess is that SAS does not like the hyphens in the name of the schema? Could anyone confirm? Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 20:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/686829#M19589</guid>
      <dc:creator>SASUser_86</dc:creator>
      <dc:date>2020-09-25T20:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/686853#M19590</link>
      <description>&lt;P&gt;Is that the complete error message? If not please post it.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 22:48:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/686853#M19590</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-25T22:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687269#M19591</link>
      <description>&lt;P&gt;This is the full error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR: CLI prepare error: Unable to retrieve error message.&lt;BR /&gt;SQL statement: SELECT * FROM aws-catalog-test.table.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687269#M19591</guid>
      <dc:creator>SASUser_86</dc:creator>
      <dc:date>2020-09-28T16:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687344#M19592</link>
      <description>&lt;P&gt;The fact that database error messages can't be retrieved suggests to me that there is a configuration problem in the ODBC interface. I suggest you open a track on this with SAS Tech Support as they are in the best position to diagnose what is happening.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687344#M19592</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-28T20:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687346#M19593</link>
      <description>&lt;P&gt;Typically, I would think such as well. However, when I change the schema name to one without a hyphen, this works just fine. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;LIBNAME athena ODBC DATAsrc=athena schema="aws";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM athena.table;&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Even underscores are acceptable.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 21:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687346#M19593</guid>
      <dc:creator>SASUser_86</dc:creator>
      <dc:date>2020-09-28T21:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687366#M19594</link>
      <description>&lt;P&gt;Try this to see if it provides anything useful.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace= ',,,ds' sastraceloc=saslog nostsuffix sql_ip_trace=(note,source) msglevel=i;

options mprint  source details;

%put %quote(%sysget(LD_LIBRARY_PATH));&lt;BR /&gt;&lt;BR /&gt;LIBNAME athena ODBC DATAsrc=athena schema="aws" libdebug;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I still suggest you track your hyphen issue to Tech Support.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 23:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687366#M19594</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-28T23:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687385#M19595</link>
      <description>&lt;P&gt;Read the discussion on this old thread about similar issue with variable names.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-DBMS-column-names-that-have-a-quot-quot-in-them-in/td-p/269560" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Working-with-DBMS-column-names-that-have-a-quot-quot-in-them-in/td-p/269560&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might try some of the options/settings mentioned there, but I suspect you will end up using the same solution. Use passthru SQL so that your code is written in the remote databases dialect of SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687385#M19595</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-29T01:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687801#M19597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182659"&gt;@SASUser_86&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it is Athena (aka Presto) that doesn't like the hyphens. SAS is passing the name to Athena; Athena is returning the error message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Athena a schema=database.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following text comes from this page:&amp;nbsp;&lt;A href="https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html" target="_blank" rel="noopener"&gt;https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html&lt;/A&gt;&amp;nbsp;(I have highlighted the relevant section.&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2 id="schema-names"&gt;&lt;EM&gt;Database, Table, and Column Names&lt;/EM&gt;&lt;/H2&gt;
&lt;P&gt;&lt;EM&gt;When you create schema in AWS Glue to query in Athena, consider the following:&lt;/EM&gt;&lt;/P&gt;
&lt;DIV class="itemizedlist"&gt;
&lt;UL class="itemizedlist" type="disc"&gt;
&lt;LI class="listitem"&gt;
&lt;P&gt;&lt;EM&gt;A database name cannot be longer than 252 characters.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="listitem"&gt;
&lt;P&gt;&lt;EM&gt;A table name cannot be longer than 255 characters.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="listitem"&gt;
&lt;P&gt;&lt;EM&gt;A column name cannot be longer than 128 characters.&lt;/EM&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="listitem"&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;The only acceptable characters for database names, table names, and column names are lowercase letters, numbers, and the underscore character.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;EM&gt;You can use the AWS Glue Catalog Manager to rename columns, but at this time table names and database names cannot be changed using the AWS Glue console. To correct database names, you need to create a new database and copy tables to it (in other words, copy the metadata to a new entity). You can follow a similar process for tables. You can use the AWS Glue SDK or AWS CLI to do this.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 13:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687801#M19597</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2020-09-30T13:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS, Athena, and Hyphens</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687905#M19599</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;&amp;nbsp;You are correct. It does appear that the limitation is within Athena. Oddly enough, the majority of our current databases/schema in Athena have hyphens in the name. So, we assumed that since it was allowed in Athena, it was a SAS issue. We landed on the similar doc you linked related to naming.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try using a pass through query with the hyphens in the schema/database and this works -- in case others encounter this issue and you cannot modify the schema name.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 17:52:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Athena-and-Hyphens/m-p/687905#M19599</guid>
      <dc:creator>SASUser_86</dc:creator>
      <dc:date>2020-09-30T17:52:10Z</dc:date>
    </item>
  </channel>
</rss>

