<?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: Stack data ODS excel - titles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854917#M337912</link>
    <description>&lt;P&gt;Thanks for clarifying!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 21:30:09 GMT</pubDate>
    <dc:creator>DougHold</dc:creator>
    <dc:date>2023-01-20T21:30:09Z</dc:date>
    <item>
      <title>Stack data ODS excel - titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854905#M337900</link>
      <description>&lt;P&gt;Here are 3 tables from sashelp.cars dataset. I would like to combine them into one excel report.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.cars(obs=3) out=Porsche;   
	title "Porsche";
	where make = 'Porsche';
	column Make Model Type Origin DriveTrain MSRP;  

proc report data=sashelp.cars(obs=3) out=BMW;   
	title "BMW";
	where make = 'BMW';
	column Make Model Type Origin DriveTrain MSRP;

proc report data=sashelp.cars(obs=3) out=Audi;   
	title "Audi";
	where make = 'Audi';
	column Make Model Type Origin DriveTrain MSRP;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I don't understand why the titles are all named as the last table 'Audi' when combined like this ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="Stacked.xlsx" 
options(sheet_interval='none' embedded_titles='yes');
proc report data=Porsche;
proc report data=BMW;
proc report data=Audi;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I want is this, each table retaining it's proper title:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DougHold_0-1674247108100.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79574iE2328637AF1A9002/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DougHold_0-1674247108100.png" alt="DougHold_0-1674247108100.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 20:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854905#M337900</guid>
      <dc:creator>DougHold</dc:creator>
      <dc:date>2023-01-20T20:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Stack data ODS excel - titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854907#M337902</link>
      <description>TITLE statements stay in effect until you reset it. &lt;BR /&gt;Use:&lt;BR /&gt;TITLE;&lt;BR /&gt;&lt;BR /&gt;To reset the title and have no title. &lt;BR /&gt;Your last set of code has no title statement so it uses the title from your last code as it hasn't been reset. &lt;BR /&gt;&lt;BR /&gt;ods excel file="Stacked.xlsx" &lt;BR /&gt;options(sheet_interval='none' embedded_titles='yes');&lt;BR /&gt;title 'Porsche';&lt;BR /&gt;proc report data=Porsche;&lt;BR /&gt;title 'BMW';&lt;BR /&gt;proc report data=BMW;&lt;BR /&gt;title 'Audi';&lt;BR /&gt;proc report data=Audi;&lt;BR /&gt;run;&lt;BR /&gt;title; *reset;&lt;BR /&gt;ods excel close;&lt;BR /&gt;&lt;BR /&gt;You may want to look into BY groups though as that could make this a lot easier:&lt;BR /&gt;&lt;BR /&gt;title "#ByValue1";&lt;BR /&gt;proc report data=sashelp.cars;   &lt;BR /&gt;	by Make;&lt;BR /&gt;	where make in ( 'Audi', 'BMW', 'Porsche');&lt;BR /&gt;	column Make Model Type Origin DriveTrain MSRP;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 20 Jan 2023 20:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854907#M337902</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-01-20T20:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Stack data ODS excel - titles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854917#M337912</link>
      <description>&lt;P&gt;Thanks for clarifying!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 21:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stack-data-ODS-excel-titles/m-p/854917#M337912</guid>
      <dc:creator>DougHold</dc:creator>
      <dc:date>2023-01-20T21:30:09Z</dc:date>
    </item>
  </channel>
</rss>

