<?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: Can I loop this process? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485200#M31433</link>
    <description>&lt;P&gt;If you run the PROC MEANS with out the WHERE statement, you get&amp;nbsp;one output data set containing the means of each month. There's no need to run 12 different PROC MEANS here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you try to create data set AVRG, this is where you start doing things that probably ought to be avoided. Turning a long data set into a wide data set usually is not a good idea, it doesn't help you in the future analyses you want to do (although I suppose there are always exceptions). So, without strong justification, there is no need to loop this either.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 15:59:16 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-08-08T15:59:16Z</dc:date>
    <item>
      <title>Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485197#M31432</link>
      <description>&lt;P&gt;I have never done any loops so I don't know if this process can be done but Can I code this so I don't have to do it for all 12 Months?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I'm doing:&lt;/P&gt;&lt;PRE&gt;proc means data=have;
where Month in (1);
by Month hour;
var Lo Te De Wi CC Sr Rf;
output out=MeanJan mean=;
run;

proc means data=have;
where Month in (2);
by Month hour;
var Lo Te De Wi CC Sr Rf;
output out=MeanFeb mean=;
run;

data avrg;
merge 
	MeanJan(rename=(Lo=LeJan
					Te=TeJan
					De=DeJan
					Wi=WiJan
					CC=CCJan
					SR=SRJan
					RF=RFJan))
	MeanFeb(rename=(Lo=LoFeb
					Te=TeFeb
					De=DeFeb
					Wi=WiFeb
					CCr=CCFeb
					Sr=SRFeb
					Rfl=RFFeb))
;
by Hour;
keep LeJan TeJan.........;
run;

&lt;/PRE&gt;&lt;P&gt;If I can loop this, how?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 15:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485197#M31432</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-08-08T15:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485200#M31433</link>
      <description>&lt;P&gt;If you run the PROC MEANS with out the WHERE statement, you get&amp;nbsp;one output data set containing the means of each month. There's no need to run 12 different PROC MEANS here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you try to create data set AVRG, this is where you start doing things that probably ought to be avoided. Turning a long data set into a wide data set usually is not a good idea, it doesn't help you in the future analyses you want to do (although I suppose there are always exceptions). So, without strong justification, there is no need to loop this either.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 15:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485200#M31433</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485206#M31435</link>
      <description>I know but how would I make new variables for every month ?&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485206#M31435</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-08-08T16:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485208#M31436</link>
      <description>&lt;P&gt;Why do you want new variables for each month? What analysis are you going to do with all of these variables once you have them?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485208#M31436</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T16:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485212#M31437</link>
      <description>I just need this for a basic sgplot with series. I know I can just use&lt;BR /&gt;group=month but my version of sas does not have the new options to play&lt;BR /&gt;with individual lines and stuff when it's grouped by month. So I'm trying&lt;BR /&gt;to do sgplot with individual series for each month.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485212#M31437</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-08-08T16:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485215#M31439</link>
      <description>&lt;P&gt;If you mean options like GROUPLP, GROUPLC and GROUPMC in PROC SGPLOT, yes, they are not in older versions of SGPLOT. However the STYLEATTRS statement is still available in PROC SGPLOT to control line colors and line patterns and markers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, don't do the huge amount of work to make separate columns. Use PROC SGPLOT with GROUP= and STYLEATTRS. It's a huge amount simpler, and less error prone.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485215#M31439</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T16:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485216#M31440</link>
      <description>Yea I know and I tried. But I have an older version of SAS EG so I don't&lt;BR /&gt;have styleattrs or mapattrs so I don't really have a choice. Thank you&lt;BR /&gt;though&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485216#M31440</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-08-08T16:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485217#M31441</link>
      <description>&lt;P&gt;If your version is really that old — PLEASE STATE THE VERSION NUMBER OF SAS THAT YOU HAVE by opening Enterprise Guide and the run the following statement: &lt;FONT face="courier new,courier"&gt;proc setinit; run;&lt;/FONT&gt; — you can then use PROC GPLOT and you still don't need to create all of these columns.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485217#M31441</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T16:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I loop this process?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485218#M31442</link>
      <description>&lt;P&gt;Even with your restrictions, you would do better to keep the data in one data set.&amp;nbsp; Just apply the WHERE statement later, in the plotting procedure.&amp;nbsp; Even if using a BY statement isn't feasible, looping isn't all that difficult.&amp;nbsp; Get a version that works for one month, and we can expand it to all 12 months, using just one summary data set.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-loop-this-process/m-p/485218#M31442</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-08T16:52:09Z</dc:date>
    </item>
  </channel>
</rss>

