<?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 convert Character variables w/spaces into Numeric ones, in DI Studio? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77679#M664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As for the last row, I think the simplest is to have a data step in a user written transform, in which you specify &lt;EM&gt;if end=last then delete;&lt;/EM&gt; or something similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;comma&lt;/EM&gt; informat should do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 14:44:55 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2012-09-26T14:44:55Z</dc:date>
    <item>
      <title>How to convert Character variables w/spaces into Numeric ones, in DI Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77677#M662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have a character variable with the value "45 000" and want to turn it into a numeric variable, the space is obviously going to cause a problem. Can you please tell me how I can edit my expression to resolve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input(varname, 8.0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, can you also please advise on how I can make my data step exclude the last row from the data set? The total number of rows will change from month to month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77677#M662</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-09-26T13:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Character variables w/spaces into Numeric ones, in DI Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77678#M663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the first part of your question...I'm not familiar with DI Studio but this works in EG 4.3...maybe it'll help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA grades;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input idno 1-2 variable $ 5-11;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cards;&lt;BR /&gt;01&amp;nbsp; 45 000&lt;BR /&gt;02&amp;nbsp; 32 000&lt;BR /&gt;03&amp;nbsp; 100 000&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data grades_1(keep=idno variable2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set grades;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; variable1=CATS(SCAN(variable,1), SCAN(variable,2));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; variable2=INPUT(variable1, best.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC PRINT data = grades_1 NOOBS;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; title 'The grades data set';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 14:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77678#M663</guid>
      <dc:creator>robby_beum</dc:creator>
      <dc:date>2012-09-26T14:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Character variables w/spaces into Numeric ones, in DI Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77679#M664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As for the last row, I think the simplest is to have a data step in a user written transform, in which you specify &lt;EM&gt;if end=last then delete;&lt;/EM&gt; or something similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;comma&lt;/EM&gt; informat should do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 14:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77679#M664</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-09-26T14:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Character variables w/spaces into Numeric ones, in DI Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77680#M665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set yourdataset end=last;&lt;/P&gt;&lt;P&gt; newvariable=input(compress(varname),8.);&lt;/P&gt;&lt;P&gt;if not last;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 15:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77680#M665</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-09-26T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Character variables w/spaces into Numeric ones, in DI Studio?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77681#M666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... the COMMA informat removes internal blanks ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data grades;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;input x $20.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;45 000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;32&amp;nbsp;&amp;nbsp; 000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 2 3 4 5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;100 000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data grades;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set grades end=last;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;y = input(x,comma20.);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if ^last;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;45 000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;32&amp;nbsp;&amp;nbsp; 000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 2 3 4 5&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 15:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-convert-Character-variables-w-spaces-into-Numeric-ones-in/m-p/77681#M666</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-26T15:52:04Z</dc:date>
    </item>
  </channel>
</rss>

