<?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: How To derive desired sub-column variable to dataset from proc freq result in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300024#M312240</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ok, so it gave me the output but still in a list format. my desired result are categorical format. PFA&lt;/P&gt;&lt;P&gt;like a tabular form as i given below.&lt;/P&gt;&lt;P&gt;Make | 4 | 6 | 8 | Total | Percent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know proc freq may not be proper solution. Still couldnot separate the sub-category values and take as output.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 02:43:39 GMT</pubDate>
    <dc:creator>sooryavasudevan</dc:creator>
    <dc:date>2016-09-22T02:43:39Z</dc:date>
    <item>
      <title>How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299723#M312233</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need&amp;nbsp;to extract one or two sub-column form the proc freq results involving. if i use list in the code, it doesnot show the 'total' column values. so couldnot opt that too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the attached image, i would need the values of Cylinders with (4.6.8 and total) column values.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.cars;&lt;/P&gt;&lt;P&gt;tables make*cylinders / nopercent nocol;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have masked the percentage from display. But also, it will be helpful if one could teach me to take the percentage values to separate column values as dataset?&lt;/P&gt;&lt;P&gt;Do pls teach.!&lt;/P&gt;&lt;P&gt;TIA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12996i0B86B19A83C22894/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="help topic.png" title="help topic.png" /&gt;</description>
      <pubDate>Wed, 21 Sep 2016 01:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299723#M312233</guid>
      <dc:creator>sooryavasudevan</dc:creator>
      <dc:date>2016-09-21T01:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299730#M312234</link>
      <description>&lt;P&gt;Please detail what you want as your output. Is this supposed to be a dataset or an output like PROC FREQ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105471"&gt;@sooryavasudevan&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;if i use list in the code, it doesnot show the 'total' column values. so couldnot opt that too.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have masked the percentage from display. But also, it will be helpful if one could teach me to take the percentage values to separate column values as dataset?&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;I don't know what the first sentence means. The second portion, I think you want to include percentage as output?&lt;/P&gt;
&lt;P&gt;Also, please refer to the documentation, there are examples that highlight several things you may be interested in:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/viewer.htm#procstat_freq_examples.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/viewer.htm#procstat_freq_examples.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 03:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299730#M312234</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-21T03:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299744#M312235</link>
      <description>&lt;PRE&gt;

It is good for SQL.



proc sql;
select make,cylinders,count(*) as freq,
count(*)/(select count(*) from sashelp.cars where make=a.make) as per,
(select count(*) from sashelp.cars where make=a.make) as total
from sashelp.cars as a
 where cylinders in ( 4 6 8)
  group by make,cylinders;
run;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Sep 2016 05:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299744#M312235</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-09-21T05:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299745#M312236</link>
      <description>&lt;P&gt;By selecting specific cylinders your total will be different from total before selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, either you want:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.cars&lt;STRONG&gt;(where=(cylinders in (4 6 8)))&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;tables make*cylinders / nopercent nocol;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.cars;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output out=my_freq((where=(cylinders in (4 6 8)));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;tables make*cylinders / nopercent nocol;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try both and look at results. Chosse whatever fits your expectations.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 05:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299745#M312236</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-21T05:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299813#M312237</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, i want my output &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as a dataset.&lt;/SPAN&gt;&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/viewer.htm#procstat_freq_examples01.htm" target="_blank"&gt;Output 3.1.2: Crosstabulation Table&lt;/A&gt;&amp;nbsp;click on the link and go the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets consider that as my output. then i want my dataset to be in the attached format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i need a code solution for that. Couldnot extract specifically.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 12:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299813#M312237</guid>
      <dc:creator>sooryavasudevan</dc:creator>
      <dc:date>2016-09-21T12:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299835#M312238</link>
      <description>&lt;P&gt;Is this what you are looking for ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.cars&lt;STRONG&gt;(where=(cylinders in (4 6 8)))&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;tables make*cylinders / nopercent nocol;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output out = want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not - where is the problem ?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 13:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/299835#M312238</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-21T13:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300023#M312239</link>
      <description>&lt;P&gt;Thanks much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That helped. Just made little changes to get percentage values.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 02:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300023#M312239</guid>
      <dc:creator>sooryavasudevan</dc:creator>
      <dc:date>2016-09-22T02:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300024#M312240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ok, so it gave me the output but still in a list format. my desired result are categorical format. PFA&lt;/P&gt;&lt;P&gt;like a tabular form as i given below.&lt;/P&gt;&lt;P&gt;Make | 4 | 6 | 8 | Total | Percent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know proc freq may not be proper solution. Still couldnot separate the sub-category values and take as output.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 02:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300024#M312240</guid>
      <dc:creator>sooryavasudevan</dc:creator>
      <dc:date>2016-09-22T02:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How To derive desired sub-column variable to dataset from proc freq result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300032#M312241</link>
      <description>&lt;P&gt;Unfortunately none of the procedures will generate a data set in that format. Use a proc transpose to get the format you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 04:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-derive-desired-sub-column-variable-to-dataset-from-proc/m-p/300032#M312241</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-22T04:56:32Z</dc:date>
    </item>
  </channel>
</rss>

