<?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: Proc tabulate question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841110#M36456</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input id $ foodtype $ Nova $ Subnova $ kcals;
datalines;
001 butter 1 oils 10
001 fish 2 protein 15
001 banana 3 fruit 10
001 cherry 4 fruit 25
002 burger 2 frozen 5
002 pumpkin 2 other 4
002 carrot 3 veg 6
003 apple 1 fruit 100
003 tahini 4   spread   60
005  burger  2  frozen  13
005 ceral  3 grain 56
005 milk  1  prod 35
005 vinegar 4  Other  100
;
run;
 
proc sql;
create table temp as
select distinct 1 as a,id,input(nova,best.) as nova,cats('Total_',nova) as var length=80,sum(kcals) as value
 from test
  group by id,nova 
union all
select distinct 2 ,id,input(nova,best.),cats('Percent_',nova) as var length=80,sum(kcals)/(select sum(kcals) from test where id=a.id ) as value
 from test as a
  group by id,nova 
union all
select distinct 3 as a,id,999,'All_Total' as var length=80,sum(kcals) as value
 from test
  group by id
union all
select distinct 4 ,id,999,'All_Percent' as var length=80,1 as value
 from test
  group by id
union all
select distinct 5 ,'All',input(nova,best.),cats('Total_',nova) as var,sum(kcals) as value
 from test
  group by nova
union all
select distinct 6 ,'All',input(nova,best.),cats('Percent_',nova) as var, sum(kcals)/(select sum(kcals) from test ) as value
 from test as b
  group by nova 
union all
select distinct 7 ,'All',9999,'All_Total' as var length=80,sum(kcals) as value
 from test
union all
select distinct 8 ,'All',9999,'All_Percent' as var length=80,1 as value
 from test
  order by id,nova,a
;
quit; 
proc transpose data=temp out=want(drop=_:);
by id;
id var;
var value;
format percent_: percent8.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Oct 2022 11:57:51 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-10-27T11:57:51Z</dc:date>
    <item>
      <title>Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841055#M36454</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Down below is my dataset and procedure for reference. I need my proc tabulate table to be a dataset so I can calculate further statistics with it and it seems like "out=test1'' is not working. The proc tabulate procedure works, but the output dataset is just all over the place so I'm clearly missing something here. When I want to use that results just to do this for example:&lt;/P&gt;&lt;P&gt;data test2; set test1; run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't show me the table I got in proc tabulate initially. Can anyone help? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;data test;&lt;/DIV&gt;&lt;DIV&gt;input id $ foodtype $ Nova $ Subnova $ kcals;&lt;/DIV&gt;&lt;DIV&gt;datalines;&lt;/DIV&gt;&lt;DIV&gt;001 butter 1 oils 10&lt;/DIV&gt;&lt;DIV&gt;001 fish 2 protein 15&lt;/DIV&gt;&lt;DIV&gt;001 banana 3 fruit 10&lt;/DIV&gt;&lt;DIV&gt;001 cherry 4 fruit 25&lt;/DIV&gt;&lt;DIV&gt;002 burger 2 frozen 5&lt;/DIV&gt;&lt;DIV&gt;002 pumpkin 2 other 4&lt;/DIV&gt;&lt;DIV&gt;002 carrot 3 veg 6&lt;/DIV&gt;&lt;DIV&gt;003 apple 1 fruit 100&lt;/DIV&gt;&lt;DIV&gt;003 tahini 4 &amp;nbsp; spread &amp;nbsp; 60&lt;/DIV&gt;&lt;DIV&gt;005 &amp;nbsp;burger &amp;nbsp;2 &amp;nbsp;frozen &amp;nbsp;13&lt;/DIV&gt;&lt;DIV&gt;005 ceral &amp;nbsp;3 grain 56&lt;/DIV&gt;&lt;DIV&gt;005 milk &amp;nbsp;1 &amp;nbsp;prod 35&lt;/DIV&gt;&lt;DIV&gt;005 vinegar 4 &amp;nbsp;Other &amp;nbsp;100&lt;/DIV&gt;&lt;DIV&gt;;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc tabulate data=test out=test1;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;class id nova;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;var kcals;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;table id all='All participants',&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (nova all='Total calories per participant')*&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;kcals=' '*(sum='Total calories' rowpctsum='Percentage') &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/ misstext=' ';&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Oct 2022 02:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841055#M36454</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T02:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841070#M36455</link>
      <description>&lt;P&gt;You should provide an example of what expect the data set to look like. "Not working" is pretty vague. I suspect you actually&amp;nbsp; mean "the output doesn't match what I thought it would".&lt;/P&gt;
