<?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: Retrieve data from multiple datasets in some conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420003#M103318</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;EM&gt;wenzli25 wrote:&lt;/EM&gt;&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;"Do not know if I didn't explain my question well... I'll keep waiting and &lt;STRONG&gt;trying..."&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate that sincere attitude. I didn't read your question at length and on the surface seemed not so clear. I do not have SAS software at home. I can only look into it tomorrow when I go to college. If your question isn't answered by then, I'll give it a shot. Have a good night&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2017 03:44:17 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2017-12-11T03:44:17Z</dc:date>
    <item>
      <title>Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419800#M103257</link>
      <description>&lt;DIV class="lia-quilt-row lia-quilt-row-main"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-18 lia-quilt-column-left lia-quilt-column-main-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-component-thread-subject"&gt;&lt;P&gt;(&lt;SPAN class=""&gt;The topic I posted was missing, I don't know why..., so I reposted the topic. T____T)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone, I have couple questions in SAS…I want to retrieve data from multiple datasets in some conditions.&lt;/P&gt;&lt;P&gt;In brief, there are two datasets. The first one is the events owned by customers, another one is the order of&lt;/P&gt;&lt;P&gt;priority for the events. What I want to do is to recommend two events that not yet owned by the customer.&lt;BR /&gt;However, there are two conditions, the first one is the category of recommended event is the same as the&lt;/P&gt;&lt;P&gt;category of customer. The second one is based on the priority and the order, recommend the event not owned&lt;/P&gt;&lt;P&gt;by the customer, and different to the first recommended event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use cross join on two tables, then, used the loop function to match the criteria.&lt;/P&gt;&lt;P&gt;But I'm wondering if there is any more efficient way, or my way is wrong...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The following is a simple example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset one&lt;/P&gt;&lt;P&gt;Description: ID only belongs one category, but one ID has multiple events, and event belongs one event category.&lt;/P&gt;&lt;PRE&gt;data one;
   input ID $ ID_CATEGORY $ EVENT $ EVENT_CATEGORY $;
   datalines;
01 A1 A A1
01 A1 B A1
01 A1 C B1
02 B1 A A1
02 B1 D B1
03 B1 E B1
04 A1 A A1
;&lt;/PRE&gt;&lt;P&gt;Dataset two&lt;/P&gt;&lt;P&gt;Description: Based on the priority, each row has two events, and each belongs their categories.&lt;/P&gt;&lt;PRE&gt;data two;
   input PRIORITY EVENT1 $ EVENT1_CATEGORY $ EVENT2 $ EVENT2_CATEGORY $;
   datalines;
