<?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: XML export problem in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681359#M24401</link>
    <description>&lt;P&gt;1) I'm running SAS Enterprise Guide 7.15 HF3.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;SAS Excelxp Tagset .v1.131&lt;/P&gt;&lt;P&gt;3) Now, that's interesting: Yes,&amp;nbsp;&lt;SPAN&gt;I can write all observations from SASHELP.CLASS. The reason I say this is interesting is because there is absolutely nothing special about the datasets that I'm trying to export: they are the result of proc transpose, have less than 30 observations, some of which are missing (replacing the missing values with 0s didn't solve the problem).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4) I believed I tried using&amp;nbsp;ODS EXCEL but I wasn't able to create multiple tabs, which was a must-have. Perhaps I should look again into it, in case I missed something.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2020 14:36:39 GMT</pubDate>
    <dc:creator>SB_145</dc:creator>
    <dc:date>2020-09-03T14:36:39Z</dc:date>
    <item>
      <title>XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681318#M24396</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a piece of code that I've been using forever, which exports data to XML files with multiple tabs. Recently however, the code exports only the first line. Has SAS made any changes recently that affect the ODS outputting? Any suggestions would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;BR /&gt;options nocenter;&lt;BR /&gt;ods tagsets.excelxp options (width_fudge='0.7' embedded_titles='yes')&lt;BR /&gt;file="mypath/myfilename.xml"&lt;BR /&gt;style=htmlblue ;&lt;BR /&gt;title;&lt;BR /&gt;ods noproctitle noresults;&lt;/P&gt;&lt;P&gt;%macro tabs (sheetname, dataname, keepstatement, headeropt);&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp options (sheet_name = "&amp;amp;sheetname.");&lt;BR /&gt;proc report data = &amp;amp;dataname. &amp;amp;keepstatement. nowd ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend tabs;&lt;/P&gt;&lt;P&gt;%tabs (TabName1, dataset1,,);&lt;BR /&gt;%tabs (TabName2, dataset2,,);&lt;BR /&gt;%tabs (TabName3, dataset3,,);&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 13:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681318#M24396</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-03T13:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681324#M24397</link>
      <description>&lt;P&gt;If by the first line you mean the header row in a spreadsheet that contain the variable names then perhaps the issue is that your data now has zero observations.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check that you don't have some earlier error in your program that has set the OBS option to 0 .&amp;nbsp; You should try to find and fix that error first.&amp;nbsp; But you can reset the option using an option statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=max;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Sep 2020 13:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681324#M24397</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-03T13:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681328#M24398</link>
      <description>Thank you for your suggestions, Tom. To be clear, the code exports the header and the first observation. It has the same behavior for all datasets that I've tried, regardless how many observations they have.&lt;BR /&gt;&lt;BR /&gt;I tried executing the option statement to no effect: options obs=max;&lt;BR /&gt;Thank you again!</description>
      <pubDate>Thu, 03 Sep 2020 13:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681328#M24398</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-03T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681346#M24399</link>
      <description>&lt;P&gt;What version of SAS are you running?&amp;nbsp; What version of the excelxp tagset are you using?&lt;/P&gt;
&lt;P&gt;Did you try just making a simple file? For example try writing SASHELP.CLASS and see if it works.&lt;/P&gt;
&lt;P&gt;Why not switch to generating actual XSLX file instead by using ODS EXCEL instead?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 14:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681346#M24399</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-03T14:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681359#M24401</link>
      <description>&lt;P&gt;1) I'm running SAS Enterprise Guide 7.15 HF3.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;SAS Excelxp Tagset .v1.131&lt;/P&gt;&lt;P&gt;3) Now, that's interesting: Yes,&amp;nbsp;&lt;SPAN&gt;I can write all observations from SASHELP.CLASS. The reason I say this is interesting is because there is absolutely nothing special about the datasets that I'm trying to export: they are the result of proc transpose, have less than 30 observations, some of which are missing (replacing the missing values with 0s didn't solve the problem).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4) I believed I tried using&amp;nbsp;ODS EXCEL but I wasn't able to create multiple tabs, which was a must-have. Perhaps I should look again into it, in case I missed something.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 14:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681359#M24401</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-03T14:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681362#M24402</link>
      <description>&lt;P&gt;The version of the GUI tool you are using to submit your SAS code doesn't matter for this.&amp;nbsp; The version of SAS that is running the code is what is important.&amp;nbsp; SAS has been on version 9.4 for multiple years so what the maintenance level you are at makes a big difference.&amp;nbsp; I think 9.4m7 is the latest release.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can definitely create multiple sheets in the same workbook with ODS EXCEL.&amp;nbsp; Syntax for sheets is pretty much identical to that used by TAGSETS.EXCELXP.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 14:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681362#M24402</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-03T14:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681364#M24403</link>
      <description>I'm running 9.4 TS 1M5.&lt;BR /&gt;All right, I'll check again exporting the output straight to excel.&lt;BR /&gt;&lt;BR /&gt;Thanks, Tom!</description>
      <pubDate>Thu, 03 Sep 2020 14:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681364#M24403</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-03T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681371#M24404</link>
      <description>&lt;P&gt;Let us know how it goes.&amp;nbsp; It sounds like you might have strange characters that are causing SAS to generated weird XML that appears truncated.&amp;nbsp; Since XLSX files are really just zipped XML files it would be good to know if switching ods destinations makes a difference.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 15:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681371#M24404</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-03T15:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: XML export problem</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681451#M24407</link>
      <description>&lt;P&gt;As you suggested, Tom, I solved this issue by switching to ODS EXCEL (working code listed below). I believe you may be right and that the problem is caused by hidden special characters (some of my data contains names imported from external sources). I'm sure there is a way to "clean" them automatically, but since exporting the data straight to Excel eliminates this issue, I'm taking the easy way out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ods listing close; 
    ods excel options (frozen_headers="3" frozen_rowheaders="2" embedded_titles="yes")
        file="mypath/myfilename.xlsx";

%macro tabs (sheetname, dataname, keepstatement);
    ods excel options (sheet_name="&amp;amp;sheetname.");
    proc print data=&amp;amp;dataname.; 
    title "Top Candidates For &amp;amp;sheetname.";
    run;
%mend tabs;

%tabs (Tab1, Dataset1,);  
%tabs (Tab2, Dataset2,); 
%tabs (Tab3, Dataset3,); 
ods excel close;
ods listing;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 18:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/XML-export-problem/m-p/681451#M24407</guid>
      <dc:creator>SB_145</dc:creator>
      <dc:date>2020-09-03T18:13:38Z</dc:date>
    </item>
  </channel>
</rss>

