<?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 Report Summarize in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725186#M225213</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PR1.PNG" style="width: 513px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55778i17688EDAC80D79C5/image-dimensions/513x171?v=v2" width="513" height="171" role="button" title="PR1.PNG" alt="PR1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for the above screenshot as an example. I was trying to get resolve the value for totalpln should be 60 for resource1. Similarly&amp;nbsp; for totalact should be 60 for resource1..&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 16:19:33 GMT</pubDate>
    <dc:creator>SahooP</dc:creator>
    <dc:date>2021-03-10T16:19:33Z</dc:date>
    <item>
      <title>Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725127#M225192</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc report.PNG" style="width: 490px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55763i7D30C137953795E9/image-dimensions/490x190?v=v2" width="490" height="190" role="button" title="proc report.PNG" alt="proc report.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;The above report I have created here i need a help how to create a new variable called&amp;nbsp;totalpln&amp;nbsp; which will be sum of "pln" for each month. Similarly other two variable as well.. . I have attached my SAS code.&lt;/P&gt;&lt;P&gt;Can someone help me&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA planacthours;
INPUT prid $ taskname $ resourcename $9. month :monyy5. pln act var;
format month monyy5.;

CARDS;
pr15614 task1 resource1 Jan-21 20.0 10.0 10.0
pr15614 task1 resource1 Feb-21 20.0 20.0 0.0
pr15614 task1 resource1 Mar-21 20.0 30.0 -10.0
pr15614 task2 resource1 Apr-21 40.0 10.0 30.0
pr15614 task1 resource2 Jan-21 60.0 70.0 -10.0
pr15614 task2 resource2 Feb-21 60.0 40.0 20.0
pr15614 task1 resource2 Mar-21 20.0 10.0 10.0
pr15614 task2 resource2 Apr-21 80.0 10.0 70.0
pr15614 task1 resource3 Jan-21 20.0 10.0 10.0
pr15614 task1 resource3 Feb-21 40.0 60.0 -20.0
pr15614 task3 resource3 Mar-21 20.0 10.0 10.0
pr15614 task3 resource4 Jan-21 20.0 10.0 10.0
pr15614 task4 resource4 Apr-21 20.0 50.0 -40.0
pr15614 task4 resource4 Feb-21 20.0 10.0 10.0
;
RUN;

PROC REPORT DATA=test NOWD ;
COLUMN  prid taskname resourcename month,(pln act var);
DEFINE prid / group;
DEFINE taskname / group;
DEFINE resourcename / group;
DEFINE month / across order=data;
DEFINE pln / analysis  FORMAT=3.2;
DEFINE act / analysis  FORMAT=3.2;
DEFINE var / analysis  FORMAT=3.2;
/*DEFINE totalpln / display  FORMAT=3.2;*/

/*define total/computed FORMAT=3.2;*/
/*compute total;*/
/*total=pln.sum;*/
/*endcomp;*/
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&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, 10 Mar 2021 13:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725127#M225192</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-03-10T13:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725172#M225207</link>
      <description>&lt;P&gt;Sum &lt;STRONG&gt;where&lt;/STRONG&gt;? after each Task? after each Prid? Some other rule?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725172#M225207</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-10T15:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725173#M225208</link>
      <description>&lt;P&gt;Yes, sum of each &lt;SPAN&gt;after each Task and&amp;nbsp; after each Prid and each resourcename.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725173#M225208</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-03-10T15:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725177#M225210</link>
      <description>&lt;P&gt;Your code is already summing at the Resourcename. Are you sure that it makes sense to sum again AFTER the resourcename?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725177#M225210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-10T15:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725179#M225212</link>
      <description>Yes, I have create three different additional column for pl, act and var . That should be sum of each month. For example as per given screenshot the first row sum pln should be should be 60 for resource1 that column should be totalpln.</description>
      <pubDate>Wed, 10 Mar 2021 16:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725179#M225212</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-03-10T16:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725186#M225213</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PR1.PNG" style="width: 513px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55778i17688EDAC80D79C5/image-dimensions/513x171?v=v2" width="513" height="171" role="button" title="PR1.PNG" alt="PR1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for the above screenshot as an example. I was trying to get resolve the value for totalpln should be 60 for resource1. Similarly&amp;nbsp; for totalact should be 60 for resource1..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 16:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725186#M225213</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-03-10T16:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725188#M225214</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Perhaps this is closer to what you envision:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1615393132900.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55780i48D7C77C08DC4FCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1615393132900.png" alt="Cynthia_sas_0-1615393132900.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;PROC REPORT will allow you to put a variable on a report multiple times, as shown above. The first usage of PLN, ACT and VAR are in the COLUMN statement under the ACROSS variable. The next usage is to have them listed by themselves, for the final TOTAL columns at the far right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, in order to put in the Task Total and Grand Total labels at the breaks on the summary row, your sample program needed to have a LENGTH statement for PRID and RESOURCENAME so the field would be big enough for those total strings. "Task Total" is a length of 10 and "Grand Total" is a length of 11. Here's what the LENGTH statement looked like in the DATA step.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;&lt;STRONG&gt;length prid $11 resourcename $10;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Otherwise the rest of the DATA step code was the same. I changed the dataset name to be TEST since that is what you used in the REPORT step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 16:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725188#M225214</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-03-10T16:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725192#M225217</link>
      <description>Thank you so much for your help.</description>
      <pubDate>Wed, 10 Mar 2021 16:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Summarize/m-p/725192#M225217</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-03-10T16:28:35Z</dc:date>
    </item>
  </channel>
</rss>

