<?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: XLSX libname engine reads &amp;amp; as &amp;amp;amp;? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349419#M81041</link>
    <description>&lt;PRE&gt;
This could work ?


libname x xlsx "%sysfunc(pathname(work))\pvsds2.xlsx";
proc copy in=x out=work noclone;
run;

&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Apr 2017 12:45:29 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-04-12T12:45:29Z</dc:date>
    <item>
      <title>XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349383#M81026</link>
      <description>&lt;P&gt;I have a .xlsx file which contains the string "X&amp;amp;Y" in a cell.&amp;nbsp;I read it into SAS using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname x xlsx "%sysfunc(pathname(work))\pvsds2.xlsx";&lt;BR /&gt;data new;&lt;BR /&gt;set x.'Sheet1'n ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the dataset new, the value appears as "X&amp;amp;amp;Y". Am I doing something wrong, or is the XLSX libname engine failing to properly handle the XML in which the XLSX file is encoded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Enterprise Guide 7.13 on SAS 9.4 on Linux.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 11:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349383#M81026</guid>
      <dc:creator>jtlbg</dc:creator>
      <dc:date>2017-04-12T11:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349384#M81027</link>
      <description>&lt;P&gt;The underlying file is xml or XLSX? If it's XML use the XML engine not the XLSX.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 11:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349384#M81027</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-12T11:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349385#M81028</link>
      <description>The underlying file is XLSX. I only mention XML because I know that the XLSX file format is based on XML, and the issue looks very much like issues I have seen elsewhere with other software that does not correctly encode/decode/escape characters which are considered special in XML.</description>
      <pubDate>Wed, 12 Apr 2017 11:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349385#M81028</guid>
      <dc:creator>jtlbg</dc:creator>
      <dc:date>2017-04-12T11:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349386#M81029</link>
      <description>&lt;P&gt;Interesting question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are reading the XLSX from your WORK directory so I assume you've created this XLSX with SAS. If so then how do you know that the &amp;amp;AMP; encoding happens when you read the sheet and doesn't already get written this way to the sheet in an earlier step?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 11:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349386#M81029</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-04-12T11:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349395#M81032</link>
      <description>Hi Patrick, that's not the case. I'm uploading the file from my local PC, using the Copy Files task in EG. It was created in Excel 2010.&lt;BR /&gt;&lt;BR /&gt;I should add that the value is not a literal "X&amp;amp;Y" string - the cell in question contains a VLOOKUP which returns the value "X&amp;amp;Y". SAS is correctly reading the literal value so the presence of the VLOOKUP seems relevant.</description>
      <pubDate>Wed, 12 Apr 2017 12:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349395#M81032</guid>
      <dc:creator>jtlbg</dc:creator>
      <dc:date>2017-04-12T12:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349412#M81037</link>
      <description>&lt;PRE&gt;

data new;
set x.'Sheet1$'n ;
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Apr 2017 12:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349412#M81037</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-12T12:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349416#M81040</link>
      <description>I tried that syntax initially. I got this error:&lt;BR /&gt;&lt;BR /&gt;ERROR: Couldn't find range or sheet in spreadsheet&lt;BR /&gt;ERROR: File X.'Sheet1$'n.DATA does not exist.</description>
      <pubDate>Wed, 12 Apr 2017 12:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349416#M81040</guid>
      <dc:creator>jtlbg</dc:creator>
      <dc:date>2017-04-12T12:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349419#M81041</link>
      <description>&lt;PRE&gt;
This could work ?


libname x xlsx "%sysfunc(pathname(work))\pvsds2.xlsx";
proc copy in=x out=work noclone;
run;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Apr 2017 12:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349419#M81041</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-12T12:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349422#M81044</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; - unfortunately not. Same issue.</description>
      <pubDate>Wed, 12 Apr 2017 12:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349422#M81044</guid>
      <dc:creator>jtlbg</dc:creator>
      <dc:date>2017-04-12T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: XLSX libname engine reads &amp; as &amp;amp;?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349424#M81045</link>
      <description>&lt;PRE&gt;
Oh, I misunderstood.
Try this function.


data x;
x='X&amp;amp;Y';
correct=htmldecode(x);

run;


&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Apr 2017 12:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XLSX-libname-engine-reads-amp-as-amp-amp/m-p/349424#M81045</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-12T12:52:47Z</dc:date>
    </item>
  </channel>
</rss>

