<?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: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660138#M197639</link>
    <description>&lt;P&gt;Try putting the quotes into the value you tell the LIBNAME statement to use for the SCHEMA.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname nzp netezza  ... schema="""USER-NAME""" ... ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Jun 2020 18:31:58 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-06-16T18:31:58Z</dc:date>
    <item>
      <title>libname schema reference (username) has dashes (special characters) and causes CLI error on Netezza</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660129#M197635</link>
      <description>&lt;P&gt;Hello-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a username that it similar to this: "MY-USER-NAME" and this is causing me issues when it comes to using it as a schema in my libname.&amp;nbsp; I have tried creating a secondary variable that upcases and double quotes the username and passing that in, which allows me to assign the libname just fine, but once I attempt to use it in a data step i receive the below error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;User name secondary variable:&lt;/P&gt;&lt;PRE&gt;%let nUser = "%upcase(&amp;amp;user.)";&lt;/PRE&gt;&lt;P&gt;Then I successfully assign the libname:&lt;/P&gt;&lt;PRE&gt;libname nzp netezza user=&amp;amp;nUser. password="&amp;amp;nzpass" server="server.co.net" database="DBC" schema=&amp;amp;nUser. connection=shared;

NOTE: Libref nzp was successfully assigned as follows:
      Engine:        NETEZZA&lt;/PRE&gt;&lt;P&gt;However, attempting to create a dataset on Netezza with a data step causes this:&lt;/P&gt;&lt;PRE&gt;	data nzp.mytable (bulkload=yes);
		set work.have;
	run;

NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
ERROR: Error attempting to CREATE a DBMS table. ERROR: CLI execute error: ERROR:  'USER-NAME.MYTABLE' error   ^ found "-" (at
       char 0) expecting `AS'.
NOTE: The DATA step has been abnormally terminated.&lt;/PRE&gt;&lt;P&gt;The issue appears to be that when the libname references the schema inside the data step, it is unquoted, thereby causing this error.&amp;nbsp; Also to note, there are tables in Netezza currently that have this username as their schema, they simply show double quotes around the schema name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for any assistance!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 18:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660129#M197635</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-16T18:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660132#M197637</link>
      <description>&lt;P&gt;can you try putting %quote or %str as following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname nzp netezza user=%quote(&amp;amp;nUser.) password="&amp;amp;nzpass" server="server.co.net" database="DBC" schema=%quote(&amp;amp;nUser.) connection=shared;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname nzp netezza user=%str(&amp;amp;nUser.) password="&amp;amp;nzpass" server="server.co.net" database="DBC" schema=%str(&amp;amp;nUser. ) connection=shared;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Let me know what works.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 18:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660132#M197637</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-06-16T18:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660138#M197639</link>
      <description>&lt;P&gt;Try putting the quotes into the value you tell the LIBNAME statement to use for the SCHEMA.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname nzp netezza  ... schema="""USER-NAME""" ... ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2020 18:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660138#M197639</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-16T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660142#M197640</link>
      <description>I tried both and am still getting the same error</description>
      <pubDate>Tue, 16 Jun 2020 18:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660142#M197640</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-16T18:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660144#M197641</link>
      <description>This one gave me a new error:&lt;BR /&gt;ERROR: Error attempting to CREATE a DBMS table. ERROR: CLI execute error: ERROR: zero-length delimited identifier.&lt;BR /&gt;NOTE: The DATA step has been abnormally terminated.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Jun 2020 18:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660144#M197641</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-16T18:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660145#M197642</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334018"&gt;@jmspy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This one gave me a new error:&lt;BR /&gt;ERROR: Error attempting to CREATE a DBMS table. ERROR: CLI execute error: ERROR: zero-length delimited identifier.&lt;BR /&gt;NOTE: The DATA step has been abnormally terminated.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And what remote SQL code did SAS actually generate?&amp;nbsp; Make sure to turn on the logging so you can see the generated code that SAS sends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should open a ticket with SAS support and get them to help you debug this.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 18:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660145#M197642</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-16T18:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660168#M197643</link>
      <description>I'm actually not sure how to do that, i use the normal log and/or project log. Is there a different log you are referring to?</description>
      <pubDate>Tue, 16 Jun 2020 19:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660168#M197643</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-16T19:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660170#M197644</link>
      <description>Netezza by default writes log to some place on your local machine. You need to find where it is located.</description>
      <pubDate>Tue, 16 Jun 2020 19:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660170#M197644</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-06-16T19:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660172#M197645</link>
      <description>&lt;P&gt;There are many SAS options that control how much information is written to the SAS log.&amp;nbsp; Here are some example settings I have used in the past.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options msglevel=i nostsuffix sastrace=',,,ds' sastraceloc=saslog sql_ip_trace=source;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also try checking if you can access that schema using explicit pass thru code.&amp;nbsp; For example if there is a table named MYTABLE in the USER-NAME schema can you run this query to count how many observations it has?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
connect using nzp;
select * from connection to nzp
  (select count(*) as nobs from user-name.mytable)
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 20:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660172#M197645</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-16T20:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660175#M197646</link>
      <description>&lt;P&gt;This SAS Note provides some insights into this issue :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/35/003.html" target="_blank"&gt;https://support.sas.com/kb/35/003.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 20:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660175#M197646</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2020-06-16T20:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660190#M197655</link>
      <description>&lt;P&gt;Here's the output with those additional log options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NETEZZA: AUTOCOMMIT is NO for connection 1

NETEZZA_1: Executed: on connection 1
SELECT * FROM DBC.MY-USER-NAME.MYTABLE WHERE 0=1


Summary Statistics for NETEZZA are:
Total SQL execution seconds were:                   0.000619
Total seconds used by the NETEZZA ACCESS engine were     0.000782


NETEZZA_2: Prepared: on connection 0
SELECT * FROM DBC.MY-USER-NAME.MYTABLE
^L220                                                        The SAS System                               17:09 Tuesday, June 16, 2020



Summary Statistics for NETEZZA are:
Total SQL prepare seconds were:                     0.000824
Total seconds used by the NETEZZA ACCESS engine were     0.001073

620      !  proc append base=usb.MYTABLE (bulkload=yes) data=work.have;
ERROR: CLI prepare error: ERROR:  'USER-NAME.MYTABLE error   ^ found "-" (at char 0) expecting a keyword&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660190#M197655</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-16T21:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660229#M197674</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334018"&gt;@jmspy&lt;/a&gt;&amp;nbsp;- Looks similar to this SAS note:&amp;nbsp;&lt;A href="https://support.sas.com/kb/58/291.html" target="_blank"&gt;https://support.sas.com/kb/58/291.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect SAS Tech Support is your best bet.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 00:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/660229#M197674</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-06-17T00:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: libname schema reference (username) has dashes (special characters) and causes CLI error on Nete</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/663999#M198322</link>
      <description>&lt;P&gt;A member of my company was able to help fix the issue for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;schema='"MY-USER-NAME"'&lt;/PRE&gt;&lt;P&gt;I've only gotten it to work by hard coding the username and surrounding the double-quoted username with single quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libname-schema-reference-username-has-dashes-special-characters/m-p/663999#M198322</guid>
      <dc:creator>jmspy</dc:creator>
      <dc:date>2020-06-22T14:43:00Z</dc:date>
    </item>
  </channel>
</rss>

