<?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 question: to tell if a term is belonged to a term_group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121248#M24846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If its a version of vlookup, look at proc format and put statements or merges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to provide more detail otherwise.&lt;/P&gt;&lt;P&gt;See here:&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="2263" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 15:55:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-06-27T15:55:53Z</dc:date>
    <item>
      <title>data step question: to tell if a term is belonged to a term_group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121247#M24845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do this to match an item (apple, green_onion, yam, orange...... ) with its own catgory.&lt;/P&gt;&lt;P&gt;Priror to it, I have tables that lists items in each group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two resouce tables are:&lt;/P&gt;&lt;P&gt;Vegie_table with two columns: item(50+)&amp;nbsp; group (all values='vegie')&lt;/P&gt;&lt;P&gt;Fruit_table with two columns: items(50+)&amp;nbsp; group(all values='frt')&lt;/P&gt;&lt;P&gt;drink_table with two columns: items(1000+)&amp;nbsp; group(all values='drk')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table look like this&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="width: 100%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;food&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;total price&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;name1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;orange&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;name2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;onion&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;name2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;bean&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;name3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;potato&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2.8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create another column ----- food_type which indicates the type of the name in the food column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if food is in (&amp;amp;itemlist.) then food_type='&amp;nbsp; xx ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;where itemlist is combined by vegie_table and fruit_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the itemlist I obtained has no quotes seperate them so I can not do it this way. Imagine I need to do this with my drink_list as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is probaaly like SAS version of vlookup....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to do it with what I want.&amp;nbsp;&amp;nbsp; Thank you all~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 15:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121247#M24845</guid>
      <dc:creator>Lulus</dc:creator>
      <dc:date>2013-06-27T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: data step question: to tell if a term is belonged to a term_group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121248#M24846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If its a version of vlookup, look at proc format and put statements or merges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to provide more detail otherwise.&lt;/P&gt;&lt;P&gt;See here:&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="2263" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 15:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121248#M24846</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-06-27T15:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: data step question: to tell if a term is belonged to a term_group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121249#M24847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possibly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if index("&amp;amp;itemlist",food) &amp;gt;0 then food_type=' xx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;might work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121249#M24847</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-06-27T16:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: data step question: to tell if a term is belonged to a term_group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121250#M24848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to convert your lookup tables into a format.&lt;/P&gt;&lt;P&gt;I would combine the three tables into one and use it as the CNTLIN &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Vegie_table with two columns: item(50+)&amp;nbsp; group (all values='vegie')&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Fruit_table with two columns: items(50+)&amp;nbsp; group(all values='frt')&lt;/P&gt;
&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drink_table with two columns: items(1000+)&amp;nbsp; group(all values='drk')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;data formats ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set vegie_table fruit_table drink_table ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by item;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain fmtname 'FOOD' type 'C' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; rename item=start group=label;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc format cntlin=formats;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;food_type = put(food,$food.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 20:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-question-to-tell-if-a-term-is-belonged-to-a-term-group/m-p/121250#M24848</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-27T20:51:30Z</dc:date>
    </item>
  </channel>
</rss>

