<?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 Conversion of frequency result into a table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853182#M37519</link>
    <description>&lt;P&gt;Can someone guide me how can I achieve the desired result.&lt;/P&gt;&lt;P&gt;I was working on a Code as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
    tables EMP_CODE*DATE_OF_APPROVAL/nopercent nocum norow nocol;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What should I do to get the below exact result as a table output?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673410861863.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79259iD8C5CFF5DB3D8F61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673410861863.png" alt="Kirito1_0-1673410861863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I am using the code below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
tables EMP_CODE*DATE_OF_APPROVAL/nocum norow nocol nopercent out=table_out_result;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result is not like the result of proc freq&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="Kirito1_0-1673412049564.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79260i09C24F3E6352FEB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673412049564.png" alt="Kirito1_0-1673412049564.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;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2023 04:42:38 GMT</pubDate>
    <dc:creator>Kirito1</dc:creator>
    <dc:date>2023-01-11T04:42:38Z</dc:date>
    <item>
      <title>Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853182#M37519</link>
      <description>&lt;P&gt;Can someone guide me how can I achieve the desired result.&lt;/P&gt;&lt;P&gt;I was working on a Code as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
    tables EMP_CODE*DATE_OF_APPROVAL/nopercent nocum norow nocol;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What should I do to get the below exact result as a table output?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673410861863.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79259iD8C5CFF5DB3D8F61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673410861863.png" alt="Kirito1_0-1673410861863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I am using the code below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
tables EMP_CODE*DATE_OF_APPROVAL/nocum norow nocol nopercent out=table_out_result;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result is not like the result of proc freq&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="Kirito1_0-1673412049564.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79260i09C24F3E6352FEB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673412049564.png" alt="Kirito1_0-1673412049564.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;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 04:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853182#M37519</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T04:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853189#M37522</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can someone guide me how can I achieve the desired result.&lt;/P&gt;
&lt;P&gt;I was working on a Code as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
    tables EMP_CODE*DATE_OF_APPROVAL/nopercent nocum norow nocol;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What should I do to get the below exact result as a table output?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673410861863.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79259iD8C5CFF5DB3D8F61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673410861863.png" alt="Kirito1_0-1673410861863.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I am using the code below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc freq data=final;
tables EMP_CODE*DATE_OF_APPROVAL/nocum norow nocol nopercent out=table_out_result;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result is not like the result of proc freq&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="Kirito1_0-1673412049564.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79260i09C24F3E6352FEB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673412049564.png" alt="Kirito1_0-1673412049564.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;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The first thing would be to provide example data of the set Final. Second is define exactly what you mean by table in this context.&lt;/P&gt;
&lt;P&gt;There is no way that a DATASET will have multiple rows of header information. Nada. Zip. None. Zilch. You will have one variable name with an optional label per column. No way "Table of anythiing" or a spanning "Date_of_approval" will appear as part of a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean that you want variables with names like "01JAN2023" then you are doing stuff that just will add difficulty for most things in the long run because you have to 1) use options to allow non-standard names, 2) would require referencing those names with quotes and n as "01JAN2023"n and 3) have placed data into variable names.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 06:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853189#M37522</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-11T06:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853193#M37525</link>
      <description>&lt;P&gt;You do not want the wide structure of the report in a dataset for further analysis. It is mainly good for human consumption.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 06:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853193#M37525</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-01-11T06:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853195#M37526</link>
      <description>&lt;P&gt;OK, got it My bad I understood you point. But can you help me what is that percent column coming after I am applying proc freq. If you have any idea. Please, enlighten me. Thank you for the contribution in making me understand this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 07:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853195#M37526</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T07:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853196#M37527</link>
      <description>&lt;P&gt;It is the percentage of the particular combination of emp_code and date_of_approval vs. the whole dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 07:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853196#M37527</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-01-11T07:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853198#M37528</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;OK, got it My bad I understood you point. But can you help me what is that percent column coming after I am applying proc freq. If you have any idea. Please, enlighten me. Thank you for the contribution in making me understand this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From the documentation of the OUT= table option:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV id="procstat.freq.freqtables" class="aa-section"&gt;
&lt;DIV id="procstat_freq002723" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;OUT=&lt;SPAN class=" aa-argument"&gt;SAS-data-set&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P&gt;&lt;A class="indexterm" name="procstat.freq.a0000000415" target="_blank"&gt;&lt;/A&gt; &lt;A class="indexterm" name="procstat.freq.a0000000416" target="_blank"&gt;&lt;/A&gt; names an output data set that contains frequency or crosstabulation table counts and percentages. If more than one table request appears in the TABLES statement, the contents of the OUT= data set correspond to the last table request in the TABLES statement. The OUT= data set variable &lt;CODE class="aa-varname"&gt;COUNT&lt;/CODE&gt; contains the frequencies and the variable &lt;CODE class="aa-varname"&gt;PERCENT&lt;/CODE&gt; contains the percentages.&lt;/P&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you don't want the percent variable then could 1) use the drop= data set option :&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.class;
tables sex*age /nopercent nocum norow nocol out=ds (drop=percent);
run;&lt;/PRE&gt;
&lt;P&gt;Or use a different procedure entirely with some different options. One way using Proc Summary/ Means&lt;/P&gt;
&lt;PRE&gt;proc summary data=sashelp.class nway;
   class sex age;
   output out=ds(drop=_type_ rename=(_freq_=count));
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 07:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853198#M37528</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-11T07:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853215#M37532</link>
      <description>thanks for the contribution ballardw..............Its working now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 11 Jan 2023 09:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853215#M37532</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-11T09:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion of frequency result into a table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853227#M37535</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.class;
run;

proc sql;
create table temp as
select 1 as id1,sex as sex length=80,
       1 as id2,put(age,best. -l) as age length=80,
       count(*) as n
 from have
  group by sex,age
union all
select 1 as id1,sex,
       2 as id2,'Total',
       count(*) as n
 from have
  group by sex
union all
select 2 as id1,'Total',
       1 as id2,put(age,best. -l),
       count(*) as n
 from have
  group by age
union all
select 2 as id1,'Total',
       2 as id2,'Total',
       count(*) as n
 from have
order by 1,2,3,4
;
quit;
options validvarname=any missing='0';
proc transpose data=temp out=want(drop=_name_);
by sex notsorted;
id age;
var n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2023 11:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conversion-of-frequency-result-into-a-table/m-p/853227#M37535</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-11T11:42:56Z</dc:date>
    </item>
  </channel>
</rss>

