<?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: Help inputting &amp;quot;&amp;lt;1&amp;quot; as a number? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118050#M293205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&amp;lt;1" is not a number, not only it is char, but also if it implies number, it implies many numbers which are less than 1. Question is: if you do want to input "&amp;lt;1" as a number, you need to decide which number you want to assign to it. If you made a decision that "&amp;lt;1" will be input as , for example, 0.5, then you could try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; invalue num&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;lt;1' = 0.5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input v1-v3 v4 num.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put v4=;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1 2 3 &amp;lt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 02:51:26 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2013-04-24T02:51:26Z</dc:date>
    <item>
      <title>Help inputting "&lt;1" as a number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118048#M293203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a raw data I'm trying to input, but I cannot figure out how to input &amp;lt;1 as a number. This is a snippet of how two lines of the raw data look:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"...k&amp;nbsp; 103&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 10.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 170&amp;nbsp; 31&amp;nbsp; 0&amp;nbsp; 21&amp;nbsp; 4&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Van....&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;........es&amp;nbsp; 101&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 7.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 105&amp;nbsp; 30&amp;nbsp; &amp;lt;1&amp;nbsp; 23&amp;nbsp; 4 ........ "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 23:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118048#M293203</guid>
      <dc:creator>missmeliss22</dc:creator>
      <dc:date>2013-04-23T23:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help inputting "&lt;1" as a number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118049#M293204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to read in the numbers as "characters"&lt;/P&gt;&lt;P&gt;data in;&lt;/P&gt;&lt;P&gt;input letter $ v1 v2 v3 v4 v5 v6 v7 v8 v9 &lt;STRONG&gt;v10 $&lt;/STRONG&gt; v11 v12;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;k&amp;nbsp; 103&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 10.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 170&amp;nbsp; 31 &lt;STRONG&gt; 0&lt;/STRONG&gt;&amp;nbsp; 21&amp;nbsp; 4 &lt;/P&gt;&lt;P&gt;es&amp;nbsp; 101&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 7.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 105&amp;nbsp; 30&amp;nbsp; &lt;STRONG&gt;&amp;lt;1&lt;/STRONG&gt;&amp;nbsp; 23&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the '&lt;EM&gt;&amp;lt;' &lt;/EM&gt;sign is a character, SAS will read it right only if the entire variable is character.&lt;/P&gt;&lt;P&gt;It's late here, maybe I am not making sense.&lt;/P&gt;&lt;P&gt;If you don't know which variable has the "&amp;lt;1" values then you may need to read all you variables in as characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a thought.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 01:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118049#M293204</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-24T01:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help inputting "&lt;1" as a number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118050#M293205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&amp;lt;1" is not a number, not only it is char, but also if it implies number, it implies many numbers which are less than 1. Question is: if you do want to input "&amp;lt;1" as a number, you need to decide which number you want to assign to it. If you made a decision that "&amp;lt;1" will be input as , for example, 0.5, then you could try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; invalue num&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;lt;1' = 0.5;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input v1-v3 v4 num.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put v4=;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1 2 3 &amp;lt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 02:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118050#M293205</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-04-24T02:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help inputting "&lt;1" as a number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118051#M293206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Anca. You can't avoid reading such data as character. In some cases, you may also want to put something else as a number for values &amp;lt;n, such as n/2... If any of these fields can start with "&amp;lt;", use arrays :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;data test;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;length car1 cv1-cv13 car2 $10;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;array cv{13};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;array v{13};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;input car1 cv1-cv13 car2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;do i = 1 to dim(v);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt; if first(cv{i}) = "&amp;lt;" then v{i} = input(substr(cv{i},2), best.);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt; else v{i} = input(cv{i}, best.);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;drop cv: i;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;...k&amp;nbsp; 103&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 10.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 170&amp;nbsp; 31&amp;nbsp; 0&amp;nbsp; 21&amp;nbsp; 4&amp;nbsp; 2011&amp;nbsp;&amp;nbsp;&amp;nbsp; Van....&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;........es&amp;nbsp; 101&amp;nbsp; 270&amp;nbsp; 140&amp;nbsp; 15.0&amp;nbsp; 7.0&amp;nbsp; 0&amp;nbsp; 60&amp;nbsp; 105&amp;nbsp; 30&amp;nbsp; &amp;lt;1&amp;nbsp; 23&amp;nbsp; 4 2012 .....dum&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 03:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118051#M293206</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-04-24T03:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help inputting "&lt;1" as a number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118052#M293207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use ?? input modifier .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 05:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-inputting-quot-lt-1-quot-as-a-number/m-p/118052#M293207</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-04-24T05:42:24Z</dc:date>
    </item>
  </channel>
</rss>

