<?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 - LINE Statement with Multiple Items in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398683#M19437</link>
    <description>&lt;P&gt;What I meant was the same way COMPUTE block generated the header for each variable's name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
columns id variable subid label 
            ("^{style [borderbottomwidth=1pt] Treatment}" strat_1-strat_2) total
            pvalue;

...
define pvalue / order noprint;

/* Create Row Headers via COMPUTE Block LINE Statements */
	compute before variable / style={color=black backgroundcolor=white};
		line " ";
		line variable $200. pvalue pvalue6.4; 
	endcomp;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Sep 2017 23:45:52 GMT</pubDate>
    <dc:creator>monsieur</dc:creator>
    <dc:date>2017-09-25T23:45:52Z</dc:date>
    <item>
      <title>PROC REPORT - LINE Statement with Multiple Items</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398662#M19432</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I've been working on a demographics table for a study. After some data manipulation, I obtained a data set like this. Please note that the p-values are fictive.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Demo.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15412i91D1473053A06879/image-size/large?v=v2&amp;amp;px=999" role="button" title="Demo.JPG" alt="Demo.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using PROC REPORT with COMPUTE block and LINE statement, I can create a header line for each variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create data set DemoPatients */
data DemoPatients;
	input SubID ID Variable $ Label $ strat_1 strat_2 total pvalue;
	label Variable = "Parameter"
          strat_1 = "A|(N = 187)"
          strat_2 = "B|(N = 187)"
          total = "Total|(N = 374)"
          pvalue = "p-value";
datalines;
1	1	Gender		F	109		117		226		0.0001
2	1	Gender		M	78		70		148		0.0001
3	2	Race		5	49		30		79		0.0254
4	2	Race		6	138		157		295		0.0254
5	3	Complete	0	5		3		8		0.0005
6	3	Complete	1	182		184		366		0.0005
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Output */
ods escapechar="^";
options nodate nonumber orientation=portrait;
ods rtf file="C:\Demographics and Baseline Characteristics of Patients %sysfunc(date(),yymmdd10.).doc" style=MyStyle bodytitle;

/* Apple Header, Line, and Column Styles in PROC REPORT Statement */
proc report data=DemoPatients nowd center split="|"
	/*style(report)=[cellpadding=0.5pt]*/
	style(header)=[just=c font_weight=bold asis=on]
	style(lines)=[just=l]
	style(column)=[just=l cellwidth=1in];

/* Add Bottom Cell Borders and Create A Spanning Header */
	columns id variable subid label 
            ("^{style [borderbottomwidth=1pt] Treatment}" strat_1-strat_2) total;

/* Use ORDER ORDER=INTERNAL NOPRINT to Order Rows and Suppress Printing */
/* For Ordering, the variables must be left-most in the COLUMNS statement */
	define id / order order=internal noprint;
	define variable / order noprint;
	define subid / order order=internal noprint;
	define label / "Parameter" order order=data 
				   style(header)=[just=l indent=0in]
				   style(column)=[just=l cellwidth=3in indent=0.25in];

/* Create Row Headers via COMPUTE Block LINE Statements */
	compute before variable / style={color=black backgroundcolor=white};
		line " ";
		line variable $200.; 
	endcomp;
run;

ods rtf close;
title;
footnote;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the result from the SAS code above:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Demo2.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15413iED7B37CCCF32113F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Demo2.JPG" alt="Demo2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I've wanted to add a column named "p-value" to right side of this table using the same syntax but no luck so far. This is what I want to produce with the p-value aligns with the variable's name.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Demo3.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15414i25B9E5C4928E2390/image-size/large?v=v2&amp;amp;px=999" role="button" title="Demo3.JPG" alt="Demo3.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would really appreciate any suggestions.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398662#M19432</guid>
      <dc:creator>monsieur</dc:creator>
      <dc:date>2017-09-26T13:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - LINE Statement with Multiple Items</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398680#M19436</link>
      <description>&lt;P&gt;You say "same syntax" but don't say which same syntax.&lt;/P&gt;
&lt;P&gt;Show exactly what you tried.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 22:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398680#M19436</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-25T22:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - LINE Statement with Multiple Items</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398683#M19437</link>
      <description>&lt;P&gt;What I meant was the same way COMPUTE block generated the header for each variable's name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
columns id variable subid label 
            ("^{style [borderbottomwidth=1pt] Treatment}" strat_1-strat_2) total
            pvalue;

...
define pvalue / order noprint;

/* Create Row Headers via COMPUTE Block LINE Statements */
	compute before variable / style={color=black backgroundcolor=white};
		line " ";
		line variable $200. pvalue pvalue6.4; 
	endcomp;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 23:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398683#M19437</guid>
      <dc:creator>monsieur</dc:creator>
      <dc:date>2017-09-25T23:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - LINE Statement with Multiple Items</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398791#M19443</link>
      <description>&lt;P&gt;Updated the first post with a dummy data set.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-LINE-Statement-with-Multiple-Items/m-p/398791#M19443</guid>
      <dc:creator>monsieur</dc:creator>
      <dc:date>2017-09-26T13:18:43Z</dc:date>
    </item>
  </channel>
</rss>

