<?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: How to treat sas7bdat file with invalid characters? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840054#M332156</link>
    <description>&lt;P&gt;Make a dictionary of characters and their UTF replacements (e.g. in an array), and then use&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n101a8jch5trh0n1bc5neq48hc89.htm" target="_blank" rel="noopener"&gt;TRANSTRN&lt;/A&gt;&amp;nbsp;to do each replacement.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Oct 2022 07:06:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-10-22T07:06:23Z</dc:date>
    <item>
      <title>How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840053#M332155</link>
      <description>&lt;P&gt;One of the data files storm_2017.sas7bdat that came with programming 2 has lots invalid characters causing errors.&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="willtopower_0-1666419684706.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76459i1DCEC30AAE7A4CF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="willtopower_0-1666419684706.png" alt="willtopower_0-1666419684706.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is the best way to treat these invalid characters? I am thinking about downloading it as CSV and removing them manually and then uploading up back into SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 06:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840053#M332155</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-22T06:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840054#M332156</link>
      <description>&lt;P&gt;Make a dictionary of characters and their UTF replacements (e.g. in an array), and then use&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n101a8jch5trh0n1bc5neq48hc89.htm" target="_blank" rel="noopener"&gt;TRANSTRN&lt;/A&gt;&amp;nbsp;to do each replacement.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 07:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840054#M332156</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-22T07:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840057#M332157</link>
      <description>&lt;P&gt;I am sorry I am still a beginner, I kinda understand what you're saying but I have no idea how to implement it in SAS.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 08:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840057#M332157</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-22T08:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840062#M332160</link>
      <description>It looks like a carriage return character '\n' .&lt;BR /&gt;Can you change your sas 's encoding into 'utf-8' or others ? maybe could solve it .</description>
      <pubDate>Sat, 22 Oct 2022 09:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840062#M332160</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-22T09:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840063#M332161</link>
      <description>&lt;P&gt;This will take some research on your part. Use the $HEX format to display the hex codes of your strings, so you can use them for defining your "target" characters (see the function documentation).&lt;/P&gt;
&lt;P&gt;From the context, you will be able to determine the wanted UTF character (in "Yucatan", it must be some kind of accented a). Look up the multi-byte "replacement" string in online available UTF tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="3"&gt;Edit: fixed typos&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 20:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840063#M332161</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-22T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840077#M332166</link>
      <description>&lt;P&gt;Does it really cause any trouble for doing the exercises?&amp;nbsp; If not then just ignore it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To figure out what is going on do a little research.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Find out what encoding your SAS session is using.&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;Find out what encoding the dataset is using.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=mylib.storm_2017;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are two main types of encodings used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Single byte encodings such as LATIN1 or WLATIN1.&amp;nbsp; In those encoding each character uses only one byte.&amp;nbsp; But that means that there are only 256 possible characters (which includes invisible characters like TAB, CARRIAGE RETURN and LINE FEED).&lt;/P&gt;
&lt;P&gt;And multibyte encoding, which will normally be UTF-8.&amp;nbsp; With UTF-8 some characters require 2,3 to 4 bytes to be represented.&lt;/P&gt;
&lt;P&gt;So there literally thousands of characters that can be represented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your SAS session is using a single byte encoding then it might be that the characters in the dataset are ones that are not included in the 256 characters available in that encoding. So if your SAS session is NOT using UTF-8 as the encoding then see if you can change that.&amp;nbsp; That way SAS will be able to represent any character that might be in the dataset.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; If the encoding settings on the dataset are confused you could still have invalid strings.&amp;nbsp; For example if the strings in the dataset are actually using a single byte encoding, but SAS thinks they are UTF-8 then there are some combination of bytes that are not valid in UTF-8.&amp;nbsp; That can also be fixed, but might require more effort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 12:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840077#M332166</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-22T12:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to treat sas7bdat file with invalid characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840110#M332189</link>
      <description>&lt;P&gt;yeah, but I just completed the exercise with another sas7.dbat file&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 20:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-treat-sas7bdat-file-with-invalid-characters/m-p/840110#M332189</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-22T20:15:20Z</dc:date>
    </item>
  </channel>
</rss>

