<?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: create a parameter of a date value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454395#M114852</link>
    <description>&lt;P&gt;Sorry.You are right. I run &amp;nbsp;it again and it is working.Thank you anyway&lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 10:47:41 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2018-04-16T10:47:41Z</dc:date>
    <item>
      <title>create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454389#M114847</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to create a parameter of a date value and &amp;nbsp;use it to take all rows with date higher than &amp;nbsp;&lt;SPAN&gt;01Apr2017.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone please explain why it is not working and what is the correct code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;nbsp;a lot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data aaa;&lt;BR /&gt;length LOC_ID $8 Date Demand 8;&lt;BR /&gt;LOC_ID = "C1";&lt;BR /&gt;demand = 0;&lt;BR /&gt;do Date = '01JAN2017'd to '30JUN2017'd;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454389#M114847</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-16T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454390#M114848</link>
      <description>&lt;P&gt;sorry.Here is the code.Why is it no working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data aaa;&lt;BR /&gt;length LOC_ID $8 Date Demand 8;&lt;BR /&gt;LOC_ID = "C1";&lt;BR /&gt;demand = 0;&lt;BR /&gt;do Date = '01JAN2017'd to '30JUN2017'd;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data bbb;&lt;BR /&gt;set aaa;&lt;BR /&gt;format Date date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let monParam='01Apr2017'd;&lt;BR /&gt;Data Want;&lt;BR /&gt;SET bbb;&lt;BR /&gt;IF Date&amp;gt;&amp;amp;monParam.;&lt;BR /&gt;Run;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454390#M114848</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-16T10:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454391#M114849</link>
      <description>&lt;P&gt;I get no errors from running the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post your log and what yoy consider "not working".&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454391#M114849</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-04-16T10:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454392#M114850</link>
      <description>&lt;P&gt;Also, your second data step is redundant. Simple use the FORMAT Statement in your first data step.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454392#M114850</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-04-16T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454393#M114851</link>
      <description>&lt;P&gt;Please define "not working".&amp;nbsp; After tidying up your code and dropping the unnecessary datastep the code works perfectly:&lt;/P&gt;
&lt;PRE&gt;data aaa;
  length loc_id $8 date demand 8;
  loc_id="C1";
  demand=0;
  do date='01JAN2017'd to '30JUN2017'd;
    output;
  end;
  format date date9.;
run;

%let monparam='01Apr2017'd;
data want;
  set aaa;
  if date &amp;gt; &amp;amp;monParam.;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454393#M114851</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-16T10:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter of a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454395#M114852</link>
      <description>&lt;P&gt;Sorry.You are right. I run &amp;nbsp;it again and it is working.Thank you anyway&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 10:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-of-a-date-value/m-p/454395#M114852</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-04-16T10:47:41Z</dc:date>
    </item>
  </channel>
</rss>

