<?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 print table into a different format? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262960#M15594</link>
    <description>&lt;P&gt;This assumes your data is sorted. &amp;nbsp;Basically I create an array, and using the treatment variable merge the rows up, and after two merges add an escape character newline in. &amp;nbsp;Once this is printed with ods escapechar set, it should be on a new line:&lt;/P&gt;
&lt;PRE&gt;data have;
  input group $ treatment score;
datalines;
A 1 1.7
A 1 4.9
A 1 8.2
A 1 9.5
A 2 6.3
A 2 8.1
A 2 2
A 2 9.5
;
run;
data want;
  set have;
  by group treatment;
  array trt{3} $200;
  retain trt:;
  if first.treatment then trt{treatment}=put(score,3.1);
  else do;
    if countw(trt{treatment}," ")=2 then trt{treatment}=cats(trt{treatment},"^{newline}");
    trt{treatment}=catx(" ",trt{treatment},put(score,3.1));
  end;
  if last.group then output;
run;

ods escapechar="^";
proc report...;
run;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Apr 2016 16:45:07 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-04-11T16:45:07Z</dc:date>
    <item>
      <title>How to print table into a different format?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262935#M15591</link>
      <description>&lt;P&gt;Hello Sas community!&lt;/P&gt;&lt;P&gt;I'm doing some two way ANOVA on a dataset, it is a 3*3 table with 4 observations on each cell. But the original data is not that user-friendly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group&amp;nbsp;Treatment SCORE&lt;BR /&gt;A 1 1.7&lt;BR /&gt;A 1 4.9&lt;BR /&gt;A 1 8.2&lt;BR /&gt;A 1 9.5&lt;BR /&gt;A 2 6.3&lt;BR /&gt;A 2 8.1&lt;BR /&gt;A 2 2&lt;BR /&gt;A 2 9.5&lt;BR /&gt;A&amp;nbsp;3 2.3&lt;BR /&gt;A 3 8.7&lt;BR /&gt;A 3 9.8&lt;BR /&gt;A 3 4.5&lt;BR /&gt;B 1 0.1&lt;BR /&gt;B 1 6.2&lt;BR /&gt;B 1 0.3&lt;BR /&gt;B 1 9.5&lt;BR /&gt;B 2 1.3&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;C&amp;nbsp;3 8.5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just wondering if I can print the dataset like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2684iE76C7535C86E3F1A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="QQ截图20160411102429.jpg" title="QQ截图20160411102429.jpg" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 15:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262935#M15591</guid>
      <dc:creator>joseph626</dc:creator>
      <dc:date>2016-04-11T15:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to print table into a different format?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262942#M15592</link>
      <description>&lt;P&gt;Interesting...not easily. Is there an alternate format that may get you close?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 15:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262942#M15592</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T15:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to print table into a different format?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262960#M15594</link>
      <description>&lt;P&gt;This assumes your data is sorted. &amp;nbsp;Basically I create an array, and using the treatment variable merge the rows up, and after two merges add an escape character newline in. &amp;nbsp;Once this is printed with ods escapechar set, it should be on a new line:&lt;/P&gt;
&lt;PRE&gt;data have;
  input group $ treatment score;
datalines;
A 1 1.7
A 1 4.9
A 1 8.2
A 1 9.5
A 2 6.3
A 2 8.1
A 2 2
A 2 9.5
;
run;
data want;
  set have;
  by group treatment;
  array trt{3} $200;
  retain trt:;
  if first.treatment then trt{treatment}=put(score,3.1);
  else do;
    if countw(trt{treatment}," ")=2 then trt{treatment}=cats(trt{treatment},"^{newline}");
    trt{treatment}=catx(" ",trt{treatment},put(score,3.1));
  end;
  if last.group then output;
run;

ods escapechar="^";
proc report...;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 16:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-print-table-into-a-different-format/m-p/262960#M15594</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-11T16:45:07Z</dc:date>
    </item>
  </channel>
</rss>

