<?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 crosstab in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750295#M235969</link>
    <description>Got it. Thank you so much!</description>
    <pubDate>Thu, 24 Jun 2021 19:48:56 GMT</pubDate>
    <dc:creator>xiaopingnie</dc:creator>
    <dc:date>2021-06-24T19:48:56Z</dc:date>
    <item>
      <title>proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749953#M235797</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I just met a problem when using proc freq crosstab.&lt;/P&gt;&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;&lt;PRE class="result notranslate"&gt;PROC SQL;
create table CARS1 as
SELECT make, type, invoice, horsepower, length, weight
   FROM 
   SASHELP.CARS
   WHERE make in ('Audi','BMW')
;
RUN;

proc FREQ data = CARS1;
tables make*type; 
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;without any suppression, I only got two rows in each cells instead of 4 rows. also there's a warning "WARNING: Format pctfmt. failed to load!" in the log window. But this warning did not show up when I ran one way proc freq.&lt;BR /&gt;Any one know what's going on here?&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;SUV&lt;/TD&gt;&lt;TD&gt;Sedan&lt;/TD&gt;&lt;TD&gt;Sports&lt;/TD&gt;&lt;TD&gt;Wagon&lt;/TD&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Audi&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;68.42&lt;/TD&gt;&lt;TD&gt;21.05&lt;/TD&gt;&lt;TD&gt;10.53&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BMW&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;65&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;39&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Jun 2021 18:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749953#M235797</guid>
      <dc:creator>xiaopingnie</dc:creator>
      <dc:date>2021-06-23T18:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749967#M235799</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/387101"&gt;@xiaopingnie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I just met a problem when using proc freq crosstab.&lt;/P&gt;
&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;
&lt;PRE class="result notranslate"&gt;PROC SQL;
create table CARS1 as
SELECT make, type, invoice, horsepower, length, weight
   FROM 
   SASHELP.CARS
   WHERE make in ('Audi','BMW')
;
RUN;

proc FREQ data = CARS1;
tables make*type; 
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;without any suppression, I only got two rows in each cells instead of 4 rows. also there's a warning "WARNING: Format pctfmt. failed to load!" in the log window. But this warning did not show up when I ran one way proc freq.&lt;BR /&gt;Any one know what's going on here?&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;SUV&lt;/TD&gt;
&lt;TD&gt;Sedan&lt;/TD&gt;
&lt;TD&gt;Sports&lt;/TD&gt;
&lt;TD&gt;Wagon&lt;/TD&gt;
&lt;TD&gt;Total&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Audi&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;13&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;19&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;68.42&lt;/TD&gt;
&lt;TD&gt;21.05&lt;/TD&gt;
&lt;TD&gt;10.53&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;BMW&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;13&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;65&lt;/TD&gt;
&lt;TD&gt;20&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Total&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;26&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;39&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I just ran your code and got this.&amp;nbsp; Tell more of the story.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-06-23 140025.png" style="width: 350px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60683iDC4B95FCC490F14B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-06-23 140025.png" alt="Screenshot 2021-06-23 140025.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 19:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749967#M235799</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-06-23T19:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749991#M235817</link>
      <description>&lt;P&gt;Just as an aside, most procedures will support a where statement and there wouldn't be a need to create that extra data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc FREQ data = sashelp.cars;
   where make in ('Audi' ,'BMW');
   tables make*type; 
