<?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 add a title line as the first row before exporting to Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365053#M275091</link>
    <description>&lt;P&gt;TAGSETS.EXCELXP creates Excel readable XML. The "error" is naming XML output with the XLS extension. Excel is getting more picky with each release about the content of the data matching the extension.&lt;/P&gt;
&lt;P&gt;Change the extension to XML and excel should read it fine.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2017 15:41:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-07T15:41:22Z</dc:date>
    <item>
      <title>how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365045#M275089</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to output a dataset to Excel (using SAS 9.3), and I need to add a title in what would be cell A1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that&amp;nbsp;tagsets.excelxp is the way to go. When I run my syntax and then try to open the Excel file, Excel&amp;nbsp;says it's in a different format than specified by the file extension, and then that it can't read the file (attached image of errors).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts? Here's my syntax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.excelxp

	file = 'W:\List for 052017_for distribution.xls'

	style = minimal

	options (Sheet_Name = 'List_052017'
		Embedded_Titles = 'yes');

	title1 'List for May 2017 - updated 06/01/2017';

ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;file = 'W:\list&amp;nbsp;for distribution.xls'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;style = minimal&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;options (Sheet_Name = 'list'&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Embedded_Titles = 'yes');&lt;/P&gt;&lt;P&gt;title1 'List for June 2017 - updated 06/01/2017';&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here's my output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2431 ods tagsets.excelxp&lt;BR /&gt;2432&lt;BR /&gt;2433 file = 'W:\list&amp;nbsp;for distribution.xls'&amp;nbsp;&lt;BR /&gt;2434&lt;BR /&gt;2435 style = minimal&lt;BR /&gt;2436&lt;BR /&gt;2437 options (Sheet_Name = 'list'&lt;BR /&gt;2438 Embedded_Titles = 'yes');&lt;BR /&gt;NOTE: Writing TAGSETS.EXCELXP Body file: W:\Monthly Reports\LIC_028 All Active Providers (also&lt;BR /&gt;Provider Lists)\LIC_028_All_Active_Providers_use for 052017_for distribution.xls&lt;BR /&gt;NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.122, 01/04/2011). Add&lt;BR /&gt;options(doc='help') to the ods statement for more information.&lt;BR /&gt;2439&lt;BR /&gt;2440 title1 'List for June 2017 - updated 06/01/2017';&lt;BR /&gt;2441&lt;BR /&gt;2442 ods _all_ close;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13913i889D9FBD525C59BA/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="errors.png" title="errors.png" /&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365045#M275089</guid>
      <dc:creator>kjowers</dc:creator>
      <dc:date>2017-06-07T15:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365052#M275090</link>
      <description>&lt;P&gt;Well, topic 1, Excel states the file is in a different format than specified, because you have given the filename an XLSX extension. &amp;nbsp;XLSX tells Excel to expect a file which is in its proprietary Open Office file format (a ZIP with XML files inside). &amp;nbsp;What you create from tagsets.excelxp is XML. &amp;nbsp;Now this XML can be read and interpreted by Excel, but its not what it expects from XLSX. &amp;nbsp;Naming file extension per what they are for is good practice, so name your output file &amp;lt;filename&amp;gt;.xml.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second topic, you get issues with the output file as you have not created any output. &amp;nbsp;Nowhere in the text you have given is an output procedure such as proc print, proc report, proc tabulate etc. &amp;nbsp;What you are after is:&lt;/P&gt;
&lt;PRE&gt;ods tagsets.excelxp file='W:\List for 052017_for distribution.xml' style=minimal
  options (sheet_name='List_052017' embedded_titles='yes');
&lt;BR /&gt;title1 'List for May 2017 - updated 06/01/2017';
proc print data=sashelp.class;
run;

