<?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: same procedure over a set of variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/624618#M20134</link>
    <description>&lt;P&gt;The macros book (published by SAS):&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Macro Language Magic&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does cover CALL EXECUTE, but not DOSUBL.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 19:50:25 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-02-13T19:50:25Z</dc:date>
    <item>
      <title>same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623825#M19999</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do the same procedure for a set of known variables, say proc freq for {andy, jane, may, ali}. There are two ways I can think of:&lt;/P&gt;&lt;P&gt;1. brute force&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FREQ;
TABLE andy;
TABLE jane;
TABLE may;
TABLE ali;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. brute force(macro version)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO ForFun(Variable);
PROC FREQ;
TABLE &amp;amp;Variable;
RUN;
%MEND;
%ForFun(andy);
%ForFun(jane);
%ForFun(may);
%ForFun(ali);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sort of want to hear any better solution about this, thanks guys!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623825#M19999</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2020-02-11T13:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623827#M20001</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120575"&gt;@Chung-Li&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOSUBL (= CALL EXECUTE) can be a good alternative:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input name $;
	datalines;
andy
jane
may
ali
;
run;

data _null_;
	set have;
	rc = dosubl(cat('proc freq data=mydata;table ',name,'; run;')); /*specify the name of your dataset*/
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623827#M20001</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-11T13:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623829#M20003</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vars;
input varname $;
datalines;
andy
jane
may
ali
;

data _null_;
set vars end=done;
if _n_ = 1 then call execute('proc freq;');
call execute('table ' !! varname !! ';');
if done then call execute('run;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623829#M20003</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-11T13:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623830#M20004</link>
      <description>&lt;P&gt;Or also,&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input name $;
	datalines;
andy
jane
may
ali
;
run;

data _null_;
	set have;
	rc = dosubl(cat('%ForFun(',name,')'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623830#M20004</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-11T13:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623832#M20005</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let variables=andy jane may ali;
PROC FREQ;
    TABLE &amp;amp;Variables;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above works, but of course it would be even less typing than if you didn't use the macro variable at all and used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TABLE andy jane may ali;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;But perhaps you aren't typing the variable names, you are obtaining them from PROC CONTENTS or other source... in which case using a macro variable would work better.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623832#M20005</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-11T13:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623836#M20006</link>
      <description>&lt;P&gt;Hi Miller,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any recommendation (book, website, lecture, etc.) if I want to learn more about this kind of tech/skill?&lt;/P&gt;&lt;P&gt;Appreciate!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623836#M20006</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2020-02-11T13:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623837#M20007</link>
      <description>Thanks ed, skill learned!</description>
      <pubDate>Tue, 11 Feb 2020 13:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623837#M20007</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2020-02-11T13:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623838#M20008</link>
      <description>Thanks Kurt!</description>
      <pubDate>Tue, 11 Feb 2020 13:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623838#M20008</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2020-02-11T13:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623839#M20009</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120575"&gt;@Chung-Li&lt;/a&gt;&amp;nbsp; &amp;nbsp;I second your question. The statsman &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; is dangerously good&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ask for ways to grab his statistical skills&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623839#M20009</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-02-11T13:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623841#M20010</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120575"&gt;@Chung-Li&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Miller,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any recommendation (book, website, lecture, etc.) if I want to learn more about this kind of tech/skill?&lt;/P&gt;
&lt;P&gt;Appreciate!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So "this kind of tech/skill" is somewhat vague ... I don't really know if you want to learn more about programming and statistical analysis, or learn more about macros/CALL EXECUTE/DOSUBL, or all of the above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do like the book by Mr. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;, but as I no longer own the book (my employer bought it for me and kept it when I moved to a new employer), I don't remember the name of the book, but I'm sure Mr.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;will inform us. I'm also not sure if this book covers what you are discussing.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623841#M20010</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-11T13:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623842#M20011</link>
      <description>Sorry for the unclarity.&lt;BR /&gt;&lt;BR /&gt;I didn't know which term/area should I check for "%let", but now I totally know where to check, thanks!</description>
      <pubDate>Tue, 11 Feb 2020 13:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/623842#M20011</guid>
      <dc:creator>Chung-Li</dc:creator>
      <dc:date>2020-02-11T13:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: same procedure over a set of variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/624618#M20134</link>
      <description>&lt;P&gt;The macros book (published by SAS):&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Macro Language Magic&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does cover CALL EXECUTE, but not DOSUBL.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 19:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/same-procedure-over-a-set-of-variable/m-p/624618#M20134</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-02-13T19:50:25Z</dc:date>
    </item>
  </channel>
</rss>

