<?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 Splitting variables and observations in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72681#M8293</link>
    <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I'm working on a report with approx. 18 variables... too much to fit on a single A4-page as it is.&lt;BR /&gt;
I would like to split each observation into two lines for output. I'm using PROC PRINT for printing.&lt;BR /&gt;
&lt;BR /&gt;
The following is a example of what I wish to achieve. Please excuse the lack of proper formatting.&lt;BR /&gt;
&lt;BR /&gt;
Original table&lt;BR /&gt;
Obs Var1 Var2 Var3 ... Var18&lt;BR /&gt;
    1      a      b      c ...        r&lt;BR /&gt;
    2    aa     bb    cc ...      rr       &lt;BR /&gt;
&lt;BR /&gt;
Split table&lt;BR /&gt;
Obs Var1    Var2  Var3    ... Var9&lt;BR /&gt;
       Var 10 Var11 Var12 ... Var18  &lt;BR /&gt;
    1    a           b       c   ...         i&lt;BR /&gt;
    1    j            k       l    ...         r&lt;BR /&gt;
    2  aa         bb     cc   ...         ii &lt;BR /&gt;
    2   jj           kk     ll     ...        rr       &lt;BR /&gt;
&lt;BR /&gt;
Is there a simple way to do this?&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
Thomas</description>
    <pubDate>Wed, 31 Mar 2010 14:44:09 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-03-31T14:44:09Z</dc:date>
    <item>
      <title>Splitting variables and observations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72681#M8293</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I'm working on a report with approx. 18 variables... too much to fit on a single A4-page as it is.&lt;BR /&gt;
I would like to split each observation into two lines for output. I'm using PROC PRINT for printing.&lt;BR /&gt;
&lt;BR /&gt;
The following is a example of what I wish to achieve. Please excuse the lack of proper formatting.&lt;BR /&gt;
&lt;BR /&gt;
Original table&lt;BR /&gt;
Obs Var1 Var2 Var3 ... Var18&lt;BR /&gt;
    1      a      b      c ...        r&lt;BR /&gt;
    2    aa     bb    cc ...      rr       &lt;BR /&gt;
&lt;BR /&gt;
Split table&lt;BR /&gt;
Obs Var1    Var2  Var3    ... Var9&lt;BR /&gt;
       Var 10 Var11 Var12 ... Var18  &lt;BR /&gt;
    1    a           b       c   ...         i&lt;BR /&gt;
    1    j            k       l    ...         r&lt;BR /&gt;
    2  aa         bb     cc   ...         ii &lt;BR /&gt;
    2   jj           kk     ll     ...        rr       &lt;BR /&gt;
&lt;BR /&gt;
Is there a simple way to do this?&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
Thomas</description>
      <pubDate>Wed, 31 Mar 2010 14:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72681#M8293</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-31T14:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting variables and observations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72682#M8294</link>
      <description>Hi:&lt;BR /&gt;
  You might want to take a look at this previous forum posting on dealing with very wide tables:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=414ƞ" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=414ƞ&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  The fact is that splitting the table the way you want is not automatic with ODS destinations.&lt;BR /&gt;
&lt;BR /&gt;
  What you would have to do, if you can't tweak the fonts and cellpadding, etc to make the information fit is to write a program to "split" the data....as shown in the program below.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data newclass;&lt;BR /&gt;
  set sashelp.class;&lt;BR /&gt;
  ** might have to control length for character variables;&lt;BR /&gt;
  ** explicitly if you have differing lengths;&lt;BR /&gt;
  length row $5;&lt;BR /&gt;
  obsno = _n_;&lt;BR /&gt;
  row = put(_n_,z2.0)||'-01';&lt;BR /&gt;
  var1 = name;&lt;BR /&gt;
  var2 = age;&lt;BR /&gt;
  var3 = height;&lt;BR /&gt;
  output;&lt;BR /&gt;
  row = put(_n_,z2.0)||'-02';&lt;BR /&gt;
  var1 = sex;&lt;BR /&gt;
  var2 = .;&lt;BR /&gt;
  var3 = weight;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
           &lt;BR /&gt;
options missing = ' ';&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods pdf file='splitrow.pdf';&lt;BR /&gt;
proc report data=newclass nowd;&lt;BR /&gt;
  column obsno row var1 var2 var3;&lt;BR /&gt;
  title 'Could use NOPRINT option on OBSNO or ROW if want to hide';&lt;BR /&gt;
  define obsno / order;&lt;BR /&gt;
  define row / order;&lt;BR /&gt;
  define var1 / 'Name/Sex';&lt;BR /&gt;
  define var2 / 'Age';&lt;BR /&gt;
  define var3 / 'Height/Weight';&lt;BR /&gt;
  compute after obsno;&lt;BR /&gt;
     line ' ';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 31 Mar 2010 16:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72682#M8294</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-03-31T16:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting variables and observations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72683#M8295</link>
      <description>Hi Cynthia,&lt;BR /&gt;
&lt;BR /&gt;
Thank you so very much. This is exactly what I needed!&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
Thomas</description>
      <pubDate>Thu, 15 Apr 2010 08:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Splitting-variables-and-observations/m-p/72683#M8295</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-15T08:35:22Z</dc:date>
    </item>
  </channel>
</rss>