&lt;P&gt;Remember that SAS cannot have two variables with the same name, so your result column labels must have additional information somewhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not even going to guess what you expect for a result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output for Proc Tabulate is very specific and expects you to understand what those _type_ and _table_ variables mean. It may mean that you want a different procedure than tabulate and/or pre or post processing to get the desired result.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 06:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841070#M36455</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-27T06:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841110#M36456</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input id $ foodtype $ Nova $ Subnova $ kcals;
datalines;
001 butter 1 oils 10
001 fish 2 protein 15
001 banana 3 fruit 10
001 cherry 4 fruit 25
002 burger 2 frozen 5
002 pumpkin 2 other 4
002 carrot 3 veg 6
003 apple 1 fruit 100
003 tahini 4   spread   60
005  burger  2  frozen  13
005 ceral  3 grain 56
005 milk  1  prod 35
005 vinegar 4  Other  100
;
run;
 
proc sql;
create table temp as
select distinct 1 as a,id,input(nova,best.) as nova,cats('Total_',nova) as var length=80,sum(kcals) as value
 from test
  group by id,nova 
union all
select distinct 2 ,id,input(nova,best.),cats('Percent_',nova) as var length=80,sum(kcals)/(select sum(kcals) from test where id=a.id ) as value
 from test as a
  group by id,nova 
union all
select distinct 3 as a,id,999,'All_Total' as var length=80,sum(kcals) as value
 from test
  group by id
union all
select distinct 4 ,id,999,'All_Percent' as var length=80,1 as value
 from test
  group by id
union all
select distinct 5 ,'All',input(nova,best.),cats('Total_',nova) as var,sum(kcals) as value
 from test
  group by nova
union all
select distinct 6 ,'All',input(nova,best.),cats('Percent_',nova) as var, sum(kcals)/(select sum(kcals) from test ) as value
 from test as b
  group by nova 
union all
select distinct 7 ,'All',9999,'All_Total' as var length=80,sum(kcals) as value
 from test
union all
select distinct 8 ,'All',9999,'All_Percent' as var length=80,1 as value
 from test
  order by id,nova,a
