<?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 store variable in the program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464794#M118525</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a report that I need to create each month.&lt;/P&gt;&lt;P&gt;The problem I'm facing when I'm trying&amp;nbsp;to program it, I'm finding difficulties&amp;nbsp;bc for the following reason.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a sample of the dataset and the program;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TaskStatus&lt;/TD&gt;&lt;TD&gt;CompleteDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Asterias2;&lt;BR /&gt;set Asterias1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if taskstatus="Assigned" and completedate="&amp;nbsp; "&amp;nbsp; then count=1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let thismonthn=%sysfunc(today(),MONNAME.) ;&lt;BR /&gt;%put &amp;amp;thismonthn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Asterias3 as&lt;BR /&gt;select&lt;BR /&gt;&amp;nbsp;sum(count) as &amp;amp;thismonthn&lt;BR /&gt;from asterias2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the problem I'm having that I'm having I need to create the variable&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;amp;thismonthn and&amp;nbsp; I&amp;nbsp;also want to be able to store the outcomes&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the next month when I run the program again I will have &amp;amp;thismonmthn and prior month&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 May 2018 15:00:55 GMT</pubDate>
    <dc:creator>mona4u</dc:creator>
    <dc:date>2018-05-24T15:00:55Z</dc:date>
    <item>
      <title>store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464794#M118525</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a report that I need to create each month.&lt;/P&gt;&lt;P&gt;The problem I'm facing when I'm trying&amp;nbsp;to program it, I'm finding difficulties&amp;nbsp;bc for the following reason.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a sample of the dataset and the program;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TaskStatus&lt;/TD&gt;&lt;TD&gt;CompleteDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assigned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Asterias2;&lt;BR /&gt;set Asterias1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if taskstatus="Assigned" and completedate="&amp;nbsp; "&amp;nbsp; then count=1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let thismonthn=%sysfunc(today(),MONNAME.) ;&lt;BR /&gt;%put &amp;amp;thismonthn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Asterias3 as&lt;BR /&gt;select&lt;BR /&gt;&amp;nbsp;sum(count) as &amp;amp;thismonthn&lt;BR /&gt;from asterias2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the problem I'm having that I'm having I need to create the variable&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;amp;thismonthn and&amp;nbsp; I&amp;nbsp;also want to be able to store the outcomes&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the next month when I run the program again I will have &amp;amp;thismonmthn and prior month&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 15:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464794#M118525</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-05-24T15:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464798#M118528</link>
      <description>&lt;P&gt;The easiest way to store data is in a permanent SAS data set, then it can be used in future runs of the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this part isn't really clear&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;the problem I'm having that I'm having I need to create the variable&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;amp;thismonthn and&amp;nbsp; I&amp;nbsp;also want to be able to store the outcomes&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;and the next month when I run the program again I will have &amp;amp;thismonmthn and prior month&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean you want the count and the month to be&amp;nbsp;stored, and the values from previous months also stored in the same place?? If so, you could certainly use PROC APPEND to add the current months results to the results of previous months.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 15:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464798#M118528</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-24T15:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464800#M118529</link>
      <description>next month I have to create a variable of the current month and I have to have the variable of the prior month too</description>
      <pubDate>Thu, 24 May 2018 15:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464800#M118529</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-05-24T15:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464804#M118532</link>
      <description>&lt;P&gt;Here's what you get with PROC APPEND, does this meet your needs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;MONTH      COUNT
012018             38
022018             57
032018             45
...&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 15:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464804#M118532</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-24T15:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464806#M118534</link>
      <description>I'm Joining the dataset horizontally</description>
      <pubDate>Thu, 24 May 2018 15:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464806#M118534</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-05-24T15:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464808#M118536</link>
      <description>&lt;P&gt;Show us an example of what you want, for say three or four months of results.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 15:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464808#M118536</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-24T15:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: store variable in the program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464810#M118537</link>
      <description>&lt;P&gt;I got the idea.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 15:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/store-variable-in-the-program/m-p/464810#M118537</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-05-24T15:22:46Z</dc:date>
    </item>
  </channel>
</rss>

