<?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 tabulate with multiple where conditions working with large data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631778#M20987</link>
    <description>&lt;P&gt;It would help a lot if you could provide some representative sample mock-up data (via a SAS data step) and then also show us how the desired result using this sample data should look like.&lt;/P&gt;
&lt;P&gt;Providing sample data and desired result not only reduces ambiguity, it also allows us to provide tested code as answer.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 03:51:10 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-03-13T03:51:10Z</dc:date>
    <item>
      <title>Proc tabulate with multiple where conditions working with large data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631628#M20959</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting last where condition applied to the procedure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 400 Million record dataset I dont want to pass it into multiple separate proc tabulates wanted to complete in one proc&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 conditions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;variables res brs ats g0s ga&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wanted to look min and max for&amp;nbsp;ats to prove it is ats &amp;lt;= 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;wanted to look min and max for&amp;nbsp;res and&amp;nbsp;brs to prove it is&amp;nbsp; 0&amp;lt;=res&amp;lt;=1 or 0&amp;lt;=brs&amp;lt;=1'&lt;/P&gt;&lt;P&gt;wanted to look min and max for g0s and ga to prove it is&amp;nbsp; g0s &amp;gt; 0 or ga &amp;gt; 0'&lt;/P&gt;&lt;P&gt;like wise I have 60 + conditions to prove&lt;/P&gt;&lt;P&gt;I can do it in proc mean to get min and max but if I use preloadfmt it will give me 60+ tables dont want that&lt;BR /&gt;&lt;BR /&gt;data sss;set LIST;run;&lt;BR /&gt;proc sort data=sss; by Exclusion_GEN;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc tabulate DATA=sss; missing ;&lt;BR /&gt;by Exclusion_GEN;&lt;BR /&gt;class Exclusion_GEN ;/*/preloadfmt;*/&lt;BR /&gt;VAR res brs ats g0s ga;&lt;BR /&gt;where Exclusion_GEN=1;&lt;BR /&gt;tables Exclusion_GEN , ats*(N min max) /printmiss misstext='0';&lt;BR /&gt;where Exclusion_GEN=2;&lt;BR /&gt;tables Exclusion_GEN , brs*(N min max) res *(N min max)/printmiss misstext='0';&lt;BR /&gt;where Exclusion_GEN=3;&lt;BR /&gt;tables Exclusion_GEN , g0s*(N min max) ga *(N min max)/printmiss misstext='0';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 16:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631628#M20959</guid>
      <dc:creator>bobi</dc:creator>
      <dc:date>2020-03-12T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with multiple where conditions working with large data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631629#M20960</link>
      <description>What do you mean PROC MEANS will give you 60+ tables? Why not pipe your PROC MEANS to a data set and store your results for display later. I would be turning off any output and coding my rules into the system rather than manually verifying your data by eyeballing it. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2020 16:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631629#M20960</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-12T16:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with multiple where conditions working with large data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631641#M20961</link>
      <description>&lt;P&gt;if we direct it to data set we have to code around each and every rule which is more effort to write 60+ conditions and more prone to errors and need more time to code around just wanted to if we can do in tabulate&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 17:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631641#M20961</guid>
      <dc:creator>bobi</dc:creator>
      <dc:date>2020-03-12T17:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with multiple where conditions working with large data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631743#M20981</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3542"&gt;@bobi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting last where condition applied to the procedure&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 400 Million record dataset I dont want to pass it into multiple separate proc tabulates wanted to complete in one proc&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 3 conditions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variables res brs ats g0s ga&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wanted to look min and max for&amp;nbsp;ats to prove it is ats &amp;lt;= 2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wanted to look min and max for&amp;nbsp;res and&amp;nbsp;brs to prove it is&amp;nbsp; 0&amp;lt;=res&amp;lt;=1 or 0&amp;lt;=brs&amp;lt;=1'&lt;/P&gt;
&lt;P&gt;wanted to look min and max for g0s and ga to prove it is&amp;nbsp; g0s &amp;gt; 0 or ga &amp;gt; 0'&lt;/P&gt;
&lt;P&gt;like wise I have 60 + conditions to prove&lt;/P&gt;
&lt;P&gt;I can do it in proc mean to get min and max but if I use preloadfmt it will give me 60+ tables dont want that&lt;BR /&gt;&lt;BR /&gt;data sss;set LIST;run;&lt;BR /&gt;proc sort data=sss; by Exclusion_GEN;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc tabulate DATA=sss; missing ;&lt;BR /&gt;by Exclusion_GEN;&lt;BR /&gt;class Exclusion_GEN ;/*/preloadfmt;*/&lt;BR /&gt;VAR res brs ats g0s ga;&lt;BR /&gt;where Exclusion_GEN=1;&lt;BR /&gt;tables Exclusion_GEN , ats*(N min max) /printmiss misstext='0';&lt;BR /&gt;where Exclusion_GEN=2;&lt;BR /&gt;tables Exclusion_GEN , brs*(N min max) res *(N min max)/printmiss misstext='0';&lt;BR /&gt;where Exclusion_GEN=3;&lt;BR /&gt;tables Exclusion_GEN , g0s*(N min max) ga *(N min max)/printmiss misstext='0';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want a different set of cross variables for different levels of one variable such as you Exclusion_gen then you are somewhat abusing tabulate as it won't work the way you are attempting. You can get different table calls but not with multiple WHERE statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without some actual data and what the result should look like I'm not going to spend much skull sweat on this. My gut instinct would likely be to use Proc Summary to create the summaries and then possibly proc print with a WHERE based on a _type_ variable from proc summary. Or transpose the data so that instead of res brs ats g0s ga, you have ONE numeric value variable and a CLASS variable that contains the strings "res" "brs" "ats" "g0s" "ga",&lt;/P&gt;
&lt;P&gt;If that data is properly structured you would be able to use&lt;/P&gt;
&lt;PRE&gt;proc tabulate DATA=sss; missing ;

class Exclusion_GEN namevar ;
VAR valuevariable;
tables Exclusion_GEN , 
       namevar,
       valuevariable * (N min max) /printmiss misstext='0';
run;&lt;/PRE&gt;
&lt;P&gt;Which would give a table for each value of Exclusion_GEN and a separate Row for each of the NameVar with the summary of the numeric variable&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;tables Exclusion_GEN , 
       valuevariable,
       namevar*(N min max) /printmiss misstext='0';&lt;/PRE&gt;
&lt;P&gt;To have a one row summary with the Namevar as column head over the statistics&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 23:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631743#M20981</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-12T23:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate with multiple where conditions working with large data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631778#M20987</link>
      <description>&lt;P&gt;It would help a lot if you could provide some representative sample mock-up data (via a SAS data step) and then also show us how the desired result using this sample data should look like.&lt;/P&gt;
&lt;P&gt;Providing sample data and desired result not only reduces ambiguity, it also allows us to provide tested code as answer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 03:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-with-multiple-where-conditions-working-with-large/m-p/631778#M20987</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-13T03:51:10Z</dc:date>
    </item>
  </channel>
</rss>

