<?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: Datalines statement help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/444030#M111123</link>
    <description>&lt;P&gt;This is not a programmatical, but a design question: what does "&amp;gt;36" mean? If you want that column to be numeric, you have to lay down a rule that tells you to what discrete number any "&amp;gt;dd" (d = digit) string has to be converted. If you could simply say that such strings should result in a missing numerical value, the solution could be quite easy.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Mar 2018 08:41:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-09T08:41:02Z</dc:date>
    <item>
      <title>Datalines statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/443962#M111104</link>
      <description>&lt;P&gt;Hi there! I have to create a dataset, but one data point is weird (&amp;gt;36). The variable is supposed to be numeric, and I'm not sure how to do that. It keeps coming up as missing when I run it as is. This is the code I've been running:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;DATA filename;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;INPUT &lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;age class $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Datalines;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;13 B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;18 C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;&amp;gt;36 A&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;21 B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: 400;"&gt;I would love any help you could give me! Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 03:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/443962#M111104</guid>
      <dc:creator>sarahbrannan</dc:creator>
      <dc:date>2018-03-09T03:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/443964#M111106</link>
      <description>&lt;P&gt;What do you want instead of missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best way is probably to read it as character and clean it.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 03:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/443964#M111106</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-09T03:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/444028#M111121</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote, one option is to read the variable as character and then clean it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are absolutely sure that you do not have any "&amp;gt;" characters anywhere else, the fast and dirty solution can be to add it as a delimiter:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA filename;
  infile datalines delimiter=' &amp;gt;';
  INPUT age class $;
Datalines;
13 B
18 C
&amp;gt;36 A
21 B
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Another quick fix is to modify the infile buffer:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA filename;
  input @;
  if _infile_=:'&amp;gt;' then
    _infile_=substr(_infile_,2);
  INPUT age class $;
Datalines;
13 B
18 C
&amp;gt;36 A
21 B
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/444028#M111121</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-03-09T08:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/444030#M111123</link>
      <description>&lt;P&gt;This is not a programmatical, but a design question: what does "&amp;gt;36" mean? If you want that column to be numeric, you have to lay down a rule that tells you to what discrete number any "&amp;gt;dd" (d = digit) string has to be converted. If you could simply say that such strings should result in a missing numerical value, the solution could be quite easy.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datalines-statement-help/m-p/444030#M111123</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-09T08:41:02Z</dc:date>
    </item>
  </channel>
</rss>

