<?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: inserting an array of macro variables in proc reg statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186188#M35283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably do not need the array. Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(*) into :NObs from quants;&lt;/P&gt;&lt;P&gt;Select G into :q Separated By ' ' from quants;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC QUANTREG DATA=dataExample;&lt;BR /&gt;MODEL y=x1 / QUANTILE=&amp;amp;q.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.. and ksharp was much quicker :-).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 11:43:27 GMT</pubDate>
    <dc:creator>user24feb</dc:creator>
    <dc:date>2015-01-16T11:43:27Z</dc:date>
    <item>
      <title>inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186186#M35281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am running quantile regression where a simple sas code is like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 10pt;"&gt;PROC QUANTREG DATA=dataExample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 10pt;"&gt;MODEL y=x1 / QUANTILE=0.1 0.3 0.5 0.7;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 10pt;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 10pt;"&gt;Here, I want to replace QUANTILE values in proc statement by those that I previously generate as a macro variable from the code below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select count(*)&lt;/P&gt;&lt;P&gt; into :NObs&lt;/P&gt;&lt;P&gt;from quants;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select G&lt;/P&gt;&lt;P&gt; into :q1-:q%let(left(Nobs))&lt;/P&gt;&lt;P&gt;from quants;&lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, how I can insert values from q1, q2, ..., q(last) in the proc quantreg statement above. I do not want to do this manually because number of quantiles are keep changing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186186#M35281</guid>
      <dc:creator>mtastan</dc:creator>
      <dc:date>2015-01-16T11:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186187#M35282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql noprint;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;select G&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;into : list separated by ' '&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;from quants;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Times New Roman'; color: #000000;"&gt;PROC QUANTREG DATA=dataExample;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Times New Roman'; color: #000000;"&gt;MODEL y=x1 / QUANTILE= &amp;amp;list ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Times New Roman'; color: #000000;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186187#M35282</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-16T11:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186188#M35283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably do not need the array. Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(*) into :NObs from quants;&lt;/P&gt;&lt;P&gt;Select G into :q Separated By ' ' from quants;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC QUANTREG DATA=dataExample;&lt;BR /&gt;MODEL y=x1 / QUANTILE=&amp;amp;q.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.. and ksharp was much quicker :-).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186188#M35283</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2015-01-16T11:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186189#M35284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set quants end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then call execute('proc quantreg data=dataExample; model y=x1 / quantile='||strip(g));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call execute(' '||strip(g));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last then call execute('; run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186189#M35284</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-16T11:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186190#M35285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many Thanks for quick reply. Yes this is what I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186190#M35285</guid>
      <dc:creator>mtastan</dc:creator>
      <dc:date>2015-01-16T11:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: inserting an array of macro variables in proc reg statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186191#M35286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it works thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 11:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/inserting-an-array-of-macro-variables-in-proc-reg-statement/m-p/186191#M35286</guid>
      <dc:creator>mtastan</dc:creator>
      <dc:date>2015-01-16T11:49:23Z</dc:date>
    </item>
  </channel>
</rss>

