<?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: Date values are not populated into SAS result set from DB2 stored procedure in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70980#M20467</link>
    <description>I assume that you have tested you stored procedure outside SAS already.&lt;BR /&gt;
Does the call work but your SAS table will be empty? What are the values of SQLXRC and SQLXMSG macro variables? Any usable hints from the SAS LOG?&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
    <pubDate>Mon, 26 Jan 2009 14:25:05 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-01-26T14:25:05Z</dc:date>
    <item>
      <title>Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70979#M20466</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I amn't able to populate the date field values into SAS datasets when I tried to populate the dataset as a resultset of a DB2 stored procedure.&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;DB2 Procedure&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
CREATE PROCEDURE sas.SASSP0003(in id_start decimal(10), in id_end decimal(10)) &lt;BR /&gt;
 LANGUAGE SQL &lt;BR /&gt;
 DYNAMIC RESULT SETS 1 &lt;BR /&gt;
BEGIN &lt;BR /&gt;
 DECLARE C1 CURSOR with return FOR SELECT START_DT from sas.srctbl where id between id_start and id_end;  &lt;BR /&gt;
 OPEN C1;  &lt;BR /&gt;
END&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;PROC SQL&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
connect to db2(user=userName password=Password database=sasdev);&lt;BR /&gt;
create table UsrLib.TEMPSASTBL as select * from connection to db2&lt;BR /&gt;
(call sas.SASSP0003(100001,100020)) ;&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help me to get the date values accordingly?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Fri, 23 Jan 2009 15:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70979#M20466</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-23T15:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70980#M20467</link>
      <description>I assume that you have tested you stored procedure outside SAS already.&lt;BR /&gt;
Does the call work but your SAS table will be empty? What are the values of SQLXRC and SQLXMSG macro variables? Any usable hints from the SAS LOG?&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Mon, 26 Jan 2009 14:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70980#M20467</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-26T14:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70981#M20468</link>
      <description>Thanks for showing interest to help me&lt;BR /&gt;
&lt;BR /&gt;
I am able to invoke the above procedure at db2 end using the same call statement that I used in PROC SQL successfully and able to see the date values accordingly.&lt;BR /&gt;
&lt;BR /&gt;
Here I am giving you the log details as well.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The data value for column START_DT (START_DT) was truncated or was out of range 4 times when retrieving that data from the &lt;BR /&gt;
      DBMS.&lt;BR /&gt;
NOTE: Table USRLIB.TEMPSASTBL created, with 21 rows and 1 columns.&lt;BR /&gt;
&lt;BR /&gt;
25         %put SQLERRORCODE is &amp;amp;SQLXRC SQLERRORMesasage is &amp;amp;SQLXMSG ;&lt;BR /&gt;
SQLERRORCODE is 0 SQLERRORMesasage is&lt;BR /&gt;
26         QUIT;&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
Kindly revert,&lt;BR /&gt;
&lt;BR /&gt;
Thanks and Regards,&lt;BR /&gt;
AnjiReddy.</description>
      <pubDate>Tue, 27 Jan 2009 12:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70981#M20468</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-27T12:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70982#M20469</link>
      <description>This note goes for date values, but I think it's aplicable for datetime values as well. What kind of datetimes do you have in your DB2 table?&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/2/429.html" target="_blank"&gt;http://support.sas.com/kb/2/429.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 27 Jan 2009 12:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70982#M20469</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-27T12:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70983#M20470</link>
      <description>Thanks for your promptive response..&lt;BR /&gt;
&lt;BR /&gt;
The date column is defined as date datatype only. You can find the column definition&lt;BR /&gt;
&lt;BR /&gt;
START_DT                        SYSIBM    DATE                         4     0 Yes&lt;BR /&gt;
&lt;BR /&gt;
In DB2 editor, by default date values are displayed in the layout MM/DD/YYYY only.&lt;BR /&gt;
&lt;BR /&gt;
However I imported the table TEMPSASTBL into SAS repository and able to view the data as SAS displays the data in the layout DDMONYYYY&lt;BR /&gt;
&lt;BR /&gt;
Thanks once again Linus for your time.</description>
      <pubDate>Tue, 27 Jan 2009 14:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70983#M20470</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-27T14:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70984#M20471</link>
      <description>I haven't used stored procedures in DB2, so I'm on thin ice here...&lt;BR /&gt;
In DB2, dates can be represented between 0000-01-01 and 9999-12-31. In SAS, dates can range from 1582 and 20,000. My guess is that the DB2 stored procedure leave the data as numeric value (number of days after 0000-01-01), and SAS tries to interpret as number of days after 1960-01-01. &lt;BR /&gt;
&lt;BR /&gt;
Looking at your LOG, it seems that 17 rows were not truncated. If looking in SAS result table, are you finding the expected values there or not?&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 27 Jan 2009 14:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70984#M20471</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-27T14:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70985#M20472</link>
      <description>The remaning 17 rows were having null values.&lt;BR /&gt;
Me too think that SAS internally tries to convert the date values into numerics</description>
      <pubDate>Wed, 28 Jan 2009 04:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70985#M20472</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-28T04:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date values are not populated into SAS result set from DB2 stored procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70986#M20473</link>
      <description>I don't think I can help you any further. I suggest that you open a track on SAS support.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 28 Jan 2009 10:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-values-are-not-populated-into-SAS-result-set-from-DB2/m-p/70986#M20473</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-28T10:28:58Z</dc:date>
    </item>
  </channel>
</rss>

