<?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 should I use a mapper file to import an xml file into a sas dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-should-I-use-a-mapper-file-to-import-an-xml-file-into-a-sas/m-p/659656#M197579</link>
    <description>&lt;P&gt;You are over-complicating things. I got your intended result by doing this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname titles xlsx '/folders/myfolders/Titles.xlsx';

data want;
length sheet $32;
set titles.sheet: indsname=dname;
sheet = scan(dname,2,'.');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Jun 2020 08:21:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-16T08:21:38Z</dc:date>
    <item>
      <title>How should I use a mapper file to import an xml file into a sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-should-I-use-a-mapper-file-to-import-an-xml-file-into-a-sas/m-p/659641#M197573</link>
      <description>&lt;PRE&gt;This xml file comes from 'Title.xlsx'. In order to import this xml file, I have created a mapper file(test.map). 

SAS code:
filename  xlsx2xml '~\xml-sas\Titles222.xml';
filename  SXLEMAP '~\xml-sas\test.map';
libname   xlsx2xml xmlv2 xmlmap=SXLEMAP access=READONLY;

data sheet;
  set xlsx2xml.final;
run;

The dataset I got is shown as data.png. I did some simple data processing to get what I want in the end like data1.png.

My question is, is there a way to add some code to the mapper file(test.map), so that I do not need these data processing in sas
and can directly get the dataset I want (data1.png)?&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/43622i3D0E110531E82BEC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="data.PNG" alt="data.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data1.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/43623i1402D2A06777A3B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="data1.PNG" alt="data1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 07:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-should-I-use-a-mapper-file-to-import-an-xml-file-into-a-sas/m-p/659641#M197573</guid>
      <dc:creator>Ethan1</dc:creator>
      <dc:date>2020-06-16T07:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: How should I use a mapper file to import an xml file into a sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-should-I-use-a-mapper-file-to-import-an-xml-file-into-a-sas/m-p/659656#M197579</link>
      <description>&lt;P&gt;You are over-complicating things. I got your intended result by doing this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname titles xlsx '/folders/myfolders/Titles.xlsx';

data want;
length sheet $32;
set titles.sheet: indsname=dname;
sheet = scan(dname,2,'.');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2020 08:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-should-I-use-a-mapper-file-to-import-an-xml-file-into-a-sas/m-p/659656#M197579</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-16T08:21:38Z</dc:date>
    </item>
  </channel>
</rss>

