<?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: Significant CPU time required for Proc Surveyfreq in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203580#M10918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A separate call to a procedure means it has to "reread" the data. The dataset may be cached but new "bins" have to be created for the analysis. One call with multiple variables might take a bit longer than for a single variable but is much faster than rereading the data repeatedly.&lt;/P&gt;&lt;P&gt;If you have SAS 9.1 you may need to have multiple Table statements as there was a bug in some versions that complained about the var1 * (var2 var3) syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been working with and around the BRFSS since late 1997 so I kind of recognize some of the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that if your version supports it, the option NOMCAR is recommended as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 15:45:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-07-15T15:45:38Z</dc:date>
    <item>
      <title>Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203575#M10913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a macro I created for proc surveyfreq and it is taking a lot of CPU time (2:57:30 per variable) in order for the program to run. I was wondering if there was a more efficient way to run the program? Or perhaps there is a way I could check to see how the data is structured and fix the issue that way? When I remove the weight, the process time speeds up quite a bit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro tab1 (var);&lt;/P&gt;&lt;P&gt;proc surveyfreq data = ACE.ACEDATASET;&lt;/P&gt;&lt;P&gt;tables rucc* &amp;amp;var/ row col chisq;&lt;/P&gt;&lt;P&gt;strata _STSR;&lt;/P&gt;&lt;P&gt;weight _FINALWT2;&lt;/P&gt;&lt;P&gt;cluster _NEWPSU&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%tab1 (ACEDEPRS2);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEDIVRC);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEDRINK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEDRUGS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEHURT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEHVSEX);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEPRISN);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACEPUNCH);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACESWEAR);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACETOUCH);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%tab1 (ACETTHEM);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thank you for your suggestions and solutions,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Donald S.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203575#M10913</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-15T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203576#M10914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RUCC and the other variables are cattegorical, right?&amp;nbsp; How many levels for each variable, and how many observations in the data set?&amp;nbsp; How many strata and PSUs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203576#M10914</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-07-15T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203577#M10915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, all variables are categorical. RUCC has 4 levels and all the variables beginning with ACE are dichotomous. There are about 110,000 observations, PSU, and STRATA in the dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203577#M10915</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-15T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203578#M10916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you don't appear to be creating files or anything need the variable name you should try using&lt;/P&gt;&lt;P&gt;tables rucc* (ACEDEPRS2 ACEDEPRS2 &amp;lt;list all the variables&amp;gt;) / row col chisq;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You call also have multiple tables statements in a single call to the Proc similar to Proc freq.&lt;/P&gt;&lt;P&gt;You spend a lot of time reloading all the data for each call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also wonder from some of your variables if this may be BRFSS related?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 15:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203578#M10916</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-15T15:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203579#M10917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wonderful, I will try that. Yes, I am working with BRFSS data, good eye ballardw!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also wondering how the loading is structured differently between running the data as a macro vs. listing the variables in parenthesis. With the parenthesis, are they all loaded at once and then a table is formed with the RUCC? And for the macro, does it run through and load each of the '&amp;amp;var' variables separately and this is what causes the longer load times?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Donald S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 15:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203579#M10917</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-15T15:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203580#M10918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A separate call to a procedure means it has to "reread" the data. The dataset may be cached but new "bins" have to be created for the analysis. One call with multiple variables might take a bit longer than for a single variable but is much faster than rereading the data repeatedly.&lt;/P&gt;&lt;P&gt;If you have SAS 9.1 you may need to have multiple Table statements as there was a bug in some versions that complained about the var1 * (var2 var3) syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been working with and around the BRFSS since late 1997 so I kind of recognize some of the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that if your version supports it, the option NOMCAR is recommended as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 15:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203580#M10918</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-15T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203581#M10919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently running your code for a single variable, just to see the process time and it has been about 20 minutes. Could there be anything else I could do?&lt;/P&gt;&lt;P&gt;proc surveyfreq data = ACE.ACEDATASET;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tables rucc* ACEDEPRS2 / row col chisq nomcar;&lt;/P&gt;&lt;P&gt;&amp;nbsp; strata _STSTR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WEIGHT _FINALWT2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cluster _NEWPSU;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 16:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203581#M10919</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-15T16:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203582#M10920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes if you are building lots of tables the time actually ends up in the building of the HTML output but I think you have something else going on. NOMCAR belongs on the Proc statement not Tables. I would interrupt this if it is still running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't run surveyfreq or means on anything with more than about 15,000 records but with as many as 20-odd variable combinations in a single proc call and not had any of those run more than a couple of minutes. Are you working in a server environment by any chance? Network connections and/or server options may be an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 17:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203582#M10920</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-15T17:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203583#M10921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working off a network at the moment. I will give the dataset to my hard drive and see if that makes a difference. Just to be more exact there are 101886 observations, 101720 clusters, 262 strata, 166 number of observations with non positive weights and the sum of the weights is 25440337.9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Donald Szlosek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 17:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203583#M10921</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-15T17:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Significant CPU time required for Proc Surveyfreq</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203584#M10922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put Dataset on Hard drive and still have the same issue. I switched to using SAS callable SUDAAN and everything is running smoothly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 18:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Significant-CPU-time-required-for-Proc-Surveyfreq/m-p/203584#M10922</guid>
      <dc:creator>daszlosek</dc:creator>
      <dc:date>2015-07-20T18:29:00Z</dc:date>
    </item>
  </channel>
</rss>

