<?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: run the macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536338#M147383</link>
    <description>&lt;P&gt;Great guidance Astounding. It might help me move forward to the article n my&amp;nbsp; data prep. I sent my friend to run it and she said it works.&lt;/P&gt;&lt;P&gt;Thank you so very much&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Feb 2019 04:28:13 GMT</pubDate>
    <dc:creator>chuie</dc:creator>
    <dc:date>2019-02-18T04:28:13Z</dc:date>
    <item>
      <title>run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536300#M147357</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Can anyone of you run the following code and attached the data set it generate?This is from the article attached url -page # 4 My SAS is expired and now in proceed of renewing the licence.I would like to learn in depth about this article until I get my licence renewed.&lt;/P&gt;&lt;P&gt;Thant would be great help&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options mprint mlogic sympblegen;
%macro generate(EmpCount =%str()
,AvgCoLambda=
,UserGrpLambda=
,MaxRepeats= );
data CallsPerHour;
/*Assume base rate is in hour per 1000 Emps*/
do emps= &amp;amp;EmpCount;
do repeats=1 to &amp;amp;MaxRepeats;
/*Average company*/
CoType="Avg ";
EmpsAtCo=emps;
calls=rand('POISSON',&amp;amp;AvgCoLambda);
output;
/*Average company with user group*/
CoType="AvgWUserGroup";
EmpsAtCo=emps;
calls=rand('POISSON',&amp;amp;UserGrpLambda);
output;
/*you can add additional company types here*/
/*A consulting company?-w/ a different lambda*/
end; /*do repeats=1 to 5;*/
end; /*do emps= &amp;amp; EmpCount;*/
run;
proc greplay nofs IGOut=GSeg;
delete _all_;
quit;;
proc univariate data=CallsPerHour normal;
var calls;
/* freq calls;*/
histogram calls /midpoints =1 to 20 by 1;;
run;
Proc sort data=CallsPerHour;
by CoType emps;
run;
s&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://www.lexjansen.com/nesug/nesug10/sa/sa04.pdf" target="_self"&gt;https://www.lexjansen.com/nesug/nesug10/sa/sa04.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2019 23:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536300#M147357</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-17T23:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536304#M147359</link>
      <description>You can sign up for SAS Academics on Demand for free, which is cloud based or you can use SAS University Edition. If this is commercial usage, we would be breaking rules so you can do that on your own.</description>
      <pubDate>Sun, 17 Feb 2019 23:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536304#M147359</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-17T23:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536308#M147362</link>
      <description>&lt;P&gt;Reeza, This is not for any commercial use . I am genuinely asking for help and I would like to at least&amp;nbsp; prepare for my data the way it is in this article.I hope you understand my situation.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 01:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536308#M147362</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-18T01:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536310#M147363</link>
      <description>&lt;P&gt;Then you can use Academics on Demand. Any reason you can't do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: you do not need to be in University or an 'academic' to use either SAS University Edition or Academics on Demand (independent learner). You can access it here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/en_us/software/on-demand-for-academics.html" target="_blank"&gt;https://www.sas.com/en_us/software/on-demand-for-academics.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or SAS UE here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/en_us/software/university-edition.html" target="_blank"&gt;https://www.sas.com/en_us/software/university-edition.html&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130917"&gt;@chuie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Reeza, This is not for any commercial use . I am genuinely asking for help and I would like to at least&amp;nbsp; prepare for my data the way it is in this article.I hope you understand my situation.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 01:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536310#M147363</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-18T01:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536313#M147364</link>
      <description>This code does nothing.  It is the beginning of a macro definition.  For the code to do anything, the definition would need to be completed, and the macro would need to be called, with values supplied for the macro parameters.</description>
      <pubDate>Mon, 18 Feb 2019 01:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536313#M147364</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-18T01:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536318#M147368</link>
      <description>The rest of the code is on the next page of the article, OP only copied the first portion but the article has the full code.</description>
      <pubDate>Mon, 18 Feb 2019 01:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536318#M147368</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-18T01:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536321#M147371</link>
      <description>&lt;P&gt;Thank you Astounding. I am no knowledge of macro so I do not know. The article says that this is the code used to generate the data used in this article. If you could just give me how the data is arranged with the variable name used&amp;nbsp; in the code above that would be very very helpful to follow along the article and to do same analysis using my data.&lt;/P&gt;&lt;P&gt;So based on the code below, it looks like we just need three variables, 1. cotype, 2. emps and 3. calls&lt;/P&gt;&lt;P&gt;is this as simple as :&lt;/P&gt;&lt;P&gt;cotype&amp;nbsp; &amp;nbsp; emps&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;calls&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;120&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 130&lt;/P&gt;&lt;P&gt;... and so one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=CallsPerHour normal;&lt;BR /&gt;by CoType emps;&lt;BR /&gt;var calls;&lt;BR /&gt;histogram calls /midpoints =1 to 15 by 1;&lt;BR /&gt;run;&lt;BR /&gt;run; %mend generate;&lt;BR /&gt;%generate(EmpCount=%str(1000, 3000, 5000,10000 )&lt;BR /&gt;,AvgCoLambda=8&lt;BR /&gt;,UserGrpLambda=5&lt;BR /&gt;,MaxRepeats=50 );&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 01:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536321#M147371</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-18T01:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536322#M147372</link>
      <description>Also i have reached out to author and have not heard back from him yet.</description>
      <pubDate>Mon, 18 Feb 2019 01:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536322#M147372</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-18T01:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536323#M147373</link>
      <description>i could but I will have sas anyway in few days... This ask was just to follow along to the article and to do that I need to understand the dataset layout.If I could have option to wait then why would I work on sunday evening &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ( plus 20 months son)</description>
      <pubDate>Mon, 18 Feb 2019 01:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536323#M147373</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-18T01:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536330#M147375</link>
      <description>&lt;P&gt;I can't explain what the code is supposed to do.&amp;nbsp; I leave that part to you.&amp;nbsp; But I can give you some guidance on how to turn this into something you can run and play with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get rid of the macro language.&amp;nbsp; So the %macro statement and %mend statements get removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any time you see &amp;amp;, replace that with a reasonable value.&amp;nbsp; For example, the code contains:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do Emp = &amp;amp;EmpCount;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace that, possibly with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do Emp = 1000, 3000, 5000, 10000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code also contains:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do repeats = 1 to &amp;amp;MaxRepeats;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace that, possibly with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do repeats = 1 to 50;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code contains:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calls = rand("POISSON", &amp;amp;userGrpLambda);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace that, possibly with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calls = rand("POISSON", 5);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, try replacing &amp;amp;AvgCoLambda with 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't tell you what values to use.&amp;nbsp; But choosing reasonable values and replacing the macro language will give you a look at what the program is supposed to do.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 02:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536330#M147375</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-18T02:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: run the macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536338#M147383</link>
      <description>&lt;P&gt;Great guidance Astounding. It might help me move forward to the article n my&amp;nbsp; data prep. I sent my friend to run it and she said it works.&lt;/P&gt;&lt;P&gt;Thank you so very much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 04:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-the-macro/m-p/536338#M147383</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2019-02-18T04:28:13Z</dc:date>
    </item>
  </channel>
</rss>

