<?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 do I create a xml file, which can be imported by SAS and can also be edited and saved by exc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650568#M195088</link>
    <description>&lt;P&gt;Thanks Tom!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is that, in this requirement, we cannot use xlsx/xls file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to meet the following requirements at the same time&lt;/P&gt;&lt;P&gt;1. This file can be edited and saved by OFFICE-WORD/EXCEL and the file type cannot be xls/xlsx(It's really weird！)&lt;/P&gt;&lt;P&gt;2. This file can be imported into sas dataset.&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 00:59:37 GMT</pubDate>
    <dc:creator>Ethan1</dc:creator>
    <dc:date>2020-05-26T00:59:37Z</dc:date>
    <item>
      <title>How do I create a xml file, which can be imported by SAS and can also be edited and saved by excel?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650478#M195041</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to create an xml file, which can be imported by sas&amp;nbsp; (without a map file) and can also be edited and saved using excel software?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use excel to save as xml file, but it can not be imported into sas due to the lack of map file(In fact, map files cannot be used in this requirement).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present, the solution I think of is to save a xls/xlsx file as an xml file through excel software, and then create a macro to translate the xml file to a sas dataset.&amp;nbsp;In this way, I can open this xml for editing and saving, and also import it into SAS dataset with my macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better solution?&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 16:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650478#M195041</guid>
      <dc:creator>Ethan1</dc:creator>
      <dc:date>2020-05-25T16:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650479#M195042</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262494"&gt;@Ethan1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to use excel to save as xml file, but it can not be imported into sas due to the lack of map file(In fact, map files cannot be used in this requirement).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How did you try and import the xml file?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 16:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650479#M195042</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-25T16:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650545#M195078</link>
      <description>&lt;P&gt;How did you get Excel to create an XML file? The only option I see is to create something called an XML Spreadsheet 2003 format XML file.&amp;nbsp; If you are going to save it as a spreadsheet just leave it as an XLSX file.&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 22:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650545#M195078</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-25T22:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650566#M195087</link>
      <description>&lt;P&gt;Thank you for your reply！&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. open the XLSX file with excel software&lt;/P&gt;&lt;P&gt;2. save it as XML spreadsheet 2003(*.xml)&lt;/P&gt;&lt;P&gt;3. SAS CODE: libname xxx xml ".../xxx.xml";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I open this xml file with Notpad, it's not a 'GENERIC' structure XML.&amp;nbsp;So I can't import it directly with sas without using a map file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;Row&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;Cell&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;TSIDEM01_IA&amp;lt;/Data&amp;gt;&amp;lt;NamedCell&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ss:Name="_FilterDatabase"/&amp;gt;&amp;lt;/Cell&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;Cell&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;TITLE&amp;lt;/Data&amp;gt;&amp;lt;NamedCell ss:Name="_FilterDatabase"/&amp;gt;&amp;lt;/Cell&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;Cell&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;Summary of Demographics and Baseline Characteristics – Open Session; Safety Analysis Set &amp;lt;/Data&amp;gt;&amp;lt;NamedCell&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ss:Name="_FilterDatabase"/&amp;gt;&amp;lt;/Cell&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;/Row&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Finally, the method I used is to directly transfer the above plain text into a sas data set by regular expressions .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 00:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650566#M195087</guid>
      <dc:creator>Ethan1</dc:creator>
      <dc:date>2020-05-26T00:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650568#M195088</link>
      <description>&lt;P&gt;Thanks Tom!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is that, in this requirement, we cannot use xlsx/xls file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to meet the following requirements at the same time&lt;/P&gt;&lt;P&gt;1. This file can be edited and saved by OFFICE-WORD/EXCEL and the file type cannot be xls/xlsx(It's really weird！)&lt;/P&gt;&lt;P&gt;2. This file can be imported into sas dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 00:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650568#M195088</guid>
      <dc:creator>Ethan1</dc:creator>
      <dc:date>2020-05-26T00:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650589#M195098</link>
      <description>&lt;P&gt;CSV?&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 04:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650589#M195098</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-26T04:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a xml file, which can be imported by SAS and can also be edited and saved by exc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650592#M195099</link>
      <description>&lt;P&gt;So is the question how to read one of those XML 2003 Spreadsheet files?&lt;/P&gt;
&lt;P&gt;Does this help?&lt;/P&gt;
&lt;P&gt;I made a simple worksheet in Excel and saved it as that XML style.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 316px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39955i8FE82134834869BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now I can read it with SAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xmlwb "c:\downloads\from_excel.xml";
filename map temp;
libname xmlwb xmlv2 automap=reuse xmlmap=map;

proc sql ;
create table want as 
select * 
from xmlwb.workbook
natural join xmlwb.worksheet 
natural join xmlwb.table
natural join xmlwb.row
natural join xmlwb.cell
natural join xmlwb.data
order by 1
;
quit;
proc print width=min data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;
                                                                T
                                                                a
                                                                b
                                                                l    T                T
                                                                e    a                a
                                                                _    b                b
                                                                E    l                l
                                                                x    e                e
                    W                                           p    _    T           _
                    o    W                                      a    E    a           D
                    r    o                                      n    x    b           e
                    k    r                              W       d    p    l    T      f
               T    s    k                              o       e    a    e    a      a
     C         a    h    b    D                         r       d    n    _    b      u
     e    R    b    e    o    a                         k       C    d    F    l      l
     l    o    l    e    o    t                         s       o    e    u    e      t
     l    w    e    t    k    a      D                  h       l    d    l    _      R
     _    _    _    _    _    _      a                  e       u    R    l    F      o
     O    O    O    O    O    O      t                  e       m    o    C    u      w
     R    R    R    R    R    R      a                  t       n    w    o    l      H
     D    D    D    D    D    D      _                  _       C    C    l    l      e
     I    I    I    I    I    I      T         D        N       o    o    u    R      i
O    N    N    N    N    N    N      y         a        a       u    u    m    o      g
b    A    A    A    A    A    A      p         t        m       n    n    n    w      h
s    L    L    L    L    L    L      e         a        e       t    t    s    s      t

1    1    1    1    1    1    1    String    X        Sheet1    3    2    1    1    14.4
2    2    1    1    1    1    2    String    Y        Sheet1    3    2    1    1    14.4
3    3    1    1    1    1    3    String    Z        Sheet1    3    2    1    1    14.4
4    4    2    1    1    1    4    Number    1        Sheet1    3    2    1    1    14.4
5    5    2    1    1    1    5    Number    2        Sheet1    3    2    1    1    14.4
6    6    2    1    1    1    6    String    hello    Sheet1    3    2    1    1    14.4&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 May 2020 04:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-xml-file-which-can-be-imported-by-SAS-and-can/m-p/650592#M195099</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-26T04:17:11Z</dc:date>
    </item>
  </channel>
</rss>