;
quit; 
proc transpose data=temp out=want(drop=_:);
by id;
id var;
var value;
format percent_: percent8.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2022 11:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841110#M36456</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-27T11:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841158#M36457</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The TABULATE output is &lt;U&gt;&lt;STRONG&gt;not&lt;/STRONG&gt; &lt;/U&gt;going to be in the same structure as the results you see in the results window but it is very understandable:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1666881079164.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76701i95F92BB69FAA2F41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1666881079164.png" alt="Cynthia_sas_0-1666881079164.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The results at the top show the TABULATE output. The PRINT at the bottom show what you get in TEST1. As you can see, the _TYPE_ indicates which categorical&amp;nbsp; variable crossings are represented by the statistics. I color coded the _TYPE_ values with the same cells in the TABULATE screen shot, so you could trace the _TYPE_ and the calculate values back to the TABULATE results. You should be able to work with the TEST1 data for your subsequent calculations, once you understand how the structure is different and which columns you are interested in based on the _TYPE_ value.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 14:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841158#M36457</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-10-27T14:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841159#M36458</link>
      <description>Why do you want a data set in that same format? You can pipe this output directly to PPT, Word, Excel from proc tabulate. &lt;BR /&gt;If you're doing a further step, there may be a better way to get/store this data.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Oct 2022 14:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841159#M36458</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-27T14:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841171#M36459</link>
      <description>&lt;P&gt;Ok I understand the dataset much better, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the difficulty I have here is that, if the total kcals is 0 for one ID, then I want to remove that ID from my database completely. I don't have one here, but in my real database I do (total kcals is 0 for some IDs) and I will have to remove those IDs. But I can't do it if in the dataset, the total can't be differentiated from individual entries. Do you get what I mean? I might have to use another way to get to the wanted result. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 15:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841171#M36459</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T15:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841174#M36460</link>
      <description>&lt;P&gt;That's exactly it, I want to do a further step. Let me know if you have suggestions!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 15:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841174#M36460</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T15:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841203#M36464</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm not sure whether your KCALS value would be missing (shown in SAS as a . dot or period) or would actually be 0. Depending on what your data is actually like, you may need to use PROC MEANS or another procedure to pre-summarize KCALS by ID and then just make a new dataset prior to the TABULATE by eliminating the rows with the total of 0 or of missing for the KCALS value. Or you could do the summary and eliminate the rows in the data from PROC TABULATE but either way, you'll have to do something separate to eliminate the rows with total KCALS of missing or 0;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 18:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841203#M36464</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-10-27T18:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841205#M36465</link>
      <description>&lt;P&gt;I could have been more clear, yes. I meant that the output dataset it doesn't match the results. &amp;nbsp;Down below is what I would want as a result (in a dataset). But I will have a deep look into the variables to understand how to get the desired result. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ID 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Id 002&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ID 003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ID 004&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ID 005&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;TOTAL&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Nova 1&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Nova 2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Nova 3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Nova 4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TOTAL kcals from NOVA 1 to 4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;kcals&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 27 Oct 2022 18:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841205#M36465</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841206#M36466</link>
      <description>&lt;P&gt;Yes they would be dots and zeros. I didn't have any empty ones in this dataset, but I will in my actul database for my projet. But ok that makes sense. I'll try that, thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 18:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841206#M36466</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841212#M36467</link>
      <description>Do want percentages and counts? Does it matter if they're in the order as shown or in side by side essentially (ID1-ID5 TOTAL PCT_ID1-PCT_ID5 TOTAL)?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Oct 2022 19:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841212#M36467</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-27T19:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841223#M36468</link>
      <description>&lt;P&gt;Counts would be enough for now and order is not important. I can calculate pourcentages later on I guess.&lt;/P&gt;&lt;P&gt;I am just not able to create the two-dimensional table (categorized by id AND nova) I want with other functions like proc sql. I want my dataset to look like the results I get from proc tabulate.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 20:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841223#M36468</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-10-27T20:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841245#M36469</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You can get IDs going across the rows like this using PROC REPORT:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1666916784619.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76709i4E802F0B82964E50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1666916784619.png" alt="Cynthia_sas_0-1666916784619.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That's a different approach than TABULATE, but if you do not need percents, may be easier to work with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 00:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841245#M36469</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-10-28T00:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841249#M36470</link>
      <description>&lt;P&gt;It may help to provide a starting data set and what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have not clearly described what the resulting data set should contain, variable names, types and some specific values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or why.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 04:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/841249#M36470</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-28T04:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/842209#M36512</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This was very helpful! I am now struggling to get percentages as it seems like the name of my variables don't exist anymore (kcals, nova, etc.).&lt;/P&gt;&lt;P&gt;I first did this to delete people who didn't consume anything (after having used the synthax you provided):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data novanew2;&lt;BR /&gt;set novanew;&lt;BR /&gt;if ktot=0 then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to know the % of consumption of the nova categories among all participants (should be 52.8% for nova 4 for example). Could I used proc report again? And add something such as "define pctsum/"Percent of consumption"; "? Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edited reply -&lt;/P&gt;&lt;P&gt;I found this way to do it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc tabulate data=novanew2 out=novanew3;&lt;BR /&gt;class nova;&lt;BR /&gt;var ktot;&lt;BR /&gt;table all='All IDS',&lt;BR /&gt;(nova all='All cals per id')*&lt;BR /&gt;ktot=' '*(rowpctsum)&lt;BR /&gt;/ misstext=' '&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 21:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/842209#M36512</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2022-11-02T21:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/842226#M36514</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425348"&gt;@SJ12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That's exactly it, I want to do a further step. Let me know if you have suggestions!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hard to make suggestions when we don't know where you are going with this.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 22:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-tabulate-question/m-p/842226#M36514</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-02T22:59:39Z</dc:date>
    </item>
  </channel>
</rss>