run;&lt;/PRE&gt;
&lt;P&gt;"WARNING: Format pctfmt. failed to load!"&amp;nbsp; would likely only occur if you attempted to assign that format to a variable. The only references I find quickly for Pctfmt is in Proc Tabulate documentation using a custom format of that name.&lt;/P&gt;
&lt;P&gt;If the data set has a variable with that format already assigned but the format is not available in current session you might get that message.Which would not happen with the shown code unless you have somehow modified the SASHELP.Cars data set or perhaps one of the table Templates that Proc Freq uses.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 20:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749991#M235817</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-23T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749999#M235824</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I agree with previous posters. I do not observe the results that were originally posted.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1624479441463.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60684i6498200663A7B67E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1624479441463.png" alt="Cynthia_sas_0-1624479441463.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; No matter whether I use the original code or use streamlined code, the results are the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 20:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/749999#M235824</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-23T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750011#M235834</link>
      <description>It’s not code issue. I just use default proc freq crosstab, what ever data I use, I just got two rows instead of 4 rows. Yes, I did not use suppression, but can not get percent and column percent.. please help!</description>
      <pubDate>Wed, 23 Jun 2021 20:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750011#M235834</guid>
      <dc:creator>xiaopingnie</dc:creator>
      <dc:date>2021-06-23T20:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750037#M235847</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/387101"&gt;@xiaopingnie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It’s not code issue. I just use default proc freq crosstab, what ever data I use, I just got two rows instead of 4 rows. Yes, I did not use suppression, but can not get percent and column percent.. please help!&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That sounds like you may have a modified template some where.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this and show us what appears in the Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods path show;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 21:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750037#M235847</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-23T21:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750194#M235908</link>
      <description>&lt;P&gt;4 proc freq data=analysis.seatbelt_region;&lt;BR /&gt;5 table Region*SeatBelt_use;&lt;BR /&gt;6 run;&lt;/P&gt;&lt;P&gt;NOTE: Writing HTML Body file: sashtml.htm&lt;BR /&gt;WARNING: Format pctfmt. failed to load!&lt;BR /&gt;NOTE: There were 7121 observations read from the data set ANALYSIS.SEATBELT_REGION.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.67 seconds&lt;BR /&gt;cpu time 0.09 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;7 ods path show;&lt;BR /&gt;Current ODS PATH list is:&lt;/P&gt;&lt;P&gt;1. SASUSER.TEMPLAT(UPDATE)&lt;BR /&gt;2. SASHELP.TMPLMST(READ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 13:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750194#M235908</guid>
      <dc:creator>xiaopingnie</dc:creator>
      <dc:date>2021-06-24T13:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750244#M235937</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; To make sure that ONLY the default PROC FREQ template for crosstabs is being used, try running this code. It will ONLY reference the templates in the production template store that is delivered with SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods path sashelp.tmplmst(read);
title '1) use only default templates (do NOT use SASUSER.TEMPLAT)';
proc FREQ data = sashelp.cars;
  WHERE make in ('Audi','BMW');
  tables make*type; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; As shown in the TITLE statement, the ODS PATH statement before the PROC FREQ will reset the search path for templates to the default SASHELP.TMPLMST and will bypass the use of SASUSER.TEMPLAT in case the PROC FREQ template was accidentally modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Then, if the above code still produces the error, that might mean that someone accidentally changed the PROC FREQ template in the SASHELP template store. That is very unfortunate, if that is the case. You might need to work with Tech Support to get a "good" copy of SASHELP.TEMPMST restored in your session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750244#M235937</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-24T15:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750285#M235962</link>
      <description>&lt;P&gt;That works! But I need to add this line of code each time I start SAS program in order to make proc freq crosstab working normally. Anyway to avoid this? Also I am curious that how this happened as I am the only user since the software installed on my computer. I am certainly not that kind of seasoned programmer who knows how to change t&lt;SPAN&gt;he PROC FREQ template.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750285#M235962</guid>
      <dc:creator>xiaopingnie</dc:creator>
      <dc:date>2021-06-24T19:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750287#M235964</link>
      <description>Hi:&lt;BR /&gt;  . Well, the only way this might have happened would be if you explicitly ran PROC TEMPLATE code to update the template used by PROC FREQ. I suppose it is possible that you are sharing SASUSER.TEMPLAT with others at your company, but that would be out of the ordinary way of setting up SASUSER.TEMPLAT.&lt;BR /&gt;  Unfortunately, the only way around using the ODS PATH statement every time is finding out how SASUSER.TEMPLAT got accidentally updated. I mean, you could just search for and then delete the SASUSER.TEMPLAT item store or delete the templates out of it. It seems odd that SASUSER.TEMPLAT got updated without your knowledge....but to avoid using the ODS PATH statement, you'll have to get to the bottom of that mystery.&lt;BR /&gt;Cynthia&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750287#M235964</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-06-24T19:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq crosstab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750295#M235969</link>
      <description>Got it. Thank you so much!</description>
      <pubDate>Thu, 24 Jun 2021 19:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-crosstab/m-p/750295#M235969</guid>
      <dc:creator>xiaopingnie</dc:creator>
      <dc:date>2021-06-24T19:48:56Z</dc:date>
    </item>
  </channel>
</rss>

