<?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: Looking for Starting Point Using SAS Code pulling from Multiple Tables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91915#M26181</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please tell us some more information about your task?&lt;/P&gt;&lt;P&gt;DO you need a hint about how to join 4 tables (which provided by DBeily), or you need a way to do it based on a certain conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;p.s.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;By the way&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;((IF Prop_Type NE 2&amp;nbsp; OR If Prop_Type EQ 2 and Disburement NE 250)) == &lt;/STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;((IF Prop_Type NE 2&amp;nbsp; OR&amp;nbsp; Disburement NE 250))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;since (not x) or x and y == (not x) or y&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Mar 2013 06:00:49 GMT</pubDate>
    <dc:creator>ghastly_kitten</dc:creator>
    <dc:date>2013-03-29T06:00:49Z</dc:date>
    <item>
      <title>Looking for Starting Point Using SAS Code pulling from Multiple Tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91913#M26179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I received a request from a customer to develop a report using multiple tables with multiple scenarios.&amp;nbsp; My thought was to combine all of the "and" and then the "or" groups.&amp;nbsp; The report should show data if the following conditions are present Here is the example:&lt;/P&gt;&lt;P&gt;((if elapse_days &amp;lt;=15 and if Ins_Code in ('A','B') or if Ins_Code EQ spaces) AND IF Assoc_ID not like Z&amp;nbsp; AND &lt;STRONG&gt;((IF Prop_Type NE 2&amp;nbsp; OR If Prop_Type EQ 2 and Disburement NE 250))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here is what I am doing so far;&lt;/P&gt;&lt;P&gt;%let elapse = TODAY()-Set_Date;&lt;/P&gt;&lt;P&gt;data INS1(keep=ID&amp;nbsp; Ins_Code&amp;nbsp; Elapse_Time);&lt;/P&gt;&lt;P&gt;set File1;&lt;/P&gt;&lt;P&gt;where Ins_Code in ('A','B','');&lt;/P&gt;&lt;P&gt;Elapse_Time=&amp;amp;Elapse;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is where I stopped.&amp;nbsp; I need to address the following:&lt;/P&gt;&lt;P&gt;Assoc_ID(from a table called &lt;STRONG&gt;File2&lt;/STRONG&gt;),&lt;/P&gt;&lt;P&gt;Prop_Type(from &lt;STRONG&gt;File3&lt;/STRONG&gt;) and&lt;/P&gt;&lt;P&gt;Disbursement(form &lt;STRONG&gt;File4&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;The part I have bolded is where I get stuck.&amp;nbsp; At some point in time I need to merge the 4 tables based on the ID&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 18:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91913#M26179</guid>
      <dc:creator>omega1983</dc:creator>
      <dc:date>2013-03-28T18:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Starting Point Using SAS Code pulling from Multiple Tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91914#M26180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just to get you started.&amp;nbsp; I'm not sure if you need inner or outer joins based on your requirements.&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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,t2.assoc_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,t3.prop_type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,t4.disbursement&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file1 t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join file2 t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.id=t2.id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join file3 t3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.id=t3.id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join file4 t4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.id=t4.id&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (date() - t1.set_date) &amp;lt;=15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and t2.assoc_id not like 'Z%' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and t3.prop_type ne 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (t3.prop_type=2 and t4.disbursement ne 250)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 18:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91914#M26180</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-03-28T18:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Starting Point Using SAS Code pulling from Multiple Tables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91915#M26181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please tell us some more information about your task?&lt;/P&gt;&lt;P&gt;DO you need a hint about how to join 4 tables (which provided by DBeily), or you need a way to do it based on a certain conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;p.s.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;By the way&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;((IF Prop_Type NE 2&amp;nbsp; OR If Prop_Type EQ 2 and Disburement NE 250)) == &lt;/STRONG&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;((IF Prop_Type NE 2&amp;nbsp; OR&amp;nbsp; Disburement NE 250))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;since (not x) or x and y == (not x) or y&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2013 06:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Looking-for-Starting-Point-Using-SAS-Code-pulling-from-Multiple/m-p/91915#M26181</guid>
      <dc:creator>ghastly_kitten</dc:creator>
      <dc:date>2013-03-29T06:00:49Z</dc:date>
    </item>
  </channel>
</rss>

