<?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: Filter datetime25.6 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387237#M65849</link>
    <description>&lt;P&gt;You should make it a point to post syntactically valid code.&lt;/P&gt;
&lt;P&gt;Your data step produces this log:&lt;/P&gt;
&lt;PRE&gt;24         Data_null_;
           __________
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

25         Format c date7. e date7.;
           ______
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

26         C= datepart (datwtime ();
           _
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

27         E=c+7;
           _
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

28         Call symput ('cdate2', " ' " | |vvalue (e) | |" 'd");
           ____
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

29         Call symput ('cdate', " ' " | |vvalue (c) | |" 'd");
           ____
           180

2                                                          Das SAS System                              08:44 Friday, August 11, 2017

ERROR 180-322: Statement is not valid or it is used out of proper order.

WARNING: Apparent symbolic reference CDATE2 not resolved.
30         
31         %put &amp;amp;cdate2. ;
&amp;amp;cdate2.
32         %put &amp;amp;cdate.;
WARNING: Apparent symbolic reference CDATE not resolved.
&amp;amp;cdate.
&lt;/PRE&gt;
&lt;P&gt;So the people that are supposed to help you will first have to fix that heap of bugs.&lt;/P&gt;
&lt;P&gt;Note that posting code into the main posting window will reformat, drop blanks, replace certain character combinations with smileys, etc.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Use the {i} or "little running man" buttons for posting code!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;(I've probably written that a thousand times now, memo to self: create keyboard macro)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A condition like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE AL1.trans datepart (AL1,TRANS)&amp;gt;&amp;amp;CDATE2 AND DATEPART (AL1.TRANS)=&amp;lt;&amp;amp;CDATE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;wont't work in a data step or proc sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post the code you really ran. You just need to copy/paste that working code into one of the windows mentioned above.&lt;/P&gt;
&lt;P&gt;And post the attributes of the variable al1.trans (type, length, format).&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2017 06:58:37 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-08-11T06:58:37Z</dc:date>
    <item>
      <title>Filter datetime25.6</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387229#M65847</link>
      <description>Hi I need to filter a datetime25.6&lt;BR /&gt;I have a libname&lt;BR /&gt;Libname ecdb odbc dsn= ec user= me password=@@@ schema=ec;&lt;BR /&gt;&lt;BR /&gt;Data_null_;&lt;BR /&gt;Format c date7. e date7.;&lt;BR /&gt;C= datepart (datwtime ();&lt;BR /&gt;E=c+7;&lt;BR /&gt;Call symput ('cdate2', " ' " | |vvalue (e) | |" 'd");&lt;BR /&gt;Call symput ('cdate', " ' " | |vvalue (c) | |" 'd");&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;cdate2. ;&lt;BR /&gt;%put &amp;amp;cdate.;&lt;BR /&gt;My where statement&lt;BR /&gt;WHERE AL1.trans datepart (AL1,TRANS)&amp;gt;&amp;amp;CDATE2 AND DATEPART (AL1.TRANS)=&amp;lt;&amp;amp;CDATE;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It does id the date but it doesn't complete the query it just says proc sql running in my log it shows macro variable cdate2 resolves to '18Aug17' d&lt;BR /&gt;variable cdate resolves to '11Aug17' d&lt;BR /&gt;&lt;BR /&gt;Thanks for assistance</description>
      <pubDate>Fri, 11 Aug 2017 05:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387229#M65847</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-08-11T05:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter datetime25.6</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387235#M65848</link>
      <description>&lt;P&gt;Is that all your code ?&lt;/P&gt;
&lt;P&gt;If YES than you have mixed data step code with sql code.&lt;/P&gt;
&lt;P&gt;if NOT please post your full code or log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyhow, your where staement relates only to the DATEPART and not to the time.&lt;/P&gt;
&lt;P&gt;Please explain your issue with an example - what havr you expected and what have you got .&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 06:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387235#M65848</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-11T06:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter datetime25.6</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387237#M65849</link>
      <description>&lt;P&gt;You should make it a point to post syntactically valid code.&lt;/P&gt;
&lt;P&gt;Your data step produces this log:&lt;/P&gt;
&lt;PRE&gt;24         Data_null_;
           __________
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

25         Format c date7. e date7.;
           ______
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

26         C= datepart (datwtime ();
           _
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

27         E=c+7;
           _
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

28         Call symput ('cdate2', " ' " | |vvalue (e) | |" 'd");
           ____
           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

29         Call symput ('cdate', " ' " | |vvalue (c) | |" 'd");
           ____
           180

2                                                          Das SAS System                              08:44 Friday, August 11, 2017

ERROR 180-322: Statement is not valid or it is used out of proper order.

WARNING: Apparent symbolic reference CDATE2 not resolved.
30         
31         %put &amp;amp;cdate2. ;
&amp;amp;cdate2.
32         %put &amp;amp;cdate.;
WARNING: Apparent symbolic reference CDATE not resolved.
&amp;amp;cdate.
&lt;/PRE&gt;
&lt;P&gt;So the people that are supposed to help you will first have to fix that heap of bugs.&lt;/P&gt;
&lt;P&gt;Note that posting code into the main posting window will reformat, drop blanks, replace certain character combinations with smileys, etc.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Use the {i} or "little running man" buttons for posting code!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;(I've probably written that a thousand times now, memo to self: create keyboard macro)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A condition like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE AL1.trans datepart (AL1,TRANS)&amp;gt;&amp;amp;CDATE2 AND DATEPART (AL1.TRANS)=&amp;lt;&amp;amp;CDATE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;wont't work in a data step or proc sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post the code you really ran. You just need to copy/paste that working code into one of the windows mentioned above.&lt;/P&gt;
&lt;P&gt;And post the attributes of the variable al1.trans (type, length, format).&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 06:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387237#M65849</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-11T06:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter datetime25.6</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387494#M65860</link>
      <description>Hi thanks for the assistance I fig out the issue I was creating a proc sql table with connection to my odbc... o.n my from statement I refer the lib ..obce I corrected it worked an pull in the date range</description>
      <pubDate>Fri, 11 Aug 2017 21:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Filter-datetime25-6/m-p/387494#M65860</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-08-11T21:10:03Z</dc:date>
    </item>
  </channel>
</rss>

