<?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: Proc Freq in a macro loop in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53291#M14724</link>
    <description>Hi:&lt;BR /&gt;
  Another possibility. Let's say you have a dataset called WORK.MYDATA, then you could do this...without needing a macro program. Because you are using the colon modifier to keep any variable that starts "fromdate" or "thrudate" (assuming they are character variables), then using the _character_ special variable reference will ONLY have proc freq create one table for each variable -- fromdate1 through fromdaten, and thrudate1 through thrudaten, etc.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
                 &lt;BR /&gt;
proc freq data=work.mydata(keep=fromdate: thrudate:);&lt;BR /&gt;
  tables _character_;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Tue, 20 Jul 2010 21:59:30 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-07-20T21:59:30Z</dc:date>
    <item>
      <title>Proc Freq in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53289#M14722</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I have a file which has  date fields(data is in text format eg:'20090112') &lt;BR /&gt;
for eg fromdate1,fromdate2,fromdate3, thrudate1 thrudate2 thrudate3.&lt;BR /&gt;
I wanted to run a proc freq on these date fileds,is it possible to include the proc freq in a do loop with in a macro?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Tue, 20 Jul 2010 20:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53289#M14722</guid>
      <dc:creator>ren2010</dc:creator>
      <dc:date>2010-07-20T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53290#M14723</link>
      <description>Sure, you use DICTIONARY.COLUMNS with PROC SQL to generate a list of the macro variables you want to process, and within a SAS macro, you iterate through the macro variable list &lt;VAR-1&gt; through &lt;VAR-N&gt; substituting each variable on the TABLES statement.&lt;BR /&gt;
&lt;BR /&gt;
There are references in the archives as well as topic-related reference papers / material available at the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
repetitive code dictionary columns site:sas.com&lt;/VAR-N&gt;&lt;/VAR-1&gt;</description>
      <pubDate>Tue, 20 Jul 2010 21:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53290#M14723</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-20T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Freq in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53291#M14724</link>
      <description>Hi:&lt;BR /&gt;
  Another possibility. Let's say you have a dataset called WORK.MYDATA, then you could do this...without needing a macro program. Because you are using the colon modifier to keep any variable that starts "fromdate" or "thrudate" (assuming they are character variables), then using the _character_ special variable reference will ONLY have proc freq create one table for each variable -- fromdate1 through fromdaten, and thrudate1 through thrudaten, etc.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
                 &lt;BR /&gt;
proc freq data=work.mydata(keep=fromdate: thrudate:);&lt;BR /&gt;
  tables _character_;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 20 Jul 2010 21:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Freq-in-a-macro-loop/m-p/53291#M14724</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-07-20T21:59:30Z</dc:date>
    </item>
  </channel>
</rss>

