<?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: If Then Else? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69070#M19802</link>
    <description>Suggest adding this line at various locations in your SAS program's DATA step for some diagnosis:&lt;BR /&gt;
&lt;BR /&gt;
PUTLOG _ALL_;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Fri, 04 Feb 2011 12:39:22 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2011-02-04T12:39:22Z</dc:date>
    <item>
      <title>If Then Else?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69068#M19800</link>
      <description>Hello, &lt;BR /&gt;
&lt;BR /&gt;
I'm having trouble with a set. I'm trying to assign values (body types) with a code in a single new variable... but the output is assigning the one value CV and no PV's?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data Vehicles;&lt;BR /&gt;
set name;&lt;BR /&gt;
set othername key = varname/unique;&lt;BR /&gt;
If _error_ then delete;&lt;BR /&gt;
If  ThreePrice = . then do; &lt;BR /&gt;
   ThreePrice = NewPrice;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
If BodyStyle in ('3D Hatchback','4D Sedan',...,'2D Softtop') 		&lt;BR /&gt;
then do;&lt;BR /&gt;
	TYPE= 'PV';&lt;BR /&gt;
end;&lt;BR /&gt;
else do; &lt;BR /&gt;
	TYPE= 'CV';&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
keep 	...&lt;BR /&gt;
rename 	...&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 04 Feb 2011 04:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69068#M19800</guid>
      <dc:creator>SamT</dc:creator>
      <dc:date>2011-02-04T04:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Else?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69069#M19801</link>
      <description>The test is case-sensitive. Are your values mixed-case, just like your constants?</description>
      <pubDate>Fri, 04 Feb 2011 09:18:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69069#M19801</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-04T09:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Else?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69070#M19802</link>
      <description>Suggest adding this line at various locations in your SAS program's DATA step for some diagnosis:&lt;BR /&gt;
&lt;BR /&gt;
PUTLOG _ALL_;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 04 Feb 2011 12:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69070#M19802</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-02-04T12:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Else?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69071#M19803</link>
      <description>I would generally use:&lt;BR /&gt;
&lt;BR /&gt;
If upcase(BodyStyle) in ('3D HATCHBACK','4D SEDAN',...,'2D SOFTTOP')&lt;BR /&gt;
&lt;BR /&gt;
because so many data sources tend to mess with case. The other thing to look for would be different numbers of spaces between your list in the "IN" clause and your data.</description>
      <pubDate>Fri, 04 Feb 2011 21:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69071#M19803</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-02-04T21:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Else?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69072#M19804</link>
      <description>Thanks mate. Works now and I'll look out for it in the future too! &lt;BR /&gt;
&lt;BR /&gt;
- Sam</description>
      <pubDate>Mon, 07 Feb 2011 22:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-Then-Else/m-p/69072#M19804</guid>
      <dc:creator>SamT</dc:creator>
      <dc:date>2011-02-07T22:46:49Z</dc:date>
    </item>
  </channel>
</rss>

