<?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: Report Layout- Which Procedure to use in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10944#M1140</link>
    <description>obviously in a data step you can control the formatting cel-by-cell &lt;BR /&gt;
- if that is your need then you may have to go that way, along with ODS handling.&lt;BR /&gt;
 &lt;BR /&gt;
I see no excuse for such arbitrary formatting, so over to you &lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
peterC</description>
    <pubDate>Mon, 04 Oct 2010 13:11:20 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2010-10-04T13:11:20Z</dc:date>
    <item>
      <title>Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10940#M1136</link>
      <description>Hi ,&lt;BR /&gt;
&lt;BR /&gt;
I have the following data .&lt;BR /&gt;
disp	test	test1&lt;BR /&gt;
mm	A1	123&lt;BR /&gt;
mm	B1	123&lt;BR /&gt;
mm	C1	123&lt;BR /&gt;
mm	D1	300&lt;BR /&gt;
mm	E1	0&lt;BR /&gt;
mm	F1	45&lt;BR /&gt;
q1	A1	222&lt;BR /&gt;
q1	B1	333&lt;BR /&gt;
q1	C1	0&lt;BR /&gt;
q1	D1	99&lt;BR /&gt;
q1	E1	0&lt;BR /&gt;
q1	F1	450&lt;BR /&gt;
q2	A1	333&lt;BR /&gt;
q2	B1	555&lt;BR /&gt;
q2	C1	98&lt;BR /&gt;
q2	D1	0&lt;BR /&gt;
q2	E1	122&lt;BR /&gt;
q2	F1	0&lt;BR /&gt;
q3	A1	440&lt;BR /&gt;
q3	B1	0&lt;BR /&gt;
q3	C1	0&lt;BR /&gt;
q3	D1	780&lt;BR /&gt;
q3	E1	0&lt;BR /&gt;
q3	F1	0&lt;BR /&gt;
q4	A1	3&lt;BR /&gt;
q4	B1	300&lt;BR /&gt;
q4	C1	3&lt;BR /&gt;
q4	D1	868&lt;BR /&gt;
q4	E1	0&lt;BR /&gt;
q4	F1	0&lt;BR /&gt;
&lt;BR /&gt;
The report required is in the following format &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Test     mm  q1  q2  q3  q4 &lt;BR /&gt;
&lt;BR /&gt;
A1      123  222 333 440 003  &lt;BR /&gt;
B1      123  333 555 000 300&lt;BR /&gt;
C1      123  000 098 000 003&lt;BR /&gt;
                   &lt;BR /&gt;
Total   369  555 986 440 306&lt;BR /&gt;
&lt;BR /&gt;
D1      300  099 000 780 868&lt;BR /&gt;
&lt;BR /&gt;
E1      000  000 122 000 000&lt;BR /&gt;
F1      045  450 000 000 000&lt;BR /&gt;
&lt;BR /&gt;
Total   045  450 122 000 000&lt;BR /&gt;
&lt;BR /&gt;
The problem is the intermediate total to be displayed.&lt;BR /&gt;
Here  the 1st total is that of A1 B1 C1&lt;BR /&gt;
&lt;BR /&gt;
and the last total is that of E1 F1&lt;BR /&gt;
&lt;BR /&gt;
Looking at the Tabulate /Report i feel its impossible to have split totals&lt;BR /&gt;
in such a format .&lt;BR /&gt;
&lt;BR /&gt;
Please advice ,if its at all possible in SAS to have such layouts and how we could actually do it.</description>
      <pubDate>Sun, 03 Oct 2010 15:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10940#M1136</guid>
      <dc:creator>tommy81</dc:creator>
      <dc:date>2010-10-03T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10941#M1137</link>
      <description>Investigate PROC REPORT (with the ACROSS option) and also possibly needing/wanting to use PROC TRANSPOSE on your input data to prepare it (converting vertical obs to horizontal).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc report across site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
proc transpose site:sas.com</description>
      <pubDate>Sun, 03 Oct 2010 15:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10941#M1137</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-03T15:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10942#M1138</link>
      <description>I notice you have no sub-total for D.&lt;BR /&gt;
This is standard in proc print when a by-group has only one entry. For other procedures it would cause a bit more trouble.&lt;BR /&gt;
I guess you want a proc print like&lt;BR /&gt;
proc print label ;&lt;BR /&gt;
 by grouping ; * grouping abc together, D on its own and e,f together;&lt;BR /&gt;
 var  test mm q1-q4 ;&lt;BR /&gt;
run;&lt;BR /&gt;
For this to work, you need &lt;BR /&gt;
1 to create your your "grouping" variable for sorting the data&lt;BR /&gt;
2 columns of mm and q1-q4&lt;BR /&gt;
Can you do that in proc transpose or a data step?</description>
      <pubDate>Sun, 03 Oct 2010 17:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10942#M1138</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-10-03T17:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10943#M1139</link>
      <description>Thankyou .&lt;BR /&gt;
Infact I tried splitting the data in 3 and then combing .It worked as expected.&lt;BR /&gt;
&lt;BR /&gt;
However I have  format issue&lt;BR /&gt;
&lt;BR /&gt;
Test mm q1 q2 q3 q4 &lt;BR /&gt;
&lt;BR /&gt;
A1 123 222 333 440 003 &lt;BR /&gt;
B1 123 333 555 000 300&lt;BR /&gt;
C1 123 000 098 000 003&lt;BR /&gt;
&lt;BR /&gt;
Total 369 555 986 440 306&lt;BR /&gt;
&lt;BR /&gt;
D1 300 099 000 780 868&lt;BR /&gt;
&lt;BR /&gt;
E1 $000 $000 $122 $000 $000&lt;BR /&gt;
F1 $045 $450 $000 $000 $000&lt;BR /&gt;
&lt;BR /&gt;
Total $045 $450 $122 $000 $000.&lt;BR /&gt;
&lt;BR /&gt;
Would it be possible in SAS to get the above output with $ sign in the last 3 rows only ?</description>
      <pubDate>Mon, 04 Oct 2010 08:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10943#M1139</guid>
      <dc:creator>tommy81</dc:creator>
      <dc:date>2010-10-04T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10944#M1140</link>
      <description>obviously in a data step you can control the formatting cel-by-cell &lt;BR /&gt;
