<?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 How to combine multiple reports into one report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882911#M26315</link>
    <description>&lt;P&gt;Since the variables in the COLUMN statement are always the same (e.g. AGE DRUGA PLACEBO_ row_sum) you should be able to combine all data sets into one, and then run one PROC REPORT. Since you also have this code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; line @1 'Age';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in each PROC REPORT, you'd need a variable in the combined data set indicating if the values are AGE or RACE or SEX or ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also the &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030" target="_self"&gt;%TABLEN macro&lt;/A&gt; which seems like it can create the output desired.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2023 09:44:24 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-06-29T09:44:24Z</dc:date>
    <item>
      <title>Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882894#M26314</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I need to create with the report like this. And I used multiple proc report to generate different reports, but now I want to concentrate them together to get the following result. What should I do? I need to output the PDF file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skyez_0-1688009027367.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85449i5D1312FAB7FC5208/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Skyez_0-1688009027367.png" alt="Skyez_0-1688009027367.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;PRE&gt;ods pdf file='/home/u6341199/sasuser.v94/Program1/report.pdf' startpage=no;
proc report data=program1.summarydaat2 nofs split='*' headline headskip; ;
  title1 "Demographic and baseline summary";
  title2 'All Randomized subjects';
  column AGE  DRUGA PLACEBO_ row_sum ;
  define AGE / group width=6 '' order;
  define DRUGA / "DRUG A*&amp;amp;agestr" format=comma10.2;
  define PLACEBO_ / "PLACEBO*&amp;amp;htstr" format=comma10.2;
  define row_sum/ computed format=comma10.2 "Total*&amp;amp;wtstr";
  break after age / ol skip suppress;
  compute before ;
 line @1 'Age';
endcomp;
  compute row_sum;
  row_sum = sum(_C2_,_C3_);
  endcompute;
 run; 

proc report data=program1.race_4 nofs split='*' headline headskip;
column Category DRUGA PLACEBO_ row_sum ;
define Category / group width=15 '' order;
  define DRUGA / "" ;
  define PLACEBO_ / "" ;
  define row_sum/ computed  "" style(column)={cellwidth=1in just = center};
  break after Category / ol skip suppress;
  compute before ;
 line @1 'Race';
endcomp;
  compute row_sum / character length=70;
  row_sum = sum(&amp;amp;count,&amp;amp;count2)||'('||strip(sum(&amp;amp;count1,&amp;amp;count3))||')';
  endcompute;
 run; 
proc report data=program1.sex_4 nofs split='*' headline headskip;
column Category DRUGA PLACEBO_ row_sum ;
define Category / group width=15 '' order;
  define DRUGA / "" ;
  define PLACEBO_ / "" ;
  define row_sum/ computed  "" style(column)={cellwidth=1in just = center};
  break after Category / ol skip suppress;
  compute before ;
 line @1 'SEX';
endcomp;
  compute row_sum / character length=70;
  row_sum = sum(&amp;amp;count,&amp;amp;count2)||'('||strip(sum(&amp;amp;count1,&amp;amp;count3))||')';
  endcompute;
 run; 
 proc report data=program1.Country_4 nofs split='*' headline headskip;
column Category DRUGA PLACEBO_ row_sum ;
define Category / group width=15 '' order;
  define DRUGA / "" ;
  define PLACEBO_ / "" ;
  define row_sum/ computed  "" style(column)={cellwidth=1in just = center};
  break after Category / ol skip suppress;
  compute before ;
 line @1 'Country';
endcomp;
  compute row_sum / character length=70;
  row_sum = sum(&amp;amp;count,&amp;amp;count2)||'('||strip(sum(&amp;amp;count1,&amp;amp;count3))||')';
  endcompute;
 run;
proc report data=program1.Ethnic_4 nofs split='*' headline headskip;
column Category DRUGA PLACEBO_ row_sum ;
define Category / group width=15 '' order;
  define DRUGA / "" ;
  define PLACEBO_ / "" ;
  define row_sum/ computed  "" style(column)={cellwidth=1in just = center};
  break after Category / ol skip suppress;
  compute before ;
 line @1 'Ethnic';
