<?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: PROC SQL Oracle pass through  - passing null values in date fields in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456592#M115663</link>
    <description>&lt;P&gt;Need more information on how your adding the null values and what datatypes are your SAS tables and Oracle tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your trying to insert into a oracle table with one column all null values then use PROC APPEND. For example if your oracle table has 3 variables and your SAS has two variables then when you append the SAS table to Oracle table with only 2 variables then null values are automatically inserted into the missing variable.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 16:25:24 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-04-23T16:25:24Z</dc:date>
    <item>
      <title>PROC SQL Oracle pass through  - passing null values in date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456568#M115657</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in passing blank values in DATE fields of the end Oracle Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am connectting to ORacle with direct pass through option and pulling some data and mapping them to insert into another oracle table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;BR /&gt;&amp;nbsp;Connect To Oracle(User=&amp;amp;Myid Orapw=&amp;amp;Mypwd Path="&amp;amp;Mydb");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Create Table Test&amp;nbsp; as Select * From Connection to Oracle&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; (select&amp;nbsp; -- 400 attributes--&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;NULL as paid_dt_orig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;Quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc contents on Test table -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;281&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;PAID_DT_ORIG&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; $.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAID_DT_ORIG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inserting&amp;nbsp; this data into another Oracle table using libname statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC SQL;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO DBMS.&amp;amp;MyTable&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;amp;colnames)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT &amp;amp;colnames_a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp; Test&amp;nbsp; A;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;%let NQ_COUNT=&amp;amp;SQLOBS;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;NQ_COUNT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the below error&amp;nbsp; for all the DATEf ields where i have mapped NULL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Value 17 on the SELECT clause does not match the data type of the corresponding column listed after the INSERT table name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is very huge. So&amp;nbsp; I can not do SAS formattings. IS there any easier way to update Proc SQL to create a blank date field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 15:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456568#M115657</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2018-04-23T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Oracle pass through  - passing null values in date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456592#M115663</link>
      <description>&lt;P&gt;Need more information on how your adding the null values and what datatypes are your SAS tables and Oracle tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your trying to insert into a oracle table with one column all null values then use PROC APPEND. For example if your oracle table has 3 variables and your SAS has two variables then when you append the SAS table to Oracle table with only 2 variables then null values are automatically inserted into the missing variable.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 16:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456592#M115663</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-04-23T16:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Oracle pass through  - passing null values in date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456615#M115671</link>
      <description>&lt;P&gt;So you created a variable in your ORACLE code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NULL as paid_dt_orig&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;that has all null values and NO TYPE.&lt;/P&gt;
&lt;P&gt;It looks like this caused SAS to make the rational decision that it should map that as a character variable of length 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you later try to load this character variable into an actual DATE variable in Oracle you will have a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can't you use a CAST() function in the pass thru Oracle code to create a date variable instead?&lt;/P&gt;
&lt;P&gt;Or an INPUT() function on the SAS side to convert the character string to a date before trying to upload it back into Oracle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 17:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456615#M115671</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-04-23T17:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Oracle pass through  - passing null values in date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456637#M115679</link>
      <description>Thanks Kiran. PROC APPEND worked fine and inserted the records without any error.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ana</description>
      <pubDate>Mon, 23 Apr 2018 18:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456637#M115679</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2018-04-23T18:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Oracle pass through  - passing null values in date fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456638#M115680</link>
      <description>Hi Tom, Data is very huge 800 million records, so i was going for easier way that formatting the data in SAS after the ORacle data pull. I will test CAST().</description>
      <pubDate>Mon, 23 Apr 2018 18:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-Oracle-pass-through-passing-null-values-in-date-fields/m-p/456638#M115680</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2018-04-23T18:48:03Z</dc:date>
    </item>
  </channel>
</rss>

