<?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: What better than a proc freq !! in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188697#M12969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did it as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;select count(*) into:nobs from test&amp;amp;i.;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;nobs&amp;gt; 0 %then %do ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data princheck&amp;amp;i. ;&lt;/P&gt;&lt;P&gt;set "&amp;amp;&amp;amp;fln&amp;amp;i." ;&lt;/P&gt;&lt;P&gt;where TTN in ('9038')&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 20:56:07 GMT</pubDate>
    <dc:creator>anoopm7</dc:creator>
    <dc:date>2014-07-24T20:56:07Z</dc:date>
    <item>
      <title>What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188691#M12963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to find out if some specific numeric values are there in a dataset (have millions of records) for a particular field lets say 'city'. One way of doing this is to do a freq on that variable (called as city) and then compare the output and if there is match do print the details out. But I don't want to do freq as its time consuming. Is there a better way to achieve the results ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 19:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188691#M12963</guid>
      <dc:creator>anoopm7</dc:creator>
      <dc:date>2014-07-21T19:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188692#M12964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on what you need something like this can give you count of the instances of specific values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select variable, Count(*) as valuecount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dataset &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where variable in (value1, value2, value3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by variable;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the values are strings then enclose them in quotes but the results are case sensitive unless you use Upcase or lowcase such as upcase(variable) in (value list);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 20:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188692#M12964</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-21T20:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188693#M12965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that the values are in a tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;Create Table Match as&lt;/P&gt;&lt;P&gt;select Variable&lt;/P&gt;&lt;P&gt;from TableA&lt;/P&gt;&lt;P&gt;where Variable in (Select Variable from TableB)&lt;/P&gt;&lt;P&gt;Order by variable;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Non matches;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;Create Table Non_Match as&lt;/P&gt;&lt;P&gt;select Variable&lt;/P&gt;&lt;P&gt;from TableA&lt;/P&gt;&lt;P&gt;where Variable not in (select Variable from TableB)&lt;/P&gt;&lt;P&gt;order by variable;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 20:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188693#M12965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-07-21T20:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188694#M12966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The real answer depends on what you really need.&amp;nbsp; For example, do you need to know whether CITY is ever "Boston" on some records, and "New York" on others?&amp;nbsp; Or do you need to know whether CITY is ever either "Boston" or "New York" on any record?&amp;nbsp; At any rate, here's a much faster tool to get a yes/no answer for a single CITY value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let city=N;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have (keep=city);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where city="Boston";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call symputx('city', 'Y');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It stops processing as soon as it finds a single "Boston" in the data, so you don't run up much of a bill.&amp;nbsp; Then you can use the macro variable &amp;amp;CITY later on in the program.&amp;nbsp; But it all depends on what you really need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 21:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188694#M12966</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-07-21T21:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188695#M12967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The same functionality denoted by &lt;A __default_attr="5253" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; can be accomplished with PROC SQL as well by using the INOBS=1 option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get a boolean response in the macro variable assigned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql noprint inobs=1;&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(*) into :acura from sashelp.cars where make='Acura';&lt;/P&gt;&lt;P&gt;WARNING: Only 1 records were read from SASHELP.CARS due to INOBS= option.&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;acura;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql noprint inobs=1;&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(*) into :acura from sashelp.cars where make='Foo';&lt;/P&gt;&lt;P&gt;WARNING: Only 1 records were read from SASHELP.CARS due to INOBS= option.&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;acura;&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 17:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188695#M12967</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-07-23T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188696#M12968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are lot better ways to do that. Most of them are requiring you know something about your data and the effects on the system of your code.&lt;/P&gt;&lt;P&gt;When your data is in an external DBMS it will be different to a local SAS-dataset&lt;/P&gt;&lt;P&gt;Is your data pre-sorted or indexed on that field or must you process all data in a sequential way?&amp;nbsp; With this: will the processing occur often or just once.&lt;/P&gt;&lt;P&gt;Some procedures are multithreading others are not. Are you having benefits of the multithreading or will the IO pose a new bottleneck?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 19:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188696#M12968</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-23T19:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: What better than a proc freq !!</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188697#M12969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did it as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;select count(*) into:nobs from test&amp;amp;i.;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;nobs&amp;gt; 0 %then %do ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data princheck&amp;amp;i. ;&lt;/P&gt;&lt;P&gt;set "&amp;amp;&amp;amp;fln&amp;amp;i." ;&lt;/P&gt;&lt;P&gt;where TTN in ('9038')&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/What-better-than-a-proc-freq/m-p/188697#M12969</guid>
      <dc:creator>anoopm7</dc:creator>
      <dc:date>2014-07-24T20:56:07Z</dc:date>
    </item>
  </channel>
</rss>

