<?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: trailing spaces when exporting data from excel to sas in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273397#M58444</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/87379"&gt;@msfelicity84﻿&lt;/a&gt;:&amp;nbsp;If it works, I must have misunderstood what you were doing.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To me it looks like you have SAS code snippets in an Excel table (maybe you created repetitive code using Excel techniques). Then you talked about copying and pasting into the SAS window, i.e., you pasted code from Excel to the Enhanced Editor via the Windows clipboard.&amp;nbsp;Now you want to tidy up the pasted code by removing/inserting "blanks" where necessary (and think about "find and replace" -- which could indeed be the right tool to achieve this).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that some of the "blanks" might in fact be tab characters (the tabs which separated adjacent Excel cells), but this might depend on Enhanced Editor settings and could be handled with "find and replace" as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, this way of creating SAS code should not be part of the regular development process, but might be acceptable under certain circumstances for a one-time task if the SAS code will be&amp;nbsp;validated properly&amp;nbsp;anyway later on.&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2016 20:57:01 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2016-05-26T20:57:01Z</dc:date>
    <item>
      <title>trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273273#M58429</link>
      <description>&lt;P&gt;I am exporting data from excel to sas. After formating cells to&amp;nbsp;text how can&amp;nbsp;I use&amp;nbsp;"find and replace" to remove the trailing spaces&lt;/P&gt;&lt;P&gt;example below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;If IDORNUM='&lt;/TD&gt;&lt;TD&gt;1217063&lt;/TD&gt;&lt;TD&gt;'then&lt;/TD&gt;&lt;TD&gt;S_ANG=&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;If&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; CIDORNUM=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;' 0857794 't&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;STRONG&gt;hen &lt;/STRONG&gt;S_ANG= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;45&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 14:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273273#M58429</guid>
      <dc:creator>msfelicity84</dc:creator>
      <dc:date>2016-05-26T14:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273278#M58430</link>
      <description>&lt;P&gt;It is not clear from your question whether you are attempting to manipulated data in SAS (SAS does not use CELLS generally, variables are the base of most manipulations).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also your example code doesn't quite "remove spaces" it is assigning a value. If you you mean how can I assign a numeric value based on the value of a character then the code you post will do that as SAS generally ignores trailing spaces in comparisons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to provide more complete deatils of your data and what you are attempting to accomplish.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 14:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273278#M58430</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-26T14:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273289#M58432</link>
      <description>&lt;P&gt;Thank you Ballardw, I'm just trying to remove the space after copying my data from the cells. (I have about 500 rows of data)&lt;/P&gt;&lt;P&gt;Excel example below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Ifnum='&lt;/TD&gt;&lt;TD&gt;0857794&lt;/TD&gt;&lt;TD&gt;'then&lt;/TD&gt;&lt;TD&gt;S_ANG=&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Below is how the data looks when I pastes into thesasWindow&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;If&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; NUM=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;' 0857794 't&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;hen S_ANG= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;45&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Im just trying to remove the extra space in between the quotes&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks again for your assistance.&lt;/FONT&gt;&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;&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>Thu, 26 May 2016 15:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273289#M58432</guid>
      <dc:creator>msfelicity84</dc:creator>
      <dc:date>2016-05-26T15:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273322#M58436</link>
      <description>&lt;P&gt;If you want to change the value of the variable Num from '&amp;nbsp;&amp;nbsp; 0857794&amp;nbsp; ' to '0857794' (SAS will ignore the trailing spaces) easiest might be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Num= strip(num);&lt;/P&gt;
&lt;P&gt;If you have bunch of variables to do this with then an array:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array v Num Idnum ....; /* list the variables to clean up. If it is all of your character values you can use the special list word&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _character_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to indicate all of them*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(v);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v[i] = strip(v[i]);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 17:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273322#M58436</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-26T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273335#M58439</link>
      <description>Great I will try this now, thank you very much!!!</description>
      <pubDate>Thu, 26 May 2016 17:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273335#M58439</guid>
      <dc:creator>msfelicity84</dc:creator>
      <dc:date>2016-05-26T17:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: trailing spaces when exporting data from excel to sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273397#M58444</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/87379"&gt;@msfelicity84﻿&lt;/a&gt;:&amp;nbsp;If it works, I must have misunderstood what you were doing.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To me it looks like you have SAS code snippets in an Excel table (maybe you created repetitive code using Excel techniques). Then you talked about copying and pasting into the SAS window, i.e., you pasted code from Excel to the Enhanced Editor via the Windows clipboard.&amp;nbsp;Now you want to tidy up the pasted code by removing/inserting "blanks" where necessary (and think about "find and replace" -- which could indeed be the right tool to achieve this).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that some of the "blanks" might in fact be tab characters (the tabs which separated adjacent Excel cells), but this might depend on Enhanced Editor settings and could be handled with "find and replace" as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, this way of creating SAS code should not be part of the regular development process, but might be acceptable under certain circumstances for a one-time task if the SAS code will be&amp;nbsp;validated properly&amp;nbsp;anyway later on.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 20:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trailing-spaces-when-exporting-data-from-excel-to-sas/m-p/273397#M58444</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-05-26T20:57:01Z</dc:date>
    </item>
  </channel>
</rss>