1 A A1 B A1
2 B A1 D B1
3 C B1 A A1
4 D B1 E B1
5 E B1 G A1
;	&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="lia-component-thread-subject"&gt;&lt;BR /&gt;&lt;P&gt;Dataset three (which I want to create)&lt;/P&gt;&lt;TABLE&gt;&l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&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;04&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;Explanation:&lt;/P&gt;&lt;P&gt;For ID 01, ID's category is A1 (show in dataset one), and the recommended item1 is 'G', because 'G' is the&lt;/P&gt;&lt;P&gt;first event in category 'A1' (show in dataset two).&lt;/P&gt;&lt;P&gt;Then, the recommended item2 is 'D', because of the priority and the order. (Priority1 is 'A' and 'B' item in dataset two,&lt;/P&gt;&lt;P&gt;but ID 01 has already held two events in dataset one. Priority2 is 'B' and 'D', so 'D' is selected.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me to figure out this question how to solve... or any recommended functions?? Thanks &amp;gt; &amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419800#M103257</guid>
      <dc:creator>wenzli25</dc:creator>
      <dc:date>2017-12-11T11:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419840#M103263</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;wenzli25 wrote:&lt;/EM&gt;&lt;BR /&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-main"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-18 lia-quilt-column-left lia-quilt-column-main-content"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-component-thread-subject"&gt;&lt;P&gt;&lt;EM&gt;(&lt;SPAN class=""&gt;The topic I posted was missing, I don't know why..., so I reposted the topic. T____T)&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hi , I believe you may be able to retrieve your lost topic and I&amp;nbsp;think your best is to&amp;nbsp;to approach&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp; perhaps on a weekday requesting to retrieve that thread. Had the question been answered, would only make it redundant. Having 6 hours past since your re posting with 80+ views and no responses yet makes me wonder retrieving your lost thread would help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 09 Dec 2017 19:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419840#M103263</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-09T19:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419994#M103315</link>
      <description>&lt;P&gt;Hi novinosrin,&lt;/P&gt;&lt;P&gt;Thank you for your help. My old topic has been recovered, but I haven't got the solution. Do not know if I didn't explain my question well... I'll keep waiting and trying...&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 03:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/419994#M103315</guid>
      <dc:creator>wenzli25</dc:creator>
      <dc:date>2017-12-11T03:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420003#M103318</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;EM&gt;wenzli25 wrote:&lt;/EM&gt;&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;"Do not know if I didn't explain my question well... I'll keep waiting and &lt;STRONG&gt;trying..."&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate that sincere attitude. I didn't read your question at length and on the surface seemed not so clear. I do not have SAS software at home. I can only look into it tomorrow when I go to college. If your question isn't answered by then, I'll give it a shot. Have a good night&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 03:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420003#M103318</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-11T03:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420069#M103342</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Thank you ^ _ ^&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I revised the description of the content, I hope this easier to understand.&lt;/SPAN&gt;&lt;BR /&gt;Thank you very much for your reply and help. Have a good night !!!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420069#M103342</guid>
      <dc:creator>wenzli25</dc:creator>
      <dc:date>2017-12-11T11:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420260#M103403</link>
      <description>&lt;P&gt;Hey Good afternoon, Sorry for being late. I slept off and train schedules all got delayed. I do need some clarification on your explanation though:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;EM&gt;Explanation:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For ID 01, ID's category is A1 (show in dataset one), and the recommended item1 is 'G', because 'G' is the&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;first event in category 'A1' (show in dataset two).&amp;nbsp;&lt;/EM&gt;&lt;FONT color="#FF6600"&gt;A.&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;What look up key from dataset one fetches 'G'&amp;nbsp; which is in EVENT2 of dataset two? I am assuming it is ID_category of one&amp;lt;--&amp;gt; Event2_category? and&amp;nbsp;&lt;SPAN&gt;What look up key from dataset one fetches 'D' from EVENT2&amp;nbsp; &amp;nbsp;dataset two? I am assuming it is ID_category of one&amp;lt;--&amp;gt; Event2_category&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Then, the recommended item2 is 'D', because of the priority and the order. (Priority1 is 'A' and 'B' item in dataset two,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;but ID 01 has already held two events in dataset one. Priority2 is 'B' and 'D', so 'D' is selected.)&amp;nbsp;&lt;/EM&gt;&lt;FONT color="#FF0000"&gt;and&amp;nbsp;What look up key from dataset one fetches 'D' from EVENT2&amp;nbsp; &amp;nbsp;dataset two? I am assuming it is ID_category of one&amp;lt;--&amp;gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;In essence, I need you to explain me the &lt;STRONG&gt;look up operation of the logic with "keys"&lt;/STRONG&gt; and &lt;STRONG&gt;priority&lt;/STRONG&gt; clearly like what fetches what and why(priority).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;It is 2 pm here in Chicago. I should be here till 7 pm. If I could get the clarity, I should be able to help.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset three (which I want to create)&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ID&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;_CATEGORY&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ITEM1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ITEM1_CATEGORY&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;ITEM2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&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gt;&lt;P&gt;04&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;D&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 19:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420260#M103403</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-11T19:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from multiple datasets in some conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420370#M103453</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Hi novinosrin,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply, because we're in different time zones.&lt;BR /&gt;&lt;SPAN class=""&gt;The format of my original data is like dataset two, but I think that data transposition can be done to facilitate data processing and understanding. &lt;SPAN class="short_text"&gt;The converted format is as follows&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;BR /&gt;&lt;PRE&gt;data two;
   input PRIORITY EVENT $ EVENT_CATEGORY $ ;
   datalines;
1 A A1 
1 B A1
2 B A1 
2 D B1
3 C B1 
3 A A1
4 D B1 
4 E B1
5 E B1 
5 G A1
;	&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;EM&gt;Explanation:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For ID 01, ID's category is A1 (show in dataset one), and the recommended item1 is 'G', because 'G' is the&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;first event in category 'A1' (show in dataset two).&amp;nbsp;&lt;/EM&gt;&lt;FONT color="#999999"&gt;A.&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#999999"&gt;What look up key from dataset one fetches 'G'&amp;nbsp; which is in EVENT2 of dataset two? I am assuming it is ID_category of one&amp;lt;--&amp;gt; Event2_category?&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;For recommended event1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; ID_category of dataset one = Event_category of dataset two&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; and ID_event of one ^= Event of two&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; &lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;The order of priority is from top to bottom of dataset two&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Then, the recommended item2 is 'D', because of the priority and the order. (Priority1 is 'A' and 'B' item in dataset two,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;but ID 01 has already held two events in dataset one. Priority2 is 'B' and 'D', so 'D' is selected.)&amp;nbsp;&lt;/EM&gt;&lt;FONT color="#999999"&gt;and&amp;nbsp;What look up key from dataset one fetches 'D' from EVENT2&amp;nbsp; &amp;nbsp;dataset two? I am assuming it is ID_category of one&amp;lt;--&amp;gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#999999"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;For recommended event2&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; ID_event of dataset one ^= Event of dataset two&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; recommended event2 ^= recommended event1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;-&amp;gt; &lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;The order of priority is from top to bottom of dataset two&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;In essence, I need you to explain me the &lt;STRONG&gt;look up operation of the logic with "keys"&lt;/STRONG&gt; and &lt;STRONG&gt;priority&lt;/STRONG&gt; clearly like what fetches what and why(priority).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thank you for your help, I think I have some ideas, I'll continue to try some methods. ^_^&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 06:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retrieve-data-from-multiple-datasets-in-some-conditions/m-p/420370#M103453</guid>
      <dc:creator>wenzli25</dc:creator>
      <dc:date>2017-12-12T06:13:55Z</dc:date>
    </item>
  </channel>
</rss>

