<?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 Generate Table Using Proc Format and ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294913#M61567</link>
    <description>&lt;P&gt;Trying to produce a table that is exactly as shown. Can this been done with Proc Format and only one other procedure? Or do I need to setup the dataset to get the look at want when using something like proc tabulate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Characteristic is the variables names and the Group is the variable values. (N is the counts and % is the percent of Characteristic)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: Proc Format is taken care of. The second image is what I got so far. I need the varable names in a seperate column to the left just like the from the first image.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12896i5F76943C2EAFC9E3/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Untitled.jpg" title="Untitled.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12897i9B06083A45A6AB4C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Untitled2.jpg" title="Untitled2.jpg" /&gt;</description>
    <pubDate>Mon, 29 Aug 2016 20:03:04 GMT</pubDate>
    <dc:creator>DATA_ALAN</dc:creator>
    <dc:date>2016-08-29T20:03:04Z</dc:date>
    <item>
      <title>Generate Table Using Proc Format and ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294913#M61567</link>
      <description>&lt;P&gt;Trying to produce a table that is exactly as shown. Can this been done with Proc Format and only one other procedure? Or do I need to setup the dataset to get the look at want when using something like proc tabulate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Characteristic is the variables names and the Group is the variable values. (N is the counts and % is the percent of Characteristic)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: Proc Format is taken care of. The second image is what I got so far. I need the varable names in a seperate column to the left just like the from the first image.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12896i5F76943C2EAFC9E3/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Untitled.jpg" title="Untitled.jpg" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12897i9B06083A45A6AB4C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Untitled2.jpg" title="Untitled2.jpg" /&gt;</description>
      <pubDate>Mon, 29 Aug 2016 20:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294913#M61567</guid>
      <dc:creator>DATA_ALAN</dc:creator>
      <dc:date>2016-08-29T20:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Table Using Proc Format and ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294917#M61568</link>
      <description>What will be the values?&lt;BR /&gt;Spontaneously I see three separate tables, probably generated by PROC TABULATE. &lt;BR /&gt;One way to solve this is to store the output of each tabulate in common data set, and then PROC PRINT that.</description>
      <pubDate>Mon, 29 Aug 2016 19:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294917#M61568</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-29T19:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Table Using Proc Format and ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294921#M61571</link>
      <description>&lt;P&gt;It seems to me that you need 3 different formats:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;(1) for gender, (2) for age group, (3) for employment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually a format usage is to convert or display a text instead of a code,&lt;/P&gt;&lt;P&gt;but I don't see codes in your table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, you may try use or addapt next proc format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format lib=work; &amp;nbsp;/* you can use another library */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; value $gender &amp;nbsp; &amp;nbsp; &amp;nbsp;/* $ for chracter format */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'F' = 'Female'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'M' = 'Male'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;value age_dec&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 = '20s'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 = '30s'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6 = '60+'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;other = '??' &amp;nbsp; &amp;nbsp;/* undefined */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;value $employ&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Full' = 'Full Time'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Part' = 'Part Time'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having the formats, you can use Proc Tabulate (or other procedures, depending on your dataset)&lt;/P&gt;&lt;P&gt;to displaty the data in the format you show. For more help - attach an example of your data or dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 19:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294921#M61571</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-08-29T19:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Table Using Proc Format and ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294922#M61572</link>
      <description>&lt;P&gt;You can do it solely with Proc Tabulate and formats. This is the easier method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Freq is another option as well with a bit of manipulation. You would add the formats for the variables into the proc freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Run frequency for tables;
ods table onewayfreqs=temp;
proc freq data=sashelp.class;
	table sex age;
run;

*Format output;
data want;
length variable $32. variable_value $50.;
set temp;
Variable=scan(table, 2);

Variable_Value=strip(trim(vvaluex(variable)));

keep variable variable_value frequency percent cum:;
label variable='Variable' 
	variable_value='Variable Value';
run;

*Display;
proc print data=want(obs=20) label;
run;
Sign up for free&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 19:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Table-Using-Proc-Format-and/m-p/294922#M61572</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-29T19:54:29Z</dc:date>
    </item>
  </channel>
</rss>

