<?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 in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126749#M25799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Art's suggestion does the trick, great.&amp;nbsp; If not, here are a couple of possibilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DispositionType is not left-hand justified.&amp;nbsp; Check that using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if left(DispositionType)="Wit" then ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, somehow the data entry process added unprintable characters such as a line feed at the end of DispositionType.&amp;nbsp; Check that using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if DispositionType =&lt;STRONG&gt;:&lt;/STRONG&gt; "Wit" then ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Mar 2013 16:42:10 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2013-03-04T16:42:10Z</dc:date>
    <item>
      <title>If then in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126747#M25797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;I am trying to rename some values in a data step using a simple "if then" statement. When I try to do this using the values in 'DispositionType' below, I cannot get it to execute the "then" part of it. It just leaves the values as is. I have increased the length of 'DispositionType' to 50 characters to accommodate the new length of the values to no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have other "if thens" below that are executing fine, so I don't know what is wrong with this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on this would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data s8StackedBarChart2 (rename=(tprYear=Year));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length County $ 25 tprYear 3 AgeRange $ 30 DispositionType $ 50&lt;/P&gt;&lt;P&gt;CohortYearTotal 5 CohortYearTotalAge 5 DistributiveNumber 5 DistributivePercent 5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;merge s8StackedBarCounty s8StackedBarCountyAA &lt;/P&gt;&lt;P&gt;s8StackedBarNys s8StackedBarNysAA&lt;/P&gt;&lt;P&gt;s8StackedBarNyc s8StackedBarNycAA&lt;/P&gt;&lt;P&gt;s8StackedBarRos s8StackedBarRosAA;&lt;/P&gt;&lt;P&gt;by County tprYear AgeRange DispositionType;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Wit" then DispositionType="Withdrawn";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Dis" then DispositionType="Dismissed";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Sus" then DispositionType="Suspended Judgement";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Par" then DispositionType="Parent's rights terminated";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Oth" then DispositionType="Other";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if DispositionType="Pen" then DispositionType="Pending disposition";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if County="NewYork" then County="New York (Manhattan)";&lt;/P&gt;&lt;P&gt;if County="Kings" then County="Kings (Brooklyn)";&lt;/P&gt;&lt;P&gt;if County="Richmond" then County="Richmond (Staten Island)";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if AgeRange="0 to 3" then AgeRange="1 - 0 to 3";&lt;/P&gt;&lt;P&gt;if AgeRange="4 to 6" then AgeRange="2 - 4 to 6";&lt;/P&gt;&lt;P&gt;if AgeRange="7 to 9" then AgeRange="3 - 7 to 9";&lt;/P&gt;&lt;P&gt;if AgeRange="10 to 12" then AgeRange="4 - 10 to 12";&lt;/P&gt;&lt;P&gt;if AgeRange="13 to 15" then AgeRange="5 - 13 to 15";&lt;/P&gt;&lt;P&gt;if AgeRange="16 to 17" then AgeRange="6 - 16 to 17";&lt;/P&gt;&lt;P&gt;if AgeRange="All Ages" then AgeRange="7 - All Ages";&lt;/P&gt;&lt;P&gt;if AgeRange="Invalid Age" then AgeRange="8 - Invalid Age";&lt;/P&gt;&lt;P&gt;if Ground="All Locations" then Ground="All";&lt;/P&gt;&lt;P&gt;if AgeRange ne "8 - Invalid Age";&lt;/P&gt;&lt;P&gt;drop cnty_name Ground;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126747#M25797</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2013-03-04T16:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: If then in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126748#M25798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is that you have a format assigned to DispositionType.&amp;nbsp; Add the following statement, right under your length statement, and let us know if that corrects the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format DispositionType $50.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126748#M25798</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-04T16:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: If then in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126749#M25799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Art's suggestion does the trick, great.&amp;nbsp; If not, here are a couple of possibilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DispositionType is not left-hand justified.&amp;nbsp; Check that using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if left(DispositionType)="Wit" then ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, somehow the data entry process added unprintable characters such as a line feed at the end of DispositionType.&amp;nbsp; Check that using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if DispositionType =&lt;STRONG&gt;:&lt;/STRONG&gt; "Wit" then ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126749#M25799</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-03-04T16:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: If then in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126750#M25800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art&lt;/P&gt;&lt;P&gt;That worked fine, thanks a lot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why there would be a special format assigned to this variable, as I just copied it from another program with a similar variable and that worked fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126750#M25800</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2013-03-04T16:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: If then in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126751#M25801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Astounding&lt;/P&gt;&lt;P&gt;The unprintable characters is something I have wondered about in other situations actually. So the above will help with other variables we use here. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-in-data-step/m-p/126751#M25801</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2013-03-04T16:47:03Z</dc:date>
    </item>
  </channel>
</rss>

