<?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: stack statistics of multiple variables in the same table in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79759#M8918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom: Thank you for the reply.Your example works. Just two questions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do you mean '&lt;SPAN style="font-family: 'courier new',courier;"&gt;ods listing close;&lt;/SPAN&gt;' instead of '&lt;SPAN style="font-family: 'courier new',courier;"&gt;ods listing close;&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The variable values (gender in your example) and associated "F-" values&amp;nbsp; from proc freq are always the same. I was thinking 'F-' variable contains the formatted value and the one without "F" contains whatever values in the table. What exactly F-variables are supposed to equal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Peter&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Apr 2012 22:47:51 GMT</pubDate>
    <dc:creator>tradepeter</dc:creator>
    <dc:date>2012-04-13T22:47:51Z</dc:date>
    <item>
      <title>stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79751#M8910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all:&lt;/P&gt;&lt;P&gt;&amp;nbsp; In a project, I hope to create one summary table for multiple variables. For example, assume the dataset contains information about patients' gender, agegroup and disease:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id&amp;nbsp; gender&amp;nbsp; agegroup&amp;nbsp;&amp;nbsp; disease&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;The coding would be 0-male, 1-female and 0-children, 1-adults etc al. I can easily produce a summary table for each one of those variables seperately. But what I need is to stack all of them together in the same table like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N&amp;nbsp;&amp;nbsp; percentage&lt;/P&gt;&lt;P&gt;gender&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; male&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; female&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50%&lt;/P&gt;&lt;P&gt;agegroup&amp;nbsp;&amp;nbsp;&amp;nbsp; children&amp;nbsp;&amp;nbsp; 32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; adult&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 68&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 68%&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I cannot come up with an easy solution with any of proc report, tabulate or freq. I could run multiple proc report/freq, output summaries to individual datasets and merge them together. But the code will be very long for many variables. Also, procs always output original values instead of the format (e.g output 0 for gender instead of male for gender) so I cannot merge them first and apply format later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 14:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79751#M8910</guid>
      <dc:creator>tradepeter</dc:creator>
      <dc:date>2012-04-11T14:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79752#M8911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the OneWayFreqs ODS output table from PROC FREQ.&amp;nbsp; But you will need to move the formatted values from the F_... variables back into a single column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods output onewayfreqs=freqout;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods listing off;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc freq data=sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;tables sex age;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods listing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length var $32 fvalue $50 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set freqout;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; var=scan(table,-1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; fvalue=vvaluex('F_'||var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; keep var fvalue frequency percent;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc print width=min; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 15:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79752#M8911</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-11T15:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79753#M8912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would do something along the lines of :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Create formats with the same names as the variables */&lt;BR /&gt;proc format; &lt;BR /&gt;value gender&lt;BR /&gt; 0 = "male"&lt;BR /&gt; 1 = "female";&lt;BR /&gt;value agegroup&lt;BR /&gt; 0 = "children"&lt;BR /&gt; 1 = "adults";&lt;BR /&gt;value disease ...&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=temp0 name=variable;&lt;BR /&gt;by Id notsorted;&lt;BR /&gt;var gender agegroup disease;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=temp0; by variable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=temp0;&lt;BR /&gt;by variable;&lt;BR /&gt;table col1 / out=temp1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* translate values into formatted values */&lt;BR /&gt;data want(drop=col1);&lt;BR /&gt;set temp1;&lt;BR /&gt;value = putc(col1, variable);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 16:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79753#M8912</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-11T16:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79754#M8913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The paper addresses the general topic of stacked variables summaries, you might find it helpful.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lexjansen.com/mwsug/2011/pharma/MWSUG-2011-PH02.pdf"&gt;http://www.lexjansen.com/mwsug/2011/pharma/MWSUG-2011-PH02.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 17:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79754#M8913</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-04-11T17:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79755#M8914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a great example for a simple macro.&lt;/P&gt;&lt;P&gt;Here's a basic example, hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The paper mentioned by data_null_ looks very useful as well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro summary_table(dsetin, varlist, dsetout);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets nodetails nolist;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete &amp;amp;dsetout;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*loop through variable list;&lt;/P&gt;&lt;P&gt;%let i=1;&lt;/P&gt;&lt;P&gt;%do %while (%scan(&amp;amp;varlist, &amp;amp;i, " ") ^=%str());&lt;/P&gt;&lt;P&gt;%let var=%scan(&amp;amp;varlist, &amp;amp;i, " ");&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;i &amp;amp;var; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Cross tab;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc freq data=&amp;amp;dsetin noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; table &amp;amp;var/ out=temp1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Get variable label as name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;dsetin (obs=1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('var_name', vlabel(&amp;amp;var.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;var_name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Add in Variable name and store the levels as a text field;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data temp2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep variable value count percent;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable = "&amp;amp;var_name";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set temp1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=input(&amp;amp;var, $50.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; percent=percent/100; * I like to store these as decimals instead of numbers;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format percent percent8.1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop &amp;amp;var.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;var_name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Append datasets;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc append data=temp2 base=&amp;amp;dsetout force;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*drop temp tables so theres no accidents*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc datasets nodetails nolist;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete temp1 temp2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Increment counter;&lt;/P&gt;&lt;P&gt;%let i=%eval(&amp;amp;i+1);&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Call macro with the variables in mind;&lt;/P&gt;&lt;P&gt;%summary_table(sashelp.class, sex age, summary1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Report the results;&lt;/P&gt;&lt;P&gt;proc report data=summary1 nowd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; column variable value count percent;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define variable /group 'Variable';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define value / format=$8. 'Value';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define count/'N';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define percent/'Percentage %';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 17:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79755#M8914</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-04-11T17:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79756#M8915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on your requirements. a simple PROC TABULATE may do the job.&amp;nbsp; How are your requirements different than this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value gender 0='male' 1='female';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc tabulate data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; class gender agegrp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables gender agegrp, N PctN;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; format gender gender.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realize you may have lots of answers, and really want to change the output.&amp;nbsp; But how far apart is this from what you need?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 18:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79756#M8915</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-04-11T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79757#M8916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many times, I see demographic reports like this where a slightly different requirement is to put the N and PCTN in the same cell, like: 99 (99.9%) or the min and max joined by a dash (11-16). I show how to do this in PROC REPORT and in a custom table template in my "Creating Complex Reports" paper (&lt;A href="http://www2.sas.com/proceedings/forum2008/173-2008.pdf"&gt;http://www2.sas.com/proceedings/forum2008/173-2008.pdf&lt;/A&gt;). There's no actual stacking of statistics in a cell -- it's either concatenating 2 numeric variables into a character string and/or using the JOURNAL style to disappear interior table lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 13:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79757#M8916</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-04-12T13:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79758#M8917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The result set looks like multiple queries are appended.&lt;/P&gt;&lt;P&gt;do it with proc means/freq, data step, proc append in a loop&lt;/P&gt;&lt;P&gt;alternatively use proc sql (the only macro) loop, over the grouped select and insert statements&lt;/P&gt;&lt;P&gt;(looping for each classing variable).&lt;/P&gt;&lt;P&gt;When inserting/appending, ensure the class_value column is wide enough for the widest class value, and make suitable conversion of numeric-type class values to character (dates! especially)&lt;/P&gt;&lt;P&gt;(I'm doing quite a lot of this in teradata sql and apppreciate having SAS to automate the class-variable loop)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 12:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79758#M8917</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2012-04-13T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: stack statistics of multiple variables in the same table</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79759#M8918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom: Thank you for the reply.Your example works. Just two questions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Do you mean '&lt;SPAN style="font-family: 'courier new',courier;"&gt;ods listing close;&lt;/SPAN&gt;' instead of '&lt;SPAN style="font-family: 'courier new',courier;"&gt;ods listing close;&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The variable values (gender in your example) and associated "F-" values&amp;nbsp; from proc freq are always the same. I was thinking 'F-' variable contains the formatted value and the one without "F" contains whatever values in the table. What exactly F-variables are supposed to equal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Peter&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 22:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/stack-statistics-of-multiple-variables-in-the-same-table/m-p/79759#M8918</guid>
      <dc:creator>tradepeter</dc:creator>
      <dc:date>2012-04-13T22:47:51Z</dc:date>
    </item>
  </channel>
</rss>