- if that is your need then you may have to go that way, along with ODS handling.&lt;BR /&gt;
 &lt;BR /&gt;
I see no excuse for such arbitrary formatting, so over to you &lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
peterC</description>
      <pubDate>Mon, 04 Oct 2010 13:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10944#M1140</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-10-04T13:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10945#M1141</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Peter -- I might understand treating the "Total" summary lines differently, but I don't understand how formatting the E1, F1 and only the last sub-total with $ adds anything to the report.&lt;BR /&gt;
&lt;BR /&gt;
  As Peter said, you could do this in a DATA step program. You can also use a CALL DEFINE statement in PROC REPORT to have a different format applied to a cell. But the down-side of the PROC REPORT approach is that you would also have a SUB-TOTAL for the D1 row. The program below uses a dataset called TESTDATA with a grouping variable called "GRPING" that is defined as a NOPRINT variable. Right now, the program puts $ on ALL the summary lines and then also puts the $ on the E1 and F1 rows. The logic will be a bit trickier if you want to ONLY put $ on the E1, F1 and last summary line. But if you're going to go down the DATA step road, you will have control over every cell you write.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
   &lt;BR /&gt;
[pre]&lt;BR /&gt;
data testdata;&lt;BR /&gt;
  length disp $2 test $8;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input disp $ test $ test1;&lt;BR /&gt;
  if test in ('A1', 'B1', 'C1') then grping = 1;&lt;BR /&gt;
  else if test = 'D1' then grping = 2;&lt;BR /&gt;
  else if test in ('E1', 'F1') then grping = 3;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
mm A1 123&lt;BR /&gt;
mm B1 123&lt;BR /&gt;
mm C1 123&lt;BR /&gt;
mm D1 300&lt;BR /&gt;
mm E1 0&lt;BR /&gt;
mm F1 45&lt;BR /&gt;
q1 A1 222&lt;BR /&gt;
q1 B1 333&lt;BR /&gt;
q1 C1 0&lt;BR /&gt;
q1 D1 99&lt;BR /&gt;
q1 E1 0&lt;BR /&gt;
q1 F1 450&lt;BR /&gt;
q2 A1 333&lt;BR /&gt;
q2 B1 555&lt;BR /&gt;
q2 C1 98&lt;BR /&gt;
q2 D1 0&lt;BR /&gt;
q2 E1 122&lt;BR /&gt;
q2 F1 0&lt;BR /&gt;
q3 A1 440&lt;BR /&gt;
q3 B1 0&lt;BR /&gt;
q3 C1 0&lt;BR /&gt;
q3 D1 780&lt;BR /&gt;
q3 E1 0&lt;BR /&gt;
q3 F1 0&lt;BR /&gt;
q4 A1 3&lt;BR /&gt;
q4 B1 300&lt;BR /&gt;
q4 C1 3&lt;BR /&gt;
q4 D1 868&lt;BR /&gt;
q4 E1 0&lt;BR /&gt;
q4 F1 0&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                                                          &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\calldef.html' style=sasweb;&lt;BR /&gt;
proc report data=testdata nowd;&lt;BR /&gt;
  column grping test test1,disp;&lt;BR /&gt;
  title '1) With PROC REPORT -- no need to transpose, but you get a subtotal for D1';&lt;BR /&gt;
  define grping / group noprint;&lt;BR /&gt;
  define test / group;&lt;BR /&gt;
  define disp / across 'Disp As Across Var';&lt;BR /&gt;
  define test1 / sum f=comma14.0 ' ';&lt;BR /&gt;
  break after grping / summarize;&lt;BR /&gt;
  compute test1;&lt;BR /&gt;
    if (upcase(_break_)='GRPING') or &lt;BR /&gt;
        test in ('E1', 'F1') then do;&lt;BR /&gt;
      call define('_c3_','format','dollar14.0');&lt;BR /&gt;
      call define('_c4_','format','dollar14.0');&lt;BR /&gt;
      call define('_c5_','format','dollar14.0');&lt;BR /&gt;
      call define('_c6_','format','dollar14.0');&lt;BR /&gt;
      call define('_c7_','format','dollar14.0');&lt;BR /&gt;
    end;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after grping;&lt;BR /&gt;
    test = 'Total';&lt;BR /&gt;
    line ' ';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 04 Oct 2010 15:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10945#M1141</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-04T15:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Report Layout- Which Procedure to use</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10946#M1142</link>
      <description>Hi Cinthia,&lt;BR /&gt;
&lt;BR /&gt;
Thanku somuch,but in my report i do not need the 2nd Total field as it would make it look meaningless.&lt;BR /&gt;
&lt;BR /&gt;
I was actually looking if it was possible in a single procedure.In the end I had to use a combination</description>
      <pubDate>Tue, 05 Oct 2010 17:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Report-Layout-Which-Procedure-to-use/m-p/10946#M1142</guid>
      <dc:creator>tommy81</dc:creator>
      <dc:date>2010-10-05T17:36:56Z</dc:date>
    </item>
  </channel>
</rss>

