<?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: select from more than one dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/852900#M337127</link>
    <description>you are really only selecting from first dataset if account_no on is in both data sets (inner join) and date criteria is met</description>
    <pubDate>Mon, 09 Jan 2023 18:30:17 GMT</pubDate>
    <dc:creator>gema</dc:creator>
    <dc:date>2023-01-09T18:30:17Z</dc:date>
    <item>
      <title>select from more than one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851363#M336492</link>
      <description>&lt;PRE&gt;create table pd_pool_id_mob_le_6_l0_pre as
     select
           a.account_no
           a.level4,
           a.level3
from
           monthly.pd_pool_id_&amp;amp;&amp;amp;yymmdd_L0 a,
           staging.credit_card_account_h_&amp;amp;&amp;amp;yymmdd_L0 b
where
           a.account_no=b.account_no and
           intck('month', date_card_opened, "&amp;amp;SAMPDATE"d)+1&amp;lt;=7;&lt;/PRE&gt;
&lt;P&gt;what does it mean to select from more than one dataset?&lt;/P&gt;
&lt;P&gt;is this an inner join?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 15:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851363#M336492</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-12-28T15:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: select from more than one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851366#M336495</link>
      <description>In this case, the code is performing a Cartesian join of the two data sets. Examples and further explanation here: &lt;A href="https://sasnrd.com/sas-cartesian-product-proc-sql-data-step/" target="_blank"&gt;https://sasnrd.com/sas-cartesian-product-proc-sql-data-step/&lt;/A&gt;</description>
      <pubDate>Wed, 28 Dec 2022 15:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851366#M336495</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-28T15:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: select from more than one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851372#M336499</link>
      <description>&lt;P&gt;You are JOINing the two datasets. (kind of like a MERGE in normal SAS code, but more complicated).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case since you are testing if the account numbers match between the two datasets it is like an INNER JOIN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you are taking three variables from the "monthly" dataset, but only for the account numbers that are also in the "staging" dataset.&amp;nbsp; You are also filtering on the DATE_CARD_OPENED variable, but the code does not tell us which of two datasets has that variable. (if both have the variable the code will fail for being ambiguous).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 16:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/851372#M336499</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-28T16:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: select from more than one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/852900#M337127</link>
      <description>you are really only selecting from first dataset if account_no on is in both data sets (inner join) and date criteria is met</description>
      <pubDate>Mon, 09 Jan 2023 18:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/select-from-more-than-one-dataset/m-p/852900#M337127</guid>
      <dc:creator>gema</dc:creator>
      <dc:date>2023-01-09T18:30:17Z</dc:date>
    </item>
  </channel>
</rss>

