<?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: Exporting Header-Only (no Observations) to Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687201#M24503</link>
    <description>&lt;P&gt;Do you have to use ODS?&amp;nbsp; This works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx 'myfile.xlsx';
data out.class;
  set sashelp.class (obs=0);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:42:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-09-28T13:42:46Z</dc:date>
    <item>
      <title>Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687193#M24499</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I am looking for a way to export only the header of a dataset to Excel. No matter whether I tried, from starting with an empty dataset to using a filter right before the export, SAS doesn't export the tab that contains a header only.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions would be highly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687193#M24499</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-28T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687196#M24501</link>
      <description>I know it's ironic that the topic about exporting an Excel file with a header only has only a header (it was unintentional--SAS reps., we need an edit button).&lt;BR /&gt;&lt;BR /&gt;Now the actual issue: I am looking for a way to export only the header of a dataset to Excel. No matter whether I tried, from starting with an empty dataset to using a filter right before the export, SAS doesn't export the tab that contains a header only.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be highly appreciated.&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 28 Sep 2020 13:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687196#M24501</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-28T13:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687201#M24503</link>
      <description>&lt;P&gt;Do you have to use ODS?&amp;nbsp; This works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx 'myfile.xlsx';
data out.class;
  set sashelp.class (obs=0);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687201#M24503</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-28T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687203#M24504</link>
      <description>&lt;P&gt;Click on the vertical dot-dot-dot next the message to see the edit message menu item.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 388px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49888i7F5C42EA28DA4CAF/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687203#M24504</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-28T13:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687211#M24505</link>
      <description>Hi Tom, Thank you for your suggestions. Unfortunately it doesn't work. I'm working on a Unix server, though I doubt this is the cause (never had problems creating actual Excel files) 1) The result of your export code is a file with the extension $$1. 2) When I try to export my own empty dataset, I do obtain an Excel file; however when I try to open it, I get a message that the file is corrupted. 3) If I try to export my data to a file with multiple tabs, the tab that should contain only with the header is not created at all. For what's worth, my header has column names down the lines of '20-DEC-2019 01'n. Could this be the cause of the problem (it's not a problem when I export at least the first observation)? Thank you again.</description>
      <pubDate>Mon, 28 Sep 2020 14:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687211#M24505</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-28T14:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687213#M24507</link>
      <description>&lt;P&gt;Sounds like you tried to read the XLSX file before SAS had finished creating it.&amp;nbsp; If you open the XLSX with a libname statement you need to clear the libref before it closes the file and saves it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname out xlsx 'myfile.xlsx';
data out.class ;
  set sashelp.class ;
  where age=0;
run;
data out.cars;
  set sashelp.cars (obs=5);
run;
libname out clear ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687213#M24507</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-28T14:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting Header-Only (no Observations) to Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687226#M24508</link>
      <description>&lt;P&gt;I still get a $$1 file. I even erased everything in the destination folder, closed Excel, and changed the server from which I run the code. Same exact result.&amp;nbsp;Using a WHERE statement vs. an OBS statement made no difference either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Exporting-Header-Only-no-Observations-to-Excel/m-p/687226#M24508</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-28T14:47:52Z</dc:date>
    </item>
  </channel>
</rss>

