<?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: Writing to SQL Server Converts Empty Strings To NULL in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770672#M39620</link>
    <description>&lt;P&gt;Thanks for the links. It appears both options are valid when using the proc step, but when I attempt to use either one in my code, I receive the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;29 proc sql nullcharval=no;&lt;BR /&gt;___________&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR: Entry NO.TRANTAB not found in catalog SASHELP.LOCALE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;29 proc sql nullchar=no;&lt;BR /&gt;________&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR: Entry NO.TRANTAB not found in catalog SASHELP.LOCALE.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Mon, 27 Sep 2021 17:03:46 GMT</pubDate>
    <dc:creator>Placeholder</dc:creator>
    <dc:date>2021-09-27T17:03:46Z</dc:date>
    <item>
      <title>Writing to SQL Server Converts Empty Strings To NULL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770663#M39618</link>
      <description>&lt;P&gt;I am attempting to perform an update statement via proc sql on an existing table stored in SQL Server. The table I am writing to does not allow null values in any fields but has numerous records with blank values. When I attempt to update some records, I receive an error that the fields do not accept null values. Some fields in the table I am updating from have empty strings, but no null values. I even have forced them to be empty strings by performing a statement like "CASE WHEN col1 is null then '' else col1 end". When I look at the table I am updating from in another program (Advanced Query Tool), I still see null values where empty strings should be, whereas the table I am updating to shows empty strings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What option do I need to change to get SAS to write empty strings instead of nulls to a SQL Server table?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AQT shows (null)" style="width: 203px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64099i8562C36B5A40A172/image-size/large?v=v2&amp;amp;px=999" role="button" title="AQT NULL.PNG" alt="AQT shows (null)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AQT shows (null)&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS EG shows empty string" style="width: 206px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64100iBC62830B8ED9C705/image-size/large?v=v2&amp;amp;px=999" role="button" title="EG Empty String.PNG" alt="SAS EG shows empty string" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SAS EG shows empty string&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 16:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770663#M39618</guid>
      <dc:creator>Placeholder</dc:creator>
      <dc:date>2021-09-27T16:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to SQL Server Converts Empty Strings To NULL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770667#M39619</link>
      <description>&lt;P&gt;I suspect the answer is the same as it was in 2014.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Getting-Null-string-into-Sql-Server-database/td-p/180324" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Getting-Null-string-into-Sql-Server-database/td-p/180324&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the link to the SAS documentation in that answer is broken.&lt;/P&gt;
&lt;P&gt;Search:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=%40sas.com+nullchar%3Dno" target="_blank"&gt;https://www.google.com/search?q=%40sas.com+nullchar%3Dno&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;NULLCHAR=&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1hmopc3y74oy2n1svhu03pfoiy9.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n1hmopc3y74oy2n1svhu03pfoiy9.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;NULLCHARVAL=&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p1j4yi0qpmf6wfn1vfqp3wudt0pu.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p1j4yi0qpmf6wfn1vfqp3wudt0pu.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 16:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770667#M39619</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-27T16:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to SQL Server Converts Empty Strings To NULL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770672#M39620</link>
      <description>&lt;P&gt;Thanks for the links. It appears both options are valid when using the proc step, but when I attempt to use either one in my code, I receive the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;29 proc sql nullcharval=no;&lt;BR /&gt;___________&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR: Entry NO.TRANTAB not found in catalog SASHELP.LOCALE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;29 proc sql nullchar=no;&lt;BR /&gt;________&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR: Entry NO.TRANTAB not found in catalog SASHELP.LOCALE.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 27 Sep 2021 17:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770672#M39620</guid>
      <dc:creator>Placeholder</dc:creator>
      <dc:date>2021-09-27T17:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to SQL Server Converts Empty Strings To NULL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770698#M39621</link>
      <description>&lt;P&gt;Why did you try to add those to the PROC SQL statement?&lt;/P&gt;
&lt;P&gt;Aren't those either connection options&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib sqlserver ... nullchar=no ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or dataset options?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table mylib.mytable(nullchar=no) as
  select *,' ' as empty_var
  from sashelp.class
;
quit;
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 17:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Writing-to-SQL-Server-Converts-Empty-Strings-To-NULL/m-p/770698#M39621</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-27T17:30:06Z</dc:date>
    </item>
  </channel>
</rss>

