<?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 How to proc freq for all variables in a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463810#M118217</link>
    <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I am validating a data set. I want to check for any missing values and possible values&amp;nbsp; and outliers for each variables in the data set.&lt;/P&gt;
&lt;P&gt;I am running proc freq for each variable. I just want to know any better way to do it&amp;nbsp; as my lab data&amp;nbsp;&lt;SPAN&gt;set&amp;nbsp; has more than million obs and 100 variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input a b $3 c$5;
datalines;
1 a b
2   c
3   
4 b d
5 c e
6 d f
7   g
8 e
;
proc freq;
tables a;
run;

proc freq;
tables b;
run;

proc freq;
tables c;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 May 2018 16:12:30 GMT</pubDate>
    <dc:creator>knveraraju91</dc:creator>
    <dc:date>2018-05-21T16:12:30Z</dc:date>
    <item>
      <title>How to proc freq for all variables in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463810#M118217</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I am validating a data set. I want to check for any missing values and possible values&amp;nbsp; and outliers for each variables in the data set.&lt;/P&gt;
&lt;P&gt;I am running proc freq for each variable. I just want to know any better way to do it&amp;nbsp; as my lab data&amp;nbsp;&lt;SPAN&gt;set&amp;nbsp; has more than million obs and 100 variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input a b $3 c$5;
datalines;
1 a b
2   c
3   
4 b d
5 c e
6 d f
7   g
8 e
;
proc freq;
tables a;
run;

proc freq;
tables b;
run;

proc freq;
tables c;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 May 2018 16:12:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463810#M118217</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2018-05-21T16:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc freq for all variables in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463811#M118218</link>
      <description>&lt;P&gt;Why not just use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
  input a b $3 c$5;
  datalines;
1 a b
2   c
3   
4 b d
5 c e
6 d f
7   g
8 e
;
proc freq;
  tables _all_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 16:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463811#M118218</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-05-21T16:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc freq for all variables in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463844#M118224</link>
      <description>&lt;P&gt;If you have variables that are more of a measurement than a category such as height, weight, monetary values (price/ sale and similar), you might want to look at them in terms of means, deviations and extremes, such as Proc Univariate provides as with "millions of observations" you might find yourself attempting to look through 100,000s of lines in a single table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or one approach if you are not concerned about any specific single record's value but know the expected or desired range of values&amp;nbsp;is to create custom formats of "valid" range of data values for specific variables. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value expectedage 
   13 - 16='Valid'
   other = 'Invalid';
run;

proc freq data=sashelp.class;
   tables age;
   format age expectedage.;
run;&lt;/PRE&gt;
&lt;P&gt;Which at least makes output tables easier to interpret in some forms.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 18:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/463844#M118224</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-21T18:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc freq for all variables in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/464258#M118359</link>
      <description>&lt;P&gt;Note that in the above replies, no macros are needed. Don't resort to macros unless you are convinced that there is no non-macro solution available.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 01:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-proc-freq-for-all-variables-in-a-macro/m-p/464258#M118359</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-23T01:21:48Z</dc:date>
    </item>
  </channel>
</rss>

