<?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: &amp;amp; in a xlsx file upload in SAS become &amp;amp;amp; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885062#M349691</link>
    <description>&lt;P&gt;If you run PROC CONTENTS on the data, what do you see for the variable name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't tell where the image comes from (is it a query builder?).&amp;nbsp; I"m wondering if whatever tool that is generating the image is the problem, not the dataset itself.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 13:17:24 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-07-17T13:17:24Z</dc:date>
    <item>
      <title>&amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885032#M349684</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I import a xlsx file with SAS 9.4, I 've got an issue with a variable name in a column.&lt;/P&gt;&lt;P&gt;'EQ &amp;amp; PPR' in the xlsx file become 'EQ &amp;amp;amp; PPR' in the SAS table imported.&lt;/P&gt;&lt;P&gt;Is it a bug from SAS? Are there any other misread special characters?&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CaroleBPRI_0-1689595692163.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85816iFC946A2059EAD6C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CaroleBPRI_0-1689595692163.png" alt="CaroleBPRI_0-1689595692163.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CaroleBPRI_1-1689595883542.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85817iA686ED19745890CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CaroleBPRI_1-1689595883542.png" alt="CaroleBPRI_1-1689595883542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 12:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885032#M349684</guid>
      <dc:creator>CaroleBPRI</dc:creator>
      <dc:date>2023-07-17T12:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: &amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885038#M349686</link>
      <description>&lt;P&gt;How was the source file created?&lt;/P&gt;
&lt;P&gt;If I make an XLSX with SAS I do not have that problem.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile cards dsd truncover;
  input (x1-x3) (:$20.);
cards;
id,EQ &amp;amp; PR,x
1,2,3
4,5,6
;

filename xlsx temp;
proc export data=test file=xlsx dbms=xlsx ;
  putnames=NO;
run;

options validvarname=v7;
proc import file=xlsx dbms=xlsx out=test2 replace;
run;

proc contents data=test2 varnum;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                 Variables in Creation Order

#    Variable    Type    Len    Format    Informat    Label

1    id          Char      1    $1.       $1.         id
2    EQ___PR     Char      1    $1.       $1.         EQ &amp;amp; PR
3    x           Char      1    $1.       $1.         x
&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 12:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885038#M349686</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-17T12:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: &amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885060#M349690</link>
      <description>&lt;P&gt;This is my original Code to import the xlsx file :&lt;/P&gt;&lt;P&gt;proc import out=lst_pci&lt;BR /&gt;datafile="V:\3613_DEPT_CONTROLE_DE_GESTION\Transverse\ANAPLAN\TBB Clientèle - Eléments hors SI.xlsx"&lt;BR /&gt;dbms=XLSX replace;&lt;BR /&gt;Sheet='REF PCI';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885060#M349690</guid>
      <dc:creator>CaroleBPRI</dc:creator>
      <dc:date>2023-07-17T13:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: &amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885062#M349691</link>
      <description>&lt;P&gt;If you run PROC CONTENTS on the data, what do you see for the variable name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't tell where the image comes from (is it a query builder?).&amp;nbsp; I"m wondering if whatever tool that is generating the image is the problem, not the dataset itself.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885062#M349691</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-07-17T13:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: &amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885064#M349693</link>
      <description>&lt;P&gt;You could probably open a support ticket with SAS to have them actually look at that file and see what is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to change the variable names to replace HTML code like &amp;amp;amp; with its decode should be able to just use the HTMLDECODE() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any ;
data lst_pci ;
  length id name 'EQ &amp;amp;amp; PPR'n 8;
run;

proc sql noprint;
select catx('=',nliteral(name),nliteral(htmldecode(name))) 
  into :renames separated by ' '
  from dictionary.columns
  where libname='WORK'
    and memname='LST_PCI'
    and name ne htmldecode(name)
;
quit;

proc datasets nolist lib=work;
  modify lst_pci;
  rename &amp;amp;renames ;
  run;
quit;

proc contents data=lst_pci varnum;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt; Variables in Creation Order

#    Variable    Type    Len

1    id          Num       8
2    name        Num       8
3    EQ &amp;amp; PPR    Num       8

&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885064#M349693</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-17T13:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: &amp; in a xlsx file upload in SAS become &amp;amp;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885090#M349705</link>
      <description>&lt;P&gt;Ok I will test this point. Is there still a misread when the table is exported. Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-in-a-xlsx-file-upload-in-SAS-become-amp-amp/m-p/885090#M349705</guid>
      <dc:creator>CaroleBPRI</dc:creator>
      <dc:date>2023-07-17T15:23:33Z</dc:date>
    </item>
  </channel>
</rss>

