<?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: plus-minus sign (±)  not shown in proc report in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556831#M7515</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If the SAS code contains the ± character,&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I'm confused. The SAS code presented does not contain that character. So I don't see how this applies.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2019 16:05:07 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-05-07T16:05:07Z</dc:date>
    <item>
      <title>plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556786#M7511</link>
      <description>&lt;P&gt;Hi SAS UE users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make a report table with "±" sign, but sas report as "&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Invalid characters were present in the data.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: An error occurred while processing text data."&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;I have tried to find information and I only found this link might be relevant "&lt;A href="https://www.lexjansen.com/phuse/2016/pp/PP10.pdf" target="_blank" rel="noopener"&gt;https://www.lexjansen.com/phuse/2016/pp/PP10.pdf&lt;/A&gt;".&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;However, it mentions the use of byte to deal with the problem but it does not work for me.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;I appreciate any suggestions.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sign;
a = 10;
b = 20;
%LET PLUSMIN=%SYSFUNC(BYTE(177)) ;
c = trim(left(put(a,10.2))) || " &amp;amp;PLUSMIN " || trim(left(put(b,10.2)));
run;


proc report data = sign;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 14:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556786#M7511</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-07T14:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556794#M7512</link>
      <description>&lt;P&gt;In SAS Studio, your code works properly and produces the expected output.&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="Capture.PNG"&gt;&lt;img src="https://communities.sas.com/skins/images/E0BB18E7DAA53C21BC28740CEA0E38DA/responsive_peak/images/image_not_found.png" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be something wrong with your installation of UE or SAS Studio.&amp;nbsp;Or perhaps you are using a different output destination. What output destination are you using? What is your version of SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, no need for macro variables or macro functions here.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 14:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556794#M7512</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-07T14:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556822#M7514</link>
      <description>&lt;P&gt;If the SAS code contains the ± character, and the file was saved using your native Windows encoding for English, then the ± character is represented as one byte. By default, SAS Studio expects the encoding of files to be UTF-8 unless you have specified a default text encoding other than&amp;nbsp;UTF-8. However, the ± character is not a valid one-byte character in UTF-8, so the character is converted to the the the UTF-8 replacement character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This blog post has suggestions for informing SAS Studio that your SAS file was created using the native WIndows encoding.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2018/06/22/a-transcoding-story-or-how-oliver-s-fusling-lost-his-last-name-and-comes-to-find-it-again/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2018/06/22/a-transcoding-story-or-how-oliver-s-fusling-lost-his-last-name-and-comes-to-find-it-again/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elizabeth&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 15:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556822#M7514</guid>
      <dc:creator>ehbales</dc:creator>
      <dc:date>2019-05-07T15:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556831#M7515</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If the SAS code contains the ± character,&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I'm confused. The SAS code presented does not contain that character. So I don't see how this applies.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 16:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556831#M7515</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-07T16:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556944#M7520</link>
      <description>&lt;P&gt;My apologies. I assumed that adding the BYTE function to the code was a workaround when a file with the actual character was opened into SAS Studio. If the encoding of your SAS session is WLATIN1, I agree that the code you have should work. However, since you are seeing the errors about invalid characters present in the data, there is a possibility that the encoding of your SAS session is UTF-8. Run this to verify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC OPTIONS OPTION=ENCODING; RUN:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ASCII characters (7-bit) are represented as one byte in UTF-8. All other characters, including the ±, must be represented as more than one byte. Since the BYTE function only returns one byte, the value for 177 is invalid in UTF-8. That could cause the errors you see.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The UTF-8 hexadecimal representation for ± is C2B1. If your SAS session encoding is UTF-8, you can use the following statement to add that character to the string directly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c = trim(left(put(a,10.2))) || 'c2b1'x || trim(left(put(b,10.2)));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use KPROPDATA to convert the result of BYTE to UTF-8. That's slightly more complicated but looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c = trim(left(put(a,10.2))) || KPROPDATA(BYTE(177), 'uesc', 'wlatin1', 'utf8') || trim(left(put(b,10.2)));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 21:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/556944#M7520</guid>
      <dc:creator>ehbales</dc:creator>
      <dc:date>2019-05-07T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558314#M7536</link>
      <description>&lt;P&gt;Thank you all the suggestions!&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 14:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558314#M7536</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-13T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558316#M7537</link>
      <description>&lt;P&gt;Could you explain more what the x means in "c2b1'x? How can I add space before and after the plus/minus sign?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 14:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558316#M7537</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-13T14:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558326#M7538</link>
      <description>&lt;P&gt;The string followed by the x is a SAS character constant that is represented in hexadecimal notation. I've included a link to the SAS documentation. There is a brief explanation of hex constants there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0cq7f0icfjr8vn19vyunwmmsl7m.htm&amp;amp;locale=en#n1l9fhsrv13jbtn1txnuvj61aefd"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p0cq7f0icfjr8vn19vyunwmmsl7m.htm&amp;amp;locale=en#n1l9fhsrv13jbtn1txnuvj61aefd&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sequence of characters within the string are the internal representation, or code points, of the character(s) that you want to represent. Hexadecimal notation is convenient if the character you want in the sting is not present on your keyboard. If you want to add quotes, you can do that one of the following ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Hex character constants can include one or more characters. The internal representation of the space character is Hex 20. You could add spaces using the following syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;c = trim(left(put(a,10.2))) || '20c2b120'x || trim(left(put(b,10.2)));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. You can concatenate the spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;c = trim(left(put(a,10.2))) || ' ' || 'c2b1'x || ' ' || trim(left(put(b,10.2)));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: As a reminder, C2B1 is the Hexadecimal representation of the ± character in UTF-8.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 15:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558326#M7538</guid>
      <dc:creator>ehbales</dc:creator>
      <dc:date>2019-05-13T15:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: plus-minus sign (±)  not shown in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558984#M7563</link>
      <description>Thank you very much!</description>
      <pubDate>Wed, 15 May 2019 14:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/plus-minus-sign-not-shown-in-proc-report/m-p/558984#M7563</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-15T14:53:45Z</dc:date>
    </item>
  </channel>
</rss>

