<?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: DO loops in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61458#M17445</link>
    <description>Hi:&lt;BR /&gt;
  This paper serves as an excellent intro to the SAS Macro Facility:&lt;BR /&gt;
 &lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 23 Feb 2010 19:53:01 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-02-23T19:53:01Z</dc:date>
    <item>
      <title>DO loops</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61455#M17442</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have some programs with multiple steps/procedures that I want to run with a loop. For example, the simplest one is: &lt;BR /&gt;
&lt;BR /&gt;
data reg_temp;&lt;BR /&gt;
   set hotelJPQ.TueDBA0L1_daily;&lt;BR /&gt;
   where (Week_Code&amp;gt;=1) AND (Week_Code&amp;lt;=4);&lt;BR /&gt;
run;&lt;BR /&gt;
PROC reg data=reg_temp outest=reg_out_temp; &lt;BR /&gt;
*      parms b0 b1;&lt;BR /&gt;
DEMAND: model demand = price;&lt;BR /&gt;
run;&lt;BR /&gt;
PROC EXPORT DATA= work.reg_out_temp&lt;BR /&gt;
	OUTFILE= "C:\Research\working papers\Joint price quant\Tue_SAS.xls"&lt;BR /&gt;
	DBMS=Excel;&lt;BR /&gt;
	SHEET="1";&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
I would like to replace the numeric values in:   &lt;BR /&gt;
where (Week_Code&amp;gt;=1) AND (Week_Code&amp;lt;=4);&lt;BR /&gt;
and&lt;BR /&gt;
SHEET="1";&lt;BR /&gt;
with a variable (say 'x') within a loop such as &lt;BR /&gt;
Do x = 1 to 9;&lt;BR /&gt;
&lt;BR /&gt;
Have tried various approaches including different macros but have had no success.&lt;BR /&gt;
&lt;BR /&gt;
Is there an easy way (or even a way) of accomplishing this.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
lmacdon4</description>
      <pubDate>Tue, 23 Feb 2010 18:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61455#M17442</guid>
      <dc:creator>lmacdon4</dc:creator>
      <dc:date>2010-02-23T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: DO loops</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61456#M17443</link>
      <description>You may consider the SAS macro language for this type of repetitive processing, where only a subset of "variable information" changes iteratively.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search arguments, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
macro language basics site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
macro variables introduction site:sas.com

Message was edited by: sbb</description>
      <pubDate>Tue, 23 Feb 2010 18:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61456#M17443</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-23T18:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: DO loops</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61457#M17444</link>
      <description>thanks. &lt;BR /&gt;
&lt;BR /&gt;
have tried some macros, but still having problems getting the different procs etc to recognize the 'x' variable.</description>
      <pubDate>Tue, 23 Feb 2010 19:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61457#M17444</guid>
      <dc:creator>lmacdon4</dc:creator>
      <dc:date>2010-02-23T19:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: DO loops</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61458#M17445</link>
      <description>Hi:&lt;BR /&gt;
  This paper serves as an excellent intro to the SAS Macro Facility:&lt;BR /&gt;
 &lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 23 Feb 2010 19:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61458#M17445</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-02-23T19:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: DO loops</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61459#M17446</link>
      <description>thanks Cynthia, the above file was very helpful. The macro is working correctly now.&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Leo</description>
      <pubDate>Wed, 24 Feb 2010 03:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-loops/m-p/61459#M17446</guid>
      <dc:creator>lmacdon4</dc:creator>
      <dc:date>2010-02-24T03:24:55Z</dc:date>
    </item>
  </channel>
</rss>

