<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618838#M181590</link>
    <description>&lt;P&gt;Please post a visual example of the expected output.&lt;/P&gt;
&lt;P&gt;Also test your code, the code as posted crashes.&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/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In the following proc&amp;nbsp; report&amp;nbsp; I want to show also name of day below the date.&lt;/P&gt;
&lt;P&gt;(I will delete my previous post because maybe it was not&amp;nbsp; explained well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data RawTbl;
informat date1 date9.;
format date1 date9.;
input ID date1 Y groupp $;
NameDay = put(date1,dowName. -l) ;
cards;
1 '17Jan2019'd 10 a
2 '17Jan2019'd 20 a
3 '19Jan2019'd 30 a
4 '21Jan2019'd 40 b
5 '23Jan2019'd 50 b
6 '18Jan2019'd 60 b
7 '17Jan2019'd 70 a
8 '08Jan2019'd 80 c
9 '04Jan2019'd 90 c
;
Run;

title;
proc report data=RawTbl nowd;
column groupp date1,Y;
define groupp / group;
define date1 / across;/*I want to show also NameDay under date1*/
define Y / SUM;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 12:10:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-21T12:10:23Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618824#M181584</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In the following proc&amp;nbsp; report&amp;nbsp; I want to show also name of day below the date.&lt;/P&gt;
&lt;P&gt;(I will delete my previous post because maybe it was not&amp;nbsp; explained well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data RawTbl;
informat date1 date9.;
format date1 date9.;
input ID date1 Y groupp $;
NameDay = put(date1,dowName. -l) ;
cards;
1 '17Jan2019'd 10 a
2 '17Jan2019'd 20 a
3 '19Jan2019'd 30 a
4 '21Jan2019'd 40 b
5 '23Jan2019'd 50 b
6 '18Jan2019'd 60 b
7 '17Jan2019'd 70 a
8 '08Jan2019'd 80 c
9 '04Jan2019'd 90 c
;
Run;

title;
proc report data=RawTbl nowd;
column groupp date1,Y;
define groupp / group;
define date1 / across;/*I want to show also NameDay under date1*/
define Y / SUM;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jan 2020 11:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618824#M181584</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-21T11:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618838#M181590</link>
      <description>&lt;P&gt;Please post a visual example of the expected output.&lt;/P&gt;
&lt;P&gt;Also test your code, the code as posted crashes.&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/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In the following proc&amp;nbsp; report&amp;nbsp; I want to show also name of day below the date.&lt;/P&gt;
&lt;P&gt;(I will delete my previous post because maybe it was not&amp;nbsp; explained well)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data RawTbl;
informat date1 date9.;
format date1 date9.;
input ID date1 Y groupp $;
NameDay = put(date1,dowName. -l) ;
cards;
1 '17Jan2019'd 10 a
2 '17Jan2019'd 20 a
3 '19Jan2019'd 30 a
4 '21Jan2019'd 40 b
5 '23Jan2019'd 50 b
6 '18Jan2019'd 60 b
7 '17Jan2019'd 70 a
8 '08Jan2019'd 80 c
9 '04Jan2019'd 90 c
;
Run;

title;
proc report data=RawTbl nowd;
column groupp date1,Y;
define groupp / group;
define date1 / across;/*I want to show also NameDay under date1*/
define Y / SUM;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 12:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618838#M181590</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-21T12:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618909#M181620</link>
      <description>&lt;P&gt;The date literal form of 'ddmonyyyy'd is for use in lines of code not really for reading in as data, especially not with a date9 format.&lt;/P&gt;
&lt;P&gt;Your data step likely should be:&lt;/P&gt;
&lt;PRE&gt;Data RawTbl;
informat date1 date9.;
format date1 date9.;
input ID date1 Y groupp $;
NameDay = put(date1,dowName. -l) ;
cards;
1 17Jan2019 10 a
2 17Jan2019 20 a
3 19Jan2019 30 a
4 21Jan2019 40 b
5 23Jan2019 50 b
6 18Jan2019 60 b
7 17Jan2019 70 a
8 08Jan2019 80 c
9 04Jan2019 90 c
;
Run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jan 2020 17:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618909#M181620</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-21T17:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618963#M181640</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35531iD2356B56511200A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS1.PNG" alt="SAS1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;This is the required output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 21:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/618963#M181640</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-21T21:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619002#M181656</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35531iD2356B56511200A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS1.PNG" alt="SAS1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;This is the required output.&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;Don't know about Proc Report. Here is a Proc Tabulate that gets close:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=RawTbl;
   class groupp date1 nameday;
   format nameday downame.;
   var y;
   table groupp="" all='Total',
         date1=""*nameday=""*y=""*sum=""*f=best5.
         all='Total'*y=""*sum=""*f=best5.
         /box=groupp misstext='0'
         
   ;
run;
&lt;/PRE&gt;
&lt;P&gt;This won't work if you want to do manipulations with summarized values such as adding columns though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 23:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619002#M181656</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-21T23:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619038#M181672</link>
      <description>&lt;P&gt;It is great but I would like to know how to do it with proc Report too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 05:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619038#M181672</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-22T05:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619059#M181683</link>
      <description>&lt;P&gt;Maxim 14: Use the Right Tool.&lt;/P&gt;
&lt;P&gt;If the suggested proc tabulate gets what you need, there's no need to waste time by beating another tool into submission that's not really suited.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619059#M181683</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-22T08:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619060#M181684</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;If the target is to learn then we might know different ways that getting same result.&lt;/P&gt;
&lt;P&gt;In this case as I understand it is not recommended to use proc report&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619060#M181684</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-22T08:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619063#M181685</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;ideal&amp;nbsp;&lt;/EM&gt;tool for a report like yours is Web Report Studio, where you can use a multidimensional table ("cube") as base and set up your dimensions as wanted; row- and column-summary cells are just a mouseclick away.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619063#M181685</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-22T08:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619255#M181767</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;If the target is to learn then we might know different ways that getting same result.&lt;/P&gt;
&lt;P&gt;In this case as I understand it is not recommended to use proc report&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nesting in multiple dimensions is not Proc Report's strength. Proc Report has the ability to use do more complex in-body-of-table calculations and not statistic information with care. Proc Tabulate doesn't do that. But does more complex nesting of class values as well as creating multiple table layouts with a single procedure call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that if you are using the correct ODS destination and are extremely careful with literal characters you could get similar appearance with a custom picture format for data values that displays the date plus name of week with a split character in the body of the formatted value..&lt;/P&gt;
&lt;P&gt;I'll leave that as an exercise for the interested reader.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 17:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619255#M181767</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-22T17:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619259#M181770</link>
      <description>&lt;P&gt;When I want a report with row statistics at the right and column statistics at the bottom, I use a combination of PROC SUMMARY followed by PROC REPORT. This is very general, if you want means instead of totals, or if you want percents instead of totals, or medians or standard deviations or percentiles, the modifications to PROC SUMMARY should be obvious. It extends easily to weighted sums, weighted means, weighted percents, &lt;EM&gt;etc&lt;/EM&gt;. in the PROC SUMMARY part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data RawTbl;
informat date1 date9.;
format date1 date9.;
input ID date1 Y groupp $;
NameDay = weekday(date1);
format nameday downame.;
longname=cats(put(date1,date7.),'~{newline}',put(nameday,downame.));
cards;
1 17Jan2019 10 a
2 17Jan2019 20 a
3 19Jan2019 30 a
4 21Jan2019 40 b
5 23Jan2019 50 b
6 18Jan2019 60 b
7 17Jan2019 70 a
8 08Jan2019 80 c
9 04Jan2019 90 c
;
Run;
proc summary data=rawtbl;
	var y;
	class longname groupp;
	output out=_sums_ sum=;
run;
data _sums_;
	set _sums_;
	if missing(longname) then longname='ZZZZ';
	if missing(groupp) then groupp='zzzz';
run;
proc format;
	value $groupf 'zzzz'='Total';
	value $longf 'ZZZZ'='Total' other=[$30.];
run;		
ods escapechar='~';
options missing='0';
proc report data=_sums_;
    columns ("Group" groupp) longname,y;
	define groupp/group ' ' order=internal format=$groupf.;
	define longname/across order=internal format=$longf. 'Date';
	define y/sum ' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please in your own code adopt the indenting of statements as I have added above underneath your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, there is no need for CARDS; to contain '17JAN2019'd when you can use 17JAN2019 which is easier to type and less prone to typing errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This method of concatenating date and day of week fails if the data contains more than one month because of the requirement of spelling out month in 3 letter abbreviations. If you can use the YYMMDD10. format, then I think it works across multiple months.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 18:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/619259#M181770</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-22T18:45:24Z</dc:date>
    </item>
  </channel>
</rss>

