<?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 remove space from the first charcter in the variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293420#M61067</link>
    <description>&lt;P&gt;The rectangle means it is a non printable character and is not in your font set of characters.&lt;/P&gt;&lt;P&gt;I would start with searching the origin of data because removing characters means you change the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On your capture I saw 0 to 2 rectangles and maybe there are more, even in middle of a variable;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those can be different characters, not neccessary the same one;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in case you recognize specific hexa characters you can replace then to any character(s) you chose&lt;/P&gt;&lt;P&gt;using TRANSLATE function:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ne_var = translate(old_var, &amp;nbsp;new_chars, old_chars);&lt;/P&gt;&lt;P&gt;new_chars and old_chars should fit by order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2016 13:31:59 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2016-08-23T13:31:59Z</dc:date>
    <item>
      <title>how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293400#M61054</link>
      <description>&lt;P&gt;i have a variable in the dataset and it has characters which start with a weird space or square like thing.&lt;/P&gt;
&lt;P&gt;I need to remove it whereever it is there in the variable list. Can any one help me in it.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293400#M61054</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2016-08-23T12:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293402#M61056</link>
      <description>&lt;P&gt;First I'd recommend to convert the contents of your variable to a new variable of double length with a $hex format.&lt;/P&gt;
&lt;P&gt;Assuming that oldvar is $6:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvar = put(oldvar,$hex12.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can determine what exactly is behind the funny symbol, and can use that hex code to decide when the first character should be stripped using the substr() function and when not. Use the hex code in a literal as "NN"x (NN being hex digits 0-9,a-f)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293402#M61056</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-23T12:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293403#M61057</link>
      <description>&lt;P&gt;you can remove 1st character by:&lt;/P&gt;&lt;P&gt;var = substr(var,2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know the origin of your data? how did you get the variable with that extra character ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293403#M61057</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-08-23T12:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293408#M61062</link>
      <description>&lt;P&gt;Yes, But not all variables have that funny symbol in the start.&lt;/P&gt;
&lt;P&gt;For example see the screenshot. but for some variables it is proper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12877iBA78E08E82F21F01/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.JPG" title="Capture.JPG" /&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293408#M61062</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2016-08-23T12:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293410#M61063</link>
      <description>&lt;P&gt;Since this is program code, it looks to me like the result of a failed character code conversion when transferring the file from one system to another.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293410#M61063</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-23T12:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293420#M61067</link>
      <description>&lt;P&gt;The rectangle means it is a non printable character and is not in your font set of characters.&lt;/P&gt;&lt;P&gt;I would start with searching the origin of data because removing characters means you change the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On your capture I saw 0 to 2 rectangles and maybe there are more, even in middle of a variable;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those can be different characters, not neccessary the same one;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in case you recognize specific hexa characters you can replace then to any character(s) you chose&lt;/P&gt;&lt;P&gt;using TRANSLATE function:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ne_var = translate(old_var, &amp;nbsp;new_chars, old_chars);&lt;/P&gt;&lt;P&gt;new_chars and old_chars should fit by order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 13:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293420#M61067</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-08-23T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove space from the first charcter in the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293609#M61152</link>
      <description>temp1=prxchange('s/^\s+//',1,temp);</description>
      <pubDate>Wed, 24 Aug 2016 03:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-space-from-the-first-charcter-in-the-variables/m-p/293609#M61152</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-24T03:09:02Z</dc:date>
    </item>
  </channel>
</rss>

