<?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: How to filter Db2 dates in SAS dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453447#M114583</link>
    <description>I was asked to use explicit pass-through.&lt;BR /&gt;</description>
    <pubDate>Thu, 12 Apr 2018 05:39:37 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2018-04-12T05:39:37Z</dc:date>
    <item>
      <title>How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453256#M114509</link>
      <description>&lt;P&gt;I've the following code to filter values in Db2 table but I end up with error like "CLI describe error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0103N The numeric literal "31MAR2018" is not valid. SQLSTATE=42604"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Value of macro variable REPORTING_DATE resolves to&amp;nbsp;&lt;STRONG&gt;31MAR2018. &lt;/STRONG&gt;Could you please help me to resolve this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select * 
	    from connection to &amp;amp;glb_db2. 
			( 
			SELECT DISTINCT
			D1IPAR,
			MTD
	     	FROM U.TBFQ81
			WHERE D1NDBT = 'TBFR22' and PDK = '4' AND D1IPAR is not null and MTD=&amp;amp;REPORTING_DATE.
			)
        ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453256#M114509</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-04-11T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453295#M114532</link>
      <description>&lt;P&gt;DB/2 uses a different format for date literals. Ask your DB/2 people how you need to provide the date in the pass-through. Or do a google search for "db2 date literal".&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 17:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453295#M114532</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-11T17:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453317#M114537</link>
      <description>Sure. Just to inform you that I could see the DB2 table (might be&lt;BR /&gt;registered) in SAS DI Studio and it has the value 31MAR2018 (which I'm&lt;BR /&gt;looking for) and it has date9. format.&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Apr 2018 17:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453317#M114537</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-04-11T17:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453326#M114541</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;Sure. Just to inform you that I could see the DB2 table (might be&lt;BR /&gt;registered) in SAS DI Studio and it has the value 31MAR2018 (which I'm&lt;BR /&gt;looking for) and it has date9. format.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's because SAS uses its own display formats in its world. But in an explicit pass-through, you have to adhere to the rules of the DBMS.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 18:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453326#M114541</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-11T18:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453431#M114580</link>
      <description>Using explicit pass through is over complicating nd should only be used when performance improvements can be expected, which is not the case here.&lt;BR /&gt;Use a libname connection and you don't have to bother about target RDBMS date formats.</description>
      <pubDate>Thu, 12 Apr 2018 02:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453431#M114580</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-04-12T02:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453447#M114583</link>
      <description>I was asked to use explicit pass-through.&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453447#M114583</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-04-12T05:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453451#M114584</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;I was asked to use explicit pass-through.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you have to use DB/2 syntax, period.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW as a SAS developer, it is often your job to make it clear to persons who have no clue (at least about SAS) which solution is better. Just that somebody says "do it this way" does in no way implicate they know what they're talking about. In fact, people trying to force you to do something in &lt;EM&gt;their&lt;/EM&gt; preferred way is usually a sign of galloping stupidity on their side.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453451#M114584</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-12T05:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Db2 dates in SAS dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453475#M114586</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I've the following code to filter values in Db2 table but I end up with error like "CLI describe error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0103N The numeric literal "31MAR2018" is not valid. SQLSTATE=42604"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Value of macro variable REPORTING_DATE resolves to&amp;nbsp;&lt;STRONG&gt;31MAR2018. &lt;/STRONG&gt;Could you please help me to resolve this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select * 
	    from connection to &amp;amp;glb_db2. 
			( 
			SELECT DISTINCT
			D1IPAR,
			MTD
	     	FROM U.TBFQ81
			WHERE D1NDBT = 'TBFR22' and PDK = '4' AND D1IPAR is not null and MTD=&amp;amp;REPORTING_DATE.
			)
        ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Like in SAS you need to tell the DB2 that the string you're passing in needs to get converted to a datetime value. Just Googling in quickly it appears that DB2 has a &lt;STRONG&gt;TO_DATE()&lt;/STRONG&gt; function for this.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0007109.html&amp;nbsp;" target="_blank"&gt;https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0007109.html&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 09:12:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-filter-Db2-dates-in-SAS-dataset/m-p/453475#M114586</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-04-12T09:12:31Z</dc:date>
    </item>
  </channel>
</rss>