ods tagstes.excelxp close;&lt;/PRE&gt;
&lt;P&gt;Just using a SAS default dataset for example here.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365052#M275090</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-07T15:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365053#M275091</link>
      <description>&lt;P&gt;TAGSETS.EXCELXP creates Excel readable XML. The "error" is naming XML output with the XLS extension. Excel is getting more picky with each release about the content of the data matching the extension.&lt;/P&gt;
&lt;P&gt;Change the extension to XML and excel should read it fine.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365053#M275091</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-07T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365060#M275092</link>
      <description>&lt;P&gt;Thanks so much, RW9!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was basing my syntax off of an example on the SAS website&amp;nbsp;(&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html&lt;/A&gt; - below), so it's good to know the extension piece!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Embedded Titles and Footnotes&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Use the EMBEDDED_TITLES= and EMBEDDED_FOOTNOTES= options.&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  ods listing close;

  ods tagsets.excelxp file="embed.xls" style=statistical
      options( embedded_titles='yes' embedded_footnotes='yes' );

  title "My First Title";
  title3 "My Third Title";

  proc print data=sashelp.class (obs=5); run;

  footnote "My First Footnote";
  footnote3 "My Third Footnote";

  ods tagsets.excelxp close;

  ods listing;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I can't believe I forgot to add in the proc print. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added question - it now adds two rows. Row 1 contains the title and row 2 is blank. How can I get it to only add row 1? This list goes to a group of folks who&amp;nbsp;need it to be formatted precisely and consistently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365060#M275092</guid>
      <dc:creator>kjowers</dc:creator>
      <dc:date>2017-06-07T15:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365061#M275093</link>
      <description>&lt;P&gt;Thanks! The SAS website steered me wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts as to how to get it to only add the title row (row 1) and not the blank row beneath it (row 2)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365061#M275093</guid>
      <dc:creator>kjowers</dc:creator>
      <dc:date>2017-06-07T15:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365083#M275094</link>
      <description>&lt;P&gt;I suspect your blank row 2 is because you use Title1 and Title3 with no defined Title2. All of the destinations dating back to the dark ages of SAS 5 will insert a blank row when a situation like this is encountered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get rid of the space between the title and the tables that is an entire other problem.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 16:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365083#M275094</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-07T16:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365115#M275095</link>
      <description>&lt;P&gt;Thanks! Unfortunately, it's the entire&amp;nbsp;other problem. I only had a title1. Do you know how to get rid of that row between title1 and the data?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 17:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365115#M275095</guid>
      <dc:creator>kjowers</dc:creator>
      <dc:date>2017-06-07T17:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365151#M275096</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132722"&gt;@kjowers&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks! Unfortunately, it's the entire&amp;nbsp;other problem. I only had a title1. Do you know how to get rid of that row between title1 and the data?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That apparently is buried in some esoteric bit of the tagsets. You aren't the first to ask, I did years ago about RTF where the PARSKIP option could be modified but not in the other ODS destinations.&lt;/P&gt;
&lt;P&gt;With some procedures that support style=[pretext='text to show before the output'] sometimes this&amp;nbsp;doesn't introduce that vertical space&amp;nbsp;but you do not have the same display control as Title, text appears in a different style than Title statements&amp;nbsp; and you can't build table of contents entries.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 19:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/365151#M275096</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-07T19:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/387768#M275097</link>
      <description>&lt;P&gt;Option for removing the blank row between the title and the data in Excel:&lt;/P&gt;&lt;P&gt;* Use the ODS TEXT= statement instead of the TITLE statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 13:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/387768#M275097</guid>
      <dc:creator>bnawrocki</dc:creator>
      <dc:date>2017-08-14T13:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a title line as the first row before exporting to Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/387832#M275098</link>
      <description>&lt;P&gt;awesome! thanks for the tip!!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 15:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-add-a-title-line-as-the-first-row-before-exporting-to/m-p/387832#M275098</guid>
      <dc:creator>kjowers</dc:creator>
      <dc:date>2017-08-14T15:55:38Z</dc:date>
    </item>
  </channel>
</rss>

