<?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: Use different format for different categories in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Use-different-format-for-different-categories/m-p/248882#M56487</link>
    <description>&lt;P&gt;If I'm attempting something like with Proc tabulate to display it would require either preprocessing the data for and create a single&amp;nbsp;variable like Sex_Salary that was essentially valued as "Male 500 &amp;lt; 1000" "Male 1000+" and such.&lt;/P&gt;
&lt;P&gt;OR to recode salary to categories such as 1, 2, 3, 4 and assign the recodes based on gender so that you could have a format like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value SalaryCode
   1='500-&amp;lt;1000'
   2='1000 onwards'
   3='500-&amp;lt;1500'
   4='1500 onwards'
   ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so with 1 and 2 assigned to males and 3 and 4 assigned to females then that may work. But you would not want to use PRELOADFMT for this variable/format combination as the males would show the female range and vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2016 15:40:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-02-09T15:40:16Z</dc:date>
    <item>
      <title>Use different format for different categories</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-different-format-for-different-categories/m-p/248830#M56477</link>
      <description>&lt;P&gt;Using SAS EG 7. If I want to apply different format to different categories in proc tabulate, is there a way to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For eg, I want to have different grouping for the salary of a male vs a female. Do I have to generate different tables for males and females? Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;


value SalaryM

500-&amp;lt;1000='500-&amp;lt;1000'

1000-high='1000 onwards'

;

value SalaryF

500-&amp;lt;1500='500-&amp;lt;1500'

1500-high='1500 onwards'

;


PROC TABULATE DATA=test MISSING F=COMMA9. FORMCHAR='           ';;
CLASS AGE Sex salary / preloadfmt order=data;
Var EX3;
KEYLABEL                N=' '
                                SUM=' '
                                ALL ='TOTAL';
TABLES (ALL AGE=' '),(Sex =' ')*(ALL  Salary=' )/PRINTMISS;
 
RUN;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 09:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-different-format-for-different-categories/m-p/248830#M56477</guid>
      <dc:creator>apple</dc:creator>
      <dc:date>2016-02-09T09:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use different format for different categories</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-different-format-for-different-categories/m-p/248882#M56487</link>
      <description>&lt;P&gt;If I'm attempting something like with Proc tabulate to display it would require either preprocessing the data for and create a single&amp;nbsp;variable like Sex_Salary that was essentially valued as "Male 500 &amp;lt; 1000" "Male 1000+" and such.&lt;/P&gt;
&lt;P&gt;OR to recode salary to categories such as 1, 2, 3, 4 and assign the recodes based on gender so that you could have a format like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value SalaryCode
   1='500-&amp;lt;1000'
   2='1000 onwards'
   3='500-&amp;lt;1500'
   4='1500 onwards'
   ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so with 1 and 2 assigned to males and 3 and 4 assigned to females then that may work. But you would not want to use PRELOADFMT for this variable/format combination as the males would show the female range and vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 15:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-different-format-for-different-categories/m-p/248882#M56487</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-09T15:40:16Z</dc:date>
    </item>
  </channel>
</rss>

