<?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: proc import formatting &amp;quot;linked&amp;quot; cell with '&amp;amp;' character in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/434299#M68874</link>
    <description>&lt;P&gt;I just wanted to loop back on this. As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; suggested, I opened a track with SAS tech support. The specialist responded that &lt;SPAN&gt;this has been fixed in the 9.4m5 release.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 17:58:20 GMT</pubDate>
    <dc:creator>paulkaefer</dc:creator>
    <dc:date>2018-02-05T17:58:20Z</dc:date>
    <item>
      <title>proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432818#M68746</link>
      <description>&lt;P&gt;See test code and Excel file, attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In sheet test1, cell A1 is "S&amp;amp;P 500" (without quotes). Proc import reads this fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In sheet test2, cell A1 links to another sheet, which has the value "S&amp;amp;P 500" (once again, no quotes in the cell itself).&lt;/P&gt;
&lt;P&gt;Proc import reads this as "S&amp;amp;amp;P 500". I recognize this as a &lt;A href="https://en.wikipedia.org/wiki/Ampersand#Encoding_and_display" target="_self"&gt;character encoding for &amp;amp;&lt;/A&gt; used in HTML, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to force SAS to not do this? Some option for import?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this would be more appropriate to post in the &lt;A href="https://communities.sas.com/t5/General-SAS-Programming/bd-p/general_program" target="_self"&gt;General SAS Programming&lt;/A&gt; forum.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 16:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432818#M68746</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2018-01-31T16:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432821#M68747</link>
      <description>try something like this at the top of your code:&lt;BR /&gt;&lt;BR /&gt;options validvarname=v7;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Jan 2018 16:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432821#M68747</guid>
      <dc:creator>utrocketeng</dc:creator>
      <dc:date>2018-01-31T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432826#M68748</link>
      <description>&lt;P&gt;Thanks for the quick response &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6777"&gt;@utrocketeng&lt;/a&gt;. I'm still seeing &amp;amp;amp; in this variable (note that I don't want this to be a variable name but a value). I tried with validvarname=any; and still am seeing &amp;amp;amp; appear.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 16:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432826#M68748</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2018-01-31T16:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432832#M68750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/81362"&gt;@paulkaefer&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the quick response &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6777"&gt;@utrocketeng&lt;/a&gt;. I'm still seeing &amp;amp;amp; in this variable (note that I don't want this to be a variable name but a value). I tried with validvarname=any; and still am seeing &amp;amp;amp; appear.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Things like &amp;amp;amp often indicate the file is actually HTML of some flavor and the source is lying to you by changing the file extension.&lt;/P&gt;
&lt;P&gt;OR some other behavior such as copy and paste from a document in html format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do a file save as CSV for each sheet and import that..&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 16:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432832#M68750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-31T16:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432837#M68752</link>
      <description>&lt;P&gt;Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;. Not an ideal solution, but that could work in a pinch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We know the origin to be Excel. As my example shows, this only appears if you import a sheet where cells pull their value from another sheet. Both examples have the same human-readable value, but something in the import is converting one of the ampersands to &amp;amp;amp;.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 17:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432837#M68752</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2018-01-31T17:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432912#M68759</link>
      <description>&lt;P&gt;Did you try the File Save As to CSV? I did with your example file and did not get the &amp;amp;amp when saving the Test2 tab to csv.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 21:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432912#M68759</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-31T21:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432915#M68760</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Did you try the File Save As to CSV? I did with your example file and did not get the &amp;amp;amp when saving the Test2 tab to csv.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since an CSV file by definition cannot contain any linked cells that would remove the symptom, but it is not a fix to reading the XLSX file directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OP should report this behavior to SAS and see if they are planning any updates to fix it.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 21:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/432915#M68760</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-31T21:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/433099#M68773</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x=htmldecode("S&amp;amp;amp;P 500");
put x=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Feb 2018 13:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/433099#M68773</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-02-01T13:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/433139#M68776</link>
      <description>&lt;P&gt;Thanks for the example of htmldecode, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;. Another option would be to do the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select tranwrd(A, "&amp;amp;amp;", "&amp;amp;") as A_new&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I submitted a track with tech support as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; suggests, and marked that comment as solution. I agree, the workarounds are not a fix for directly reading such an Excel file, but they can help in a pinch.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 15:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/433139#M68776</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2018-02-01T15:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc import formatting "linked" cell with '&amp;' character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/434299#M68874</link>
      <description>&lt;P&gt;I just wanted to loop back on this. As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; suggested, I opened a track with SAS tech support. The specialist responded that &lt;SPAN&gt;this has been fixed in the 9.4m5 release.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 17:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-import-formatting-quot-linked-quot-cell-with-amp-character/m-p/434299#M68874</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2018-02-05T17:58:20Z</dc:date>
    </item>
  </channel>
</rss>

