<?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: reading in an equal to or greater than symbol in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722470#M224011</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131732"&gt;@Sajid01&lt;/a&gt;&amp;nbsp;your answer relate to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31988"&gt;@geneshackman&lt;/a&gt;&amp;nbsp;'s code.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SAS University edition is running with encoding = 'UTF-8' therefore you got the right value without any issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Feb 2021 19:33:48 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2021-02-28T19:33:48Z</dc:date>
    <item>
      <title>reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722437#M223994</link>
      <description>&lt;P&gt;I have a data set, sas can't seem to read in the equal to, greater than symbol,&amp;nbsp;≥400%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use this code&lt;/P&gt;
&lt;P&gt;PROC IMPORT DATAFILE= "\\myfolder\pa66.xlsx" &lt;BR /&gt;out=pa66_working dbms=xlsx replace; &lt;BR /&gt;sheet='2016-2017';&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: Variable Name Change. Data Source -&amp;gt; Data_Source&lt;BR /&gt;NOTE: Variable Name Change. Stratifier Subgroup -&amp;gt; Stratifier_Subgroup&lt;BR /&gt;NOTE: Variable Name Change. Standard Error -&amp;gt; Standard_Error&lt;BR /&gt;NOTE: Variable Name Change. Intepret With Caution -&amp;gt; Intepret_With_Caution&lt;BR /&gt;NOTE: Variable Name Change. Data Not Reportable -&amp;gt; Data_Not_Reportable&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9&lt;BR /&gt;engine. For more details, run with options MSGLEVEL=I.&lt;BR /&gt;WARNING: Some character data was lost during transcoding in column: Stratifier Subgroup at obs 20.&lt;BR /&gt;NOTE: The import data set has 40 observations and 14 variables.&lt;BR /&gt;NOTE: WORK.PA66_WORKING data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm attaching the data set. So far, I've been manually replacing&amp;nbsp;≥400% with 400+% but I just wondered whether there was any way for SAS to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 17:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722437#M223994</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-02-28T17:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722448#M223995</link>
      <description>&lt;P&gt;I have looked in your input .xlsx file.&lt;/P&gt;
&lt;P&gt;Sas replaces spaces by underscore to create a valid sas variable names.&lt;/P&gt;
&lt;P&gt;In some cases sas cannot use input column label to create a valid sas variable name and needs to convert them. Other columns has variable length strings which may cause truncation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest to copy the generated data step by proc import, adapt variable names to be valid&amp;nbsp; and preferred and adapt char type variables length to max expected length.&lt;/P&gt;
&lt;P&gt;Thus you will have a stabile program to read such file and easier to maintain in case of future changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 17:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722448#M223995</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-28T17:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722451#M223998</link>
      <description>&lt;P&gt;Make sure your SAS session runs with UTF-8 encoding.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 18:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722451#M223998</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-28T18:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722460#M224003</link>
      <description>&lt;P&gt;Thanks, but it's not the variable names with spaces that I'm asking about. It's the character in front of the 400%, the symbol for equal to or greater than.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 18:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722460#M224003</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-02-28T18:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722462#M224004</link>
      <description>Thanks. I don't know what utf-8 means. Can you point to a url that explains how this relates to the equal to or greater than symbol I was asking about?</description>
      <pubDate>Sun, 28 Feb 2021 18:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722462#M224004</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-02-28T18:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722463#M224005</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31988"&gt;@geneshackman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks. I don't know what utf-8 means. Can you point to a url that explains how this relates to the equal to or greater than symbol I was asking about?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Encoding is the how you are representing characters as bytes in your character strings.&amp;nbsp; The original ASCII standard for characters only use 7-bit so there are only 128 possible codes.&amp;nbsp; So there is no equal to or greater than character in the ASCII standard set of characters.&amp;nbsp; So it matters how your SAS session is encoding the data.&amp;nbsp; There are many single byte encodings that support the full 8 bits and so extend the 128 possible codes to 256 possible code, but they don't agree on what characters those extra codes represent.&amp;nbsp; Sounds like the one you are using also does not have a spot for that character.&amp;nbsp; UTF-8 can use multiple bytes to represent a single character.&amp;nbsp; So it will definitely let you represent equal to or greater than as a single character, but it will take more than one byte to store it in the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an older article that has a pretty detailed explanation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2017/05/19/demystifying-and-resolving-common-transcoding-problems/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sgf/2017/05/19/demystifying-and-resolving-common-transcoding-problems/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It mainly talks about how it looks if you are launching SAS Display Manager on your PC.&amp;nbsp; If you are using SAS Enterprise Guide or SAS/Studio to run SAS on a remote server then you need to get your SAS administrator to setup a SAS application server that uses Unicode support and then connect to that application server instead of the server you are currently using.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 19:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722463#M224005</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-28T19:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722465#M224007</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31988"&gt;@geneshackman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, but it's not the variable names with spaces that I'm asking about. It's the character in front of the 400%, the symbol for equal to or greater than.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you get instead the greater-equal symbol? Run next code and post the log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option=encoding; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;beyond, try by next change to your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;out=pa66_working&lt;STRONG&gt;(encoding='UTF-8')&lt;/STRONG&gt; dbms=xlsx replace;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 19:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722465#M224007</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-28T19:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722468#M224009</link>
      <description>&lt;P&gt;I have run your code on SAS University edition.&lt;/P&gt;&lt;P&gt;Prima facie I don't see any issue with your code and the result.&lt;/P&gt;&lt;P&gt;SAS does import&amp;nbsp; your spreadsheet&amp;nbsp; correctly including&amp;nbsp;&lt;SPAN&gt;≥400%&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;What exactly is your issue?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 19:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722468#M224009</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-02-28T19:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722470#M224011</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131732"&gt;@Sajid01&lt;/a&gt;&amp;nbsp;your answer relate to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31988"&gt;@geneshackman&lt;/a&gt;&amp;nbsp;'s code.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SAS University edition is running with encoding = 'UTF-8' therefore you got the right value without any issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 19:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722470#M224011</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-28T19:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722471#M224012</link>
      <description>&lt;P&gt;UTF stands for&amp;nbsp;&lt;STRONG&gt;U&lt;/STRONG&gt;nicode&amp;nbsp;&lt;STRONG&gt;T&lt;/STRONG&gt;ransfer&amp;nbsp;&lt;STRONG&gt;F&lt;/STRONG&gt;ormat.&lt;/P&gt;
