<?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: Data Step - String Literal and numeric IN() list in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153110#M30097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that worked! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 22:57:24 GMT</pubDate>
    <dc:creator>JBerry</dc:creator>
    <dc:date>2014-06-23T22:57:24Z</dc:date>
    <item>
      <title>Data Step - String Literal and numeric IN() list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153108#M30095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable which has possible values of 1Y 2Y 3Y 4Y 5Y U &amp;lt;missing&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating a new variable in a data step, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if var1 In('3Y','4Y','5Y') then newvar=1; else if var1=. THEN newvar=.; ELSE newvar=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that the newvar becomes missing when in fact the original value was 1Y or 2Y.&amp;nbsp; But the newvar seems to actually be correct in the instance of it being in the IN() list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get no errors, but I get a warning:&lt;/P&gt;&lt;P&gt;Limit set by ERRORS=option reached. Further errors of this type will not be printed&lt;/P&gt;&lt;P&gt;(makes no sense, because I'm not getting errors)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a note for just about every row -&lt;/P&gt;&lt;P&gt;Invalid numeric data, VAR1='1Y', at line xxxx column yyyy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So - what in the world am I doing wrong that allows this to partially work? It works in the first list but apparently on the ELSE I am getting this weird note.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 22:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153108#M30095</guid>
      <dc:creator>JBerry</dc:creator>
      <dc:date>2014-06-23T22:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step - String Literal and numeric IN() list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153109#M30096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if var1 In('3Y','4Y','5Y') then newvar=1; &lt;/P&gt;&lt;P&gt;else if &lt;STRONG&gt;var1=' '&lt;/STRONG&gt; THEN newvar=.; &lt;/P&gt;&lt;P&gt;ELSE newvar=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 22:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153109#M30096</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-23T22:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step - String Literal and numeric IN() list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153110#M30097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that worked! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 22:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-String-Literal-and-numeric-IN-list/m-p/153110#M30097</guid>
      <dc:creator>JBerry</dc:creator>
      <dc:date>2014-06-23T22:57:24Z</dc:date>
    </item>
  </channel>
</rss>

