<?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: Extracting a variables by date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272493#M54207</link>
    <description>&lt;P&gt;Thanks ballardw! I try it but it did not work.&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2016 18:00:24 GMT</pubDate>
    <dc:creator>jflo36</dc:creator>
    <dc:date>2016-05-23T18:00:24Z</dc:date>
    <item>
      <title>Extracting a variables by date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272459#M54196</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to extract variables &amp;nbsp;from a dataset by certain date, but my code is not working. I will get the columns header with 0 rows.&lt;/P&gt;
&lt;P&gt;can someone please help? attached is the code I use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE TEST AS &lt;BR /&gt;SELECT CURRENT_DATE, BLANK_NUMBER&lt;BR /&gt;FROM BLANK.DATA&lt;BR /&gt;WHERE CURRENT_DATE IN (04-01-2016 - 04-30-2016);&lt;BR /&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 16:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272459#M54196</guid>
      <dc:creator>jflo36</dc:creator>
      <dc:date>2016-05-23T16:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a variables by date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272484#M54203</link>
      <description>&lt;P&gt;You should have gotten error messages with that code. In the future if you have code throwing errors include the log with the code and the error messages for best results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your current_date is an actual SAS date value then you do comparisons with literal values using "ddMONYYYY"D syntax. That is the only allowable form for explicit dates. So you likely needed to use "01APR2016"d and "30APR2016"d. Second the IN operator doesn't use a - to indicate a range, use : instead&amp;nbsp;&amp;nbsp; in( 1:10) is range of 1 to 10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easier in this case may be to use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where Month(Current_date) = 4&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;where Current_date is between "01APR2016"d and "30APR2016"d;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 17:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272484#M54203</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-23T17:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a variables by date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272493#M54207</link>
      <description>&lt;P&gt;Thanks ballardw! I try it but it did not work.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 18:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272493#M54207</guid>
      <dc:creator>jflo36</dc:creator>
      <dc:date>2016-05-23T18:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a variables by date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272559#M54239</link>
      <description>&lt;P&gt;Please show the Log of the submitted code and any error messages. "Didn't work" is awful vague to try to work with.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2016 20:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-a-variables-by-date/m-p/272559#M54239</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-23T20:38:30Z</dc:date>
    </item>
  </channel>
</rss>