&lt;P&gt;Unicode is a character table orders of magnitude larger than the common ASCII table (which uses only 1 byte per character).&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.m.wikipedia.org/wiki/UTF-8" target="_blank" rel="noopener"&gt;UTF-8&lt;/A&gt;&amp;nbsp;is the most commonly used method to encode this character table, but since several characters in the upper range of the ASCII table are used as starting characters for multi-byte sequences, the encoding of the software must match that of the data.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 22:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722471#M224012</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-28T22:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722491#M224025</link>
      <description>log output:&lt;BR /&gt;21   PROC IMPORT DATAFILE=&lt;BR /&gt;21 ! "\\dohfile02\phig\PHIGDATA\PreventionAgenda\Tableau\Data\&amp;amp;folderyear\pa66.xlsx"&lt;BR /&gt;22   out=pa66_working(encoding='UTF-8') dbms=xlsx replace;&lt;BR /&gt;23   sheet='2016-2017';&lt;BR /&gt;24   RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE:    Variable Name Change.  Data Source -&amp;gt; Data_Source&lt;BR /&gt;NOTE:    Variable Name Change.  Stratifier Subgroup -&amp;gt; Stratifier_Subgroup&lt;BR /&gt;NOTE:    Variable Name Change.  Standard Error -&amp;gt; Standard_Error&lt;BR /&gt;NOTE:    Variable Name Change.  Intepret With Caution -&amp;gt; Intepret_With_Caution&lt;BR /&gt;NOTE:    Variable Name Change.  Data Not Reportable -&amp;gt; Data_Not_Reportable&lt;BR /&gt;NOTE: Data file WORK.PA66_WORKING.DATA is in a format that is native to another host, or the file&lt;BR /&gt;      encoding does not match the session encoding. Cross Environment Data Access will be used,&lt;BR /&gt;      which might require additional CPU resources and might reduce performance.&lt;BR /&gt;NOTE: One or more variables were converted because the data type is not supported by the V9&lt;BR /&gt;      engine. For more details, run with options MSGLEVEL=I.&lt;BR /&gt;WARNING: Some character data was lost during transcoding in column: Stratifier Subgroup at obs 20.&lt;BR /&gt;NOTE: The import data set has 40 observations and 14 variables.&lt;BR /&gt;NOTE: WORK.PA66_WORKING data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;      real time           0.04 seconds&lt;BR /&gt;      cpu time            0.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: Data file WORK.PA66_WORKING.DATA is in a format that is native to another host, or the file&lt;BR /&gt;      encoding does not match the session encoding. Cross Environment Data Access will be used,&lt;BR /&gt;      which might require additional CPU resources and might reduce performance.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 28 Feb 2021 21:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722491#M224025</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-02-28T21:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722492#M224026</link>
      <description>I don't know how it will show up, but this seems to be what is in the out data set&lt;BR /&gt;&amp;#26;400%&lt;BR /&gt;some kind of box in front of the 400%</description>
      <pubDate>Sun, 28 Feb 2021 21:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722492#M224026</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-02-28T21:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722498#M224031</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31988"&gt;@geneshackman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I don't know how it will show up, but this seems to be what is in the out data set&lt;BR /&gt;&amp;#26;400%&lt;BR /&gt;some kind of box in front of the 400%&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once you have started your SAS session with an encoding that does not contain any code that means that character there is no way to fix it.&amp;nbsp; You could check what character it did get mapped to by using the $HEX format to look at it and then just change it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set pa66_working;
   Stratifier_Subgroup = tranwrd(Stratifier_Subgroup,'1A'x,'=&amp;gt;');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But that is not guaranteed to only change that character.&amp;nbsp; Any unknown character in the source will be mapped to same strange code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Might be better to look for the rest of the string and then fix it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set pa66_working;
  if index(Stratifier_Subgroup,'400%') then Stratifier_Subgroup = '&amp;gt;=400%';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 22:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722498#M224031</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-28T22:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: reading in an equal to or greater than symbol</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722570#M224072</link>
      <description>Thanks very much! &lt;BR /&gt;1) Can I specify some other encoding that might include that character?&lt;BR /&gt;2) "look for the rest of the string and then fix it."  That seems like the easiest solution.</description>
      <pubDate>Mon, 01 Mar 2021 13:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-in-an-equal-to-or-greater-than-symbol/m-p/722570#M224072</guid>
      <dc:creator>geneshackman</dc:creator>
      <dc:date>2021-03-01T13:19:10Z</dc:date>
    </item>
  </channel>
</rss>

