<?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: dataset is not aggregating. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596115#M171591</link>
    <description>&lt;P&gt;I don't see any code that is doing any aggregation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just some filtering via a subsetting IF and coping one variable into another via an assignment statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the 2nd and 3rd work and the 1st doesn't then perhaps the variable you are copying from is not on the input dataset for that step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your macro with the MPRINT option and carefully review that code that it generates and runs. Perhaps there is a typo somewhere that will be easier to see in the log then in the source code.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Oct 2019 21:38:57 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-13T21:38:57Z</dc:date>
    <item>
      <title>dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596105#M171588</link>
      <description>&lt;P&gt;I am not very good in SAS and would like to know what is going on with the code below, could someone explain me as simple as possible what is going on?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially, I am having issues in aggregating everything correctly, I do not know why in &lt;CODE class=" language-sas"&gt;data io3_&amp;amp;currioyr&lt;/CODE&gt;, none of the aggregate are being aggregated; however, in&amp;nbsp;&lt;CODE class=" language-sas"&gt;data io1_&amp;amp;currioyr and&amp;nbsp;data io2_&amp;amp;currioyr, everything is fine...&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;Thanks a lot!&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro price_series;
	%do currioyr = &amp;amp;b_ioyear %to &amp;amp;e_ioyear;

/* io1 is current dollar output for the previous year, (Pt-1*Qt-1) */

data io1_&amp;amp;currioyr;
set itemoutput2;
if basingyear=%eval(&amp;amp;currioyr-1) and ioyear=%eval(&amp;amp;currioyr-1);
*if basingyear=&amp;amp;previoyr. and ioyear=&amp;amp;previoyr.;
io1_proval=proval;
drop pi proval basingyear ioyear;

/* io2 is current dollar output for the current year, (Pt*Qt)*/

data io2_&amp;amp;currioyr;
set itemoutput2;
if basingyear=&amp;amp;currioyr. and ioyear=&amp;amp;currioyr.;
io2_proval=proval;
drop pi proval basingyear ioyear;

/* io3 is simply the price ratio (Pt/Pt-1), PI column from the itemoutput table */

data io3_&amp;amp;currioyr;
set itemoutput2;
if basingyear=%eval(&amp;amp;currioyr-1) and ioyear=&amp;amp;currioyr.;
io3_pi=pi;
drop basingyear ioyear proval pi;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Oct 2019 20:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596105#M171588</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-10-13T20:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596115#M171591</link>
      <description>&lt;P&gt;I don't see any code that is doing any aggregation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just some filtering via a subsetting IF and coping one variable into another via an assignment statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the 2nd and 3rd work and the 1st doesn't then perhaps the variable you are copying from is not on the input dataset for that step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your macro with the MPRINT option and carefully review that code that it generates and runs. Perhaps there is a typo somewhere that will be easier to see in the log then in the source code.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 21:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596115#M171591</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-13T21:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596134#M171600</link>
      <description>&lt;P&gt;Why do you say it is supposed to be "aggregating"? Aggregating what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your question "what is going on" meaning what does the code do? Or does your question "what is going on" mean: why isn't it aggregating? Or does your question "what is going on" mean something else?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 01:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596134#M171600</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-14T01:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596142#M171605</link>
      <description>&lt;P&gt;Paige so I basically need to know what is going on, essentially I have some variables that from the first and second data sets are no being imported to the third data set. Those variable are the aggregates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My apologies for not being clear and thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 02:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596142#M171605</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-10-14T02:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596161#M171609</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105695"&gt;@Afor910327&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Paige so I basically need to know what is going on, essentially I have some variables that from the first and second data sets are no being imported to the third data set. Those variable are the aggregates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My apologies for not being clear and thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are running three data steps. Each one is reading from the same source.&amp;nbsp; So of course anything done in the first or second step is not reflected in the third step since it is again reading from the same unmodified input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to explain what you are trying to do.&amp;nbsp; Perhaps you can just do it all in one data step.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 05:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596161#M171609</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-14T05:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: dataset is not aggregating.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596215#M171634</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105695"&gt;@Afor910327&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Paige so I basically need to know what is going on, essentially I have some variables that from the first and second data sets are no being imported to the third data set. Those variable are the aggregates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My apologies for not being clear and thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm afraid this doesn't make anything clearer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exactly why are you using the word "aggregates" or "aggregating" here? What is supposed to be aggregating? Where in the code is the aggregating supposed to happen?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your question that you keep repeating the phrase "what is going on"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In other words, provide a lot more details.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-is-not-aggregating/m-p/596215#M171634</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-14T12:29:15Z</dc:date>
    </item>
  </channel>
</rss>

