<?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: Mapping - Conditions in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254044#M48403</link>
    <description>I need to mention that, I got the output table but the final;_Status is blank in it</description>
    <pubDate>Thu, 03 Mar 2016 03:20:28 GMT</pubDate>
    <dc:creator>don21</dc:creator>
    <dc:date>2016-03-03T03:20:28Z</dc:date>
    <item>
      <title>Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253794#M48326</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;request your help with the below query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set which looks like below:&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; ID_Ac &amp;nbsp; Status&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp;112 &amp;nbsp; &amp;nbsp; &amp;nbsp;Green&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp;113 &amp;nbsp; &amp;nbsp; Green&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp;156 &amp;nbsp; &amp;nbsp; &amp;nbsp;Red&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp;121 &amp;nbsp; &amp;nbsp; &amp;nbsp;Blue&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp;135 &amp;nbsp; &amp;nbsp; red&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp;142 &amp;nbsp; &amp;nbsp; red&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp;155 &amp;nbsp; &amp;nbsp; Red&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp;198 &amp;nbsp; &amp;nbsp; Blue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output must have an additional column called final_status&lt;/P&gt;
&lt;P&gt;The condition that I need to implement here is :&lt;/P&gt;
&lt;P&gt;If atleast one is&amp;nbsp;Greens for an ID, the final status should be Green (like 1 green and 4 reds for same ID - we have to update as Green for all IDs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID ID_Ac Status &amp;nbsp; &amp;nbsp; &amp;nbsp; Final Status&lt;BR /&gt;1 112 &amp;nbsp;Green &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Green&lt;BR /&gt;1 113 &amp;nbsp;Green &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Green&lt;BR /&gt;1 156 &amp;nbsp;Red &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Green&lt;BR /&gt;2 121 &amp;nbsp;yellow &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yellow&lt;BR /&gt;3 135 &amp;nbsp;red &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Blue&lt;BR /&gt;3 142 &amp;nbsp;red &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Blue&lt;BR /&gt;3 198 &amp;nbsp;Blue &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Blue&lt;BR /&gt;4 202 &amp;nbsp;red &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Red&lt;BR /&gt;4 222 &amp;nbsp;red &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;red&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance..&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 13:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253794#M48326</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-02T13:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253795#M48327</link>
      <description>&lt;P&gt;Or , the output can also look like below:&lt;/P&gt;
&lt;P&gt;only unique IDs with the final status..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp;Final Status&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Green&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yellow&lt;BR /&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Blue&lt;BR /&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Red&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.....&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 13:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253795#M48327</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-02T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253801#M48328</link>
      <description>&lt;P&gt;Why is ID 3 blue, and not red? Is there a hierarchy?&lt;/P&gt;
&lt;P&gt;It seems your rule is not complete.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 13:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253801#M48328</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-02T13:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253871#M48342</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51418"&gt;@don21﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It really looks like you have a hierarchy of status values, e.g. "Green is preferred over Yellow, Yellow is preferred over Blue, ..." If this is the case, variable STATUS should actually be numeric and the strings "Green" etc. should be only format labels. Then, the code suggested below could be simplified (in particular, you wouldn't need an informat).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue rank
'green'  = 1
'yellow' = 2
'blue'   = 3
'red'    = 4;

value rank
1 = 'Green'
2 = 'Yellow'
3 = 'Blue'
4 = 'Red';
run;

data have;
input ID ID_Ac Status $;
cards;
1 112 Green
1 113 Green
1 156 Red
2 121 yellow
3 135 red
3 142 red
3 198 Blue
4 202 red
4 222 red
;

proc sql;
create table want as
select id, put(min(input(lowcase(status), rank.)), rank.) as Final_Status
from have
group by id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If variable STATUS has &lt;EM&gt;only&lt;/EM&gt; missing values for a particular ID, Final_Status will be missing. Otherwise, missing values will be ignored. Or should missing values be handled differently?&lt;/P&gt;
&lt;P&gt;To&amp;nbsp;switch to your original output format, simply&amp;nbsp;change the SELECT statement to&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;select *, put(&lt;/FONT&gt;..." and add an ORDER BY clause:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;group by id
order by id, id_ac;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 16:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/253871#M48342</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-02T16:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254040#M48400</link>
      <description>&lt;P&gt;Dear Reinhard,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the quick response, I tried running the code. went welll till the end but, got this error in the final step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;BR /&gt;NOTE: Invalid string.&lt;BR /&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;BR /&gt;NOTE: Table WORK.SAMPLE created, with 9 rows and 3 columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 03:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254040#M48400</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-03T03:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254041#M48401</link>
      <description>&lt;P&gt;HI LinisH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID 3 is Blue because there is atleast oone blue for that ID. RED will be taken only if all the values for the ID are REDs..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you..&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 03:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254041#M48401</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-03T03:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254043#M48402</link>
      <description>&lt;P&gt;looking forward to your advise on this..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 03:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254043#M48402</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-03T03:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254044#M48403</link>
      <description>I need to mention that, I got the output table but the final;_Status is blank in it</description>
      <pubDate>Thu, 03 Mar 2016 03:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254044#M48403</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-03T03:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254045#M48404</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made some changes to the source and required data to make my request look more clear:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HAVE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Account &amp;nbsp; Relation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status &lt;BR /&gt;332 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OPENED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Open, if atleast 1 account tagged to the relationship is in Open status&lt;BR /&gt;112 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CLOSED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Unclaimed, if all accounts tagged to the relationship is in Unclaimed &lt;BR /&gt;154 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UNCLAIMED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dormant, if all accounts tagged to the relationship is either Dormant / Unclaimed status&lt;BR /&gt;144 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;UNCLAIMED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Closed, if all accounts tagged to the account are closed&lt;BR /&gt;198 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DORMANT &lt;BR /&gt;189 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DORMANT &lt;BR /&gt;157 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UNCLAIMED &lt;BR /&gt;111 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CLOSED &lt;BR /&gt;163 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CLOSED &lt;BR /&gt;127 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CLOSED&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;REQUIERD:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PFA attached file for more clarity...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help Thank you..&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 03:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254045#M48404</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-03T03:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254114#M48422</link>
      <description>&lt;P&gt;The below code is applicable only if the status var have the below mentioned values.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input Account Relation Status $ 10.;&lt;BR /&gt;cards;&lt;BR /&gt;332 1 OPENED &lt;BR /&gt;112 1 CLOSED &lt;BR /&gt;154 2 UNCLAIMED &lt;BR /&gt;144 2 UNCLAIMED &lt;BR /&gt;198 3 DORMANT &lt;BR /&gt;189 3 DORMANT &lt;BR /&gt;157 3 UNCLAIMED &lt;BR /&gt;111 4 CLOSED &lt;BR /&gt;163 4 CLOSED &lt;BR /&gt;127 4 CLOSED&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table want1 as&lt;BR /&gt;select *, count( distinct status) as diststatcnt from have&lt;BR /&gt;group by relation;&lt;BR /&gt;create table want2 as&lt;BR /&gt;select *, count(status) as statcnt from want1&lt;BR /&gt;group by relation, status;&lt;BR /&gt;create table want3 as select *, count(relation) as relcnt from want2 &lt;BR /&gt;group by relation;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want(drop = diststatcnt statcnt relcnt);&lt;BR /&gt;set want3;&lt;BR /&gt;length Final_Status $ 15;&lt;BR /&gt;if status = "OPENED" then final_status = "Open";&lt;BR /&gt;if status = "CLOSED" and statcnt = relcnt then final_status = "Close";&lt;BR /&gt;if status = "UNCLAIMED" and statcnt = relcnt then final_status = "Unclaimed";&lt;BR /&gt;if status in ('DORMANT' 'UNCLAIMED') and diststatcnt = 2 then final_status = "Dormant";&lt;BR /&gt;if final_status = " " then final_status = "Open";&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 10:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254114#M48422</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2016-03-03T10:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254127#M48425</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/205993"&gt;@sindhu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the quick response, I tried running the code. went welll till the end but, got this error in the final step:&lt;/P&gt;
&lt;P&gt;(...)&lt;BR /&gt;NOTE: Invalid string.&lt;BR /&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;BR /&gt;NOTE: Table WORK.SAMPLE created, with 9 rows and 3 columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51418"&gt;@don21&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, you did not run the&amp;nbsp;code I had posted, but some different code: Not only is your output dataset named differently (SAMPLE; of course, this is not the issue), but more importantly it has &lt;STRONG&gt;3&lt;/STRONG&gt; columns. My code results correctly in a work dataset WANT with 4 rows and &lt;STRONG&gt;2&lt;/STRONG&gt; columns. So, you must have modified the SELECT statement &lt;EM&gt;and&lt;/EM&gt; used different input data (thus getting 9 rows as a result).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most probably, your input data contain a value which is not covered by informat RANK. If I change, for example, "yellow" to "orange" in my input data &lt;EM&gt;without adapting the INVALUE statement of PROC FORMAT correspondingly&lt;/EM&gt;, I get the same "Invalid string" issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, please make sure that the lowcase version of every single status&amp;nbsp;value in your input data is listed in the INVALUE statement of PROC FORMAT in order to specify a rank. Alternatively (if you cannot know all of your status values in advance), you could modify the format and informat as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue rank
'green'  = 1
'yellow' = 2
'blue'   = 3
'red'    = 4
other    = 999
;

value rank
1 = 'Green'
2 = 'Yellow'
3 = 'Blue'
4 = 'Red'
999='-invalid-';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, all unexpected values of status would be classified as "worse than 'red'" and if an ID has only such values, its Final_Status would be '-invalid-' (of course, you may modify&amp;nbsp;this label).&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 11:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254127#M48425</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-03T11:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254134#M48428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51418"&gt;@don21﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification of your request. Please note that your specifications do not cover the following cases:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;status values of one relationship include DORMANT and CLOSED, but neither OPENED nor UNCLAIMED&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;status values of one relationship include UNCLAIMED&amp;nbsp;and CLOSED, but&amp;nbsp;neither OPENED nor DORMANT&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;status values of one relationship include UNCLAIMED, DORMANT and CLOSED, but not OPENED.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Please confirm that these cases cannot occur (not even due to data issues) or define&amp;nbsp;the Final_Status for each of them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; For illustration, you can add the following datalines to your sample data and apply suggested solutions to them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;111 5 DORMANT
163 5 CLOSED 
127 5 CLOSED
111 6 CLOSED 
163 6 UNCLAIMED
127 6 CLOSED
111 7 DORMANT
163 7 CLOSED 
127 7 UNCLAIMED&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2016 11:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254134#M48428</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-03T11:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping - Conditions in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254890#M48652</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;.. &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2016 06:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mapping-Conditions-in-SAS/m-p/254890#M48652</guid>
      <dc:creator>don21</dc:creator>
      <dc:date>2016-03-07T06:50:18Z</dc:date>
    </item>
  </channel>
</rss>

