<?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: Categorising a table based on contents of columns in a second table in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200979#M10777</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 1.25 million data set(ONE in my example) is not an issue because it is a DRIVER. Only the data from TWO, that too, only Diagnosis will be stored in the hash table.&lt;/P&gt;&lt;P&gt;I believe the solution can be tried with some sampled data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2015 17:41:45 GMT</pubDate>
    <dc:creator>KachiM</dc:creator>
    <dc:date>2015-06-09T17:41:45Z</dc:date>
    <item>
      <title>Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200970#M10768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Hi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;I appreciate some help with this task, which I find a bit challenging&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;I have two tables:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1- Table 1: Containing patients and their diagnosis coded according to ICD code system (the table has several thousand rows in reality)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none; width: 158px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="background: #6690BC; padding: 1.5pt 1.5pt 1.5pt 1.5pt;"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Arial; color: white;"&gt;Patient&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="background: #6690BC; padding: 1.5pt 1.5pt 1.5pt 1.5pt;"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Diagnosis&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;JOHN&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;ALEX&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;ZAK&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;K12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;RICHARD&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A25&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;SAM&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;G3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;MANNY&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;H2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;2- Table 2: basically contains a number of ICD diagnosis groups, for the sake of simplicity let us say we have three columns A, B, C each of which has rows representing a number of ICD diagnosis codes, here is a simplification:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none; width: 295px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="background: #6690BC; padding: 1.5pt 1.5pt 1.5pt 1.5pt;"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group A&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="background: #6690BC; padding: 1.5pt 1.5pt 1.5pt 1.5pt;"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A21&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;C13&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A25&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A33&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;J12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;H12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;G1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;K12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;K77&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;L5&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;G1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;J12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;D3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A25&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;G3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;What I would like to do is to create a third table which is essentially Table 1 plus three more columns each for group A, B and C. The code would then go through every row and see if the ICD diagnosis in table 1 fits any of the diagnoses in Groups A, B and C and if so it would fill the corresponding cell with 1 otherwise 0. Here is the final table just to explain:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none; width: 340px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Arial; color: white;"&gt;Patient&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Diagnosis&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group A&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center; background: rgb(102, 144, 188);"&gt;&lt;P align="center" style="margin-bottom: 1.5pt; text-align: center;"&gt;&lt;SPAN style="color: white; font-size: 10.0pt; font-family: Arial;"&gt;&lt;STRONG&gt;Group C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;JOHN&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;ALEX&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;ZAK&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;K12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;RICHARD&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;A25&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;SAM&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;G3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 1.5pt; text-align: left;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;MANNY&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;H2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 1.5pt; text-align: center;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Could anyone please suggest how this can be done? The tables in reality are of course much much larger&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 13:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200970#M10768</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T13:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200971#M10769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code below gives you a normalised dataset which can be merged onto your original data to get group information.&amp;nbsp; As to your required output having the 1's and 0's, this is an exact duplicate of the question here: &lt;A __default_attr="277098" __jive_macro_name="message" class="jive_macro jive_macro_message active_link" href="https://communities.sas.com/" modifiedtitle="true" title="Re: Need help to handle missing values"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there, I will say it again, the separate columns - groupa, groupb etc. do not add anything to data other than size, so why do you need it, by processing is far easier and quicker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data group;&lt;/P&gt;&lt;P&gt;&amp;nbsp; groupa="A12"; groupb="A21"; groupc="C13"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; groupa="A25"; groupb="A33"; groupc="J12"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=group out=t_group;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by group:;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var group:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 14:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200971#M10769</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-06-09T14:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200972#M10770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you RW9, though not sure this is the best solution as both tables are rather large. I would prefer if there can be a function to compare contentd&lt;/P&gt;&lt;P&gt;Thanks again &lt;/P&gt;&lt;P&gt;Best regards &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 14:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200972#M10770</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T14:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200973#M10771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, there is vname.&amp;nbsp; However what you will end up with is lots of code to add no value.&amp;nbsp; Merging is pretty quick, all SAS functions and SQL functions have by/class processing and that is the faster way to perform calculations/functions.&amp;nbsp; So why bother going to all the hassel of creating many columns, then needing to keep lists of those columns to do things with them etc. when you could just create a normalised table and by group it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 14:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200973#M10771</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-06-09T14:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200974#M10772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp; am not sure that a hash solution will meet the load of your data set. Ignore this if it is difficult.&lt;/P&gt;&lt;P&gt;Here is the approach:&lt;/P&gt;&lt;P&gt;Store Diagnosis of each Group(A,B,C) into a hash table while reading the second data set(TWO).&lt;/P&gt;&lt;P&gt;Then for each Diagnosis of first(ONE), check its presence in each hash table, and if present, flag it to one(1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;input Patient $ Diagnosis $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;JOHN&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&lt;/P&gt;&lt;P&gt;ALEX&amp;nbsp;&amp;nbsp;&amp;nbsp; A12&lt;/P&gt;&lt;P&gt;ZAK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K12&lt;/P&gt;&lt;P&gt;RICHARD A25&lt;/P&gt;&lt;P&gt;SAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G3&lt;/P&gt;&lt;P&gt;MANNY&amp;nbsp;&amp;nbsp; H2&lt;/P&gt;&lt;P&gt;;&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;data two;&lt;/P&gt;&lt;P&gt;input A$ B$ C$;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A12 A21 C13&lt;/P&gt;&lt;P&gt;A25 A33 J12&lt;/P&gt;&lt;P&gt;H12&amp;nbsp; G1&amp;nbsp; A1&lt;/P&gt;&lt;P&gt;K12 K77&amp;nbsp; L5&lt;/P&gt;&lt;P&gt;G1&amp;nbsp; J12&amp;nbsp; A12&lt;/P&gt;&lt;P&gt;D3&amp;nbsp; A25&amp;nbsp;&amp;nbsp; G3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _n_ = 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 0 then set two;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash ha();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ha.definekey('A');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ha.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash hb();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hb.definekey('B');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hb.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; declare hash hc();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hc.definekey('C');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hc.definedone();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do until (eof);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set two end = eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ha.add();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hb.add();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hc.add();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set one;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array k&lt;LI&gt; ga gb gc;&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i = 1 to dim(k);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k&lt;I&gt; = 0;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; A = Diagnosis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if ha.find() = 0 then k[1] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; B = Diagnosis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if hb.find() = 0 then k[2] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; C = Diagnosis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if hc.find() = 0 then k[3] = 1;&lt;/P&gt;&lt;P&gt;keep Patient Diagnosis ga gb gc;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 15:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200974#M10772</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2015-06-09T15:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200975#M10773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thank you all,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Here is some update:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Table 1 contains 1.25 million observations &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Table 2 contains 8 groups and 40 different ICD diagnoses per row &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I am not sure the solution suggested would manage the data load &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Any other suggestions?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 16:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200975#M10773</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T16:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200976#M10774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again RW9&lt;/P&gt;&lt;P&gt;As mentioned above, Table 2 ( the diagnoses) is 8 groups x 40 different diagnoses, and during the course of the analysis we might need to add/remove some diagnoses. It is easier to do that through a table then edit there instead of a long code to include all these diagnoses or am I mistaken?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 16:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200976#M10774</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T16:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200977#M10775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would be tempted to use Table 2 to create custom format or informat to create the coded values. If the coded values are to be numeric then something like this might be a starting point.&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;invalue groupa&lt;/P&gt;&lt;P&gt;'A12','A25','H12','K12','G1','D3' = 1&lt;/P&gt;&lt;P&gt;other=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; groupacode= input(diagnosis,groupa.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would likely want to make a CNTLIN dataset from Table 2 and save the resulting formats in a permanent library.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 17:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200977#M10775</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-09T17:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200978#M10776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I think I did solve it at the end&lt;/P&gt;&lt;P&gt;This is how I did it, might not be the best solution but it did work on my 1.25 million records and rather quickly&lt;/P&gt;&lt;P&gt;1- Added a fourth column (flag) to table 2, filling all the cells with a value of "1"&lt;/P&gt;&lt;P&gt;2- Used proc sql and a left join to lookup the contents of Group A from table 2 in Diagnosis in table 1, if a match if found the "1" from the additional column in table 2 is included in the new table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select a.*, b.flag&lt;/P&gt;&lt;P&gt;from patients as a&lt;/P&gt;&lt;P&gt;left join groups as b&lt;/P&gt;&lt;P&gt;on a.diagnosis=b.groupA;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3- Final step: using "coalesce" to replace missing value in the "flag" column in the "want" table (ie non existing match) with "0"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then repeating this for Group B and Group C&lt;/P&gt;&lt;P&gt;Any comments or suggestions to this solution?&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 17:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200978#M10776</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T17:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200979#M10777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 1.25 million data set(ONE in my example) is not an issue because it is a DRIVER. Only the data from TWO, that too, only Diagnosis will be stored in the hash table.&lt;/P&gt;&lt;P&gt;I believe the solution can be tried with some sampled data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 17:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200979#M10777</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2015-06-09T17:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200980#M10778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you datasp, will definitely try it&lt;/P&gt;&lt;P&gt;Do you think there are advantages to using your solution over proc sql as I suggested?&lt;/P&gt;&lt;P&gt;Thank you again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 17:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200980#M10778</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T17:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200981#M10779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So to update&lt;/P&gt;&lt;P&gt;I did try datasp solution and it worked briliantly too&lt;/P&gt;&lt;P&gt;One further detail to complicate things:&lt;/P&gt;&lt;P&gt;Some if the ICD diagnosis in the patient table had an additional fourth digit:&lt;/P&gt;&lt;P&gt;example: some had a diagnosis code of A219, this is actually a subgroup of A21&lt;/P&gt;&lt;P&gt;in my solution, I bypassed this by substr:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;create table want as&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;select a.*, b.flag&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;from patients as a&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;left join groups as b&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;on&lt;STRONG&gt; substr(a.diagnosis,1,3)&lt;/STRONG&gt;=b.groupA;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be done too in&amp;nbsp; your solution datasp? It wouldnt work in the "format" type of solusion&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 17:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200981#M10779</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-09T17:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Categorising a table based on contents of columns in a second table</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200982#M10780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Additional 4-th digit is not an issue. At present the use of $ sign is by default takes 8 characters. Even if it is longer than 8, use the appropriate width to $. No need&lt;/P&gt;&lt;P&gt;to substring it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 18:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Categorising-a-table-based-on-contents-of-columns-in-a-second/m-p/200982#M10780</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2015-06-09T18:24:41Z</dc:date>
    </item>
  </channel>
</rss>