endcomp;
  compute row_sum / character length=70;
  row_sum = sum(&amp;amp;count,&amp;amp;count2)||'('||strip(sum(&amp;amp;count1,&amp;amp;count3))||')';
  endcompute;
 run;
 *rbreak after / dol skip summarize;

proc report data=program1.summarydaat3 nofs split='*' headline headskip; ;
  column AGE DRUGA PLACEBO_ row_sum ;
define AGE / group width=15 '' order;
  define DRUGA / "" format=6.2;
  define PLACEBO_ / "" format=6.2;
  define row_sum/ computed  "" style(column)={cellwidth=1in just = center} format=6.2;
  break after AGE / ol skip suppress;
  compute before ;
 line @1 'PLATELET COUNT';
endcomp;
  compute row_sum;
  row_sum = sum(_C2_,_C3_);
  endcompute;
 run; 
ods pdf close;&lt;/PRE&gt;&lt;P&gt;What I got look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skyez_1-1688009151488.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85450i2AB0B330C55634CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Skyez_1-1688009151488.png" alt="Skyez_1-1688009151488.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 03:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882894#M26314</guid>
      <dc:creator>Skyez</dc:creator>
      <dc:date>2023-06-29T03:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882911#M26315</link>
      <description>&lt;P&gt;Since the variables in the COLUMN statement are always the same (e.g. AGE DRUGA PLACEBO_ row_sum) you should be able to combine all data sets into one, and then run one PROC REPORT. Since you also have this code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; line @1 'Age';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in each PROC REPORT, you'd need a variable in the combined data set indicating if the values are AGE or RACE or SEX or ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also the &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Demographic-Table-and-Subgroup-Summary-Macro-TABLEN/ta-p/634030" target="_self"&gt;%TABLEN macro&lt;/A&gt; which seems like it can create the output desired.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 09:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882911#M26315</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-29T09:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882994#M26316</link>
      <description>&lt;P&gt;Hi, thanks for your explanation! Unfortunately, if I merge them together, I can't use line statement to set category. It always shows error message that&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;The BREAK variable row5 is not one of the GROUP or ORDER variables.&lt;/DIV&gt;&lt;DIV class=""&gt;Here is my code:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;proc report data=program1.summdata nofs split='*' headline headskip; ;
  title1 "Demographic and baseline summary";
  title2 'All Randomized subjects';
  column AGE  DRUGA PLACEBO_ row_sum ;
  define AGE / group width=6 '' order=data;
  define DRUGA / "DRUG A*&amp;amp;agestr" order=data;
  define PLACEBO_ / "PLACEBO*&amp;amp;htstr" order=data;
  *define row_sum/ computed format=comma10.2 "Total*&amp;amp;wtstr";
  *break after age / ol skip suppress;
   *rbreak after / dol skip summarize;
  compute before ;
 line @1 'Age';
endcomp;
compute after row5;
line @7 'Race';
endcomp;
run;&lt;/PRE&gt;Thanks for your help!&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Jun 2023 19:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/882994#M26316</guid>
      <dc:creator>Skyez</dc:creator>
      <dc:date>2023-06-29T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883017#M26317</link>
      <description>Hi:&lt;BR /&gt;  You don't have a variable named ROW5 in your COLUMN statement. So PROC REPORT is telling you the issue. Do you instead mean to test the value of your ROW_SUM variable or some variable from the data??? &lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 29 Jun 2023 21:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883017#M26317</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-06-29T21:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883024#M26318</link>
      <description>&lt;P&gt;that's right. If you merge the data sets together, you should NOT use the LINE command.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 09:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883024#M26318</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-30T09:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report How to combine multiple reports into one report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883033#M26319</link>
      <description>Hi, thanks for your help. I already fixed this by using %glue.</description>
      <pubDate>Fri, 30 Jun 2023 01:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-How-to-combine-multiple-reports-into-one-report/m-p/883033#M26319</guid>
      <dc:creator>Skyez</dc:creator>
      <dc:date>2023-06-30T01:53:39Z</dc:date>
    </item>
  </channel>
</rss>

