create table pd_pool_id_mob_le_6_l0_pre as select a.account_no a.level4, a.level3 from monthly.pd_pool_id_&&yymmdd_L0 a, staging.credit_card_account_h_&&yymmdd_L0 b where a.account_no=b.account_no and intck('month', date_card_opened, "&SAMPDATE"d)+1<=7;
what does it mean to select from more than one dataset?
is this an inner join?
You are JOINing the two datasets. (kind of like a MERGE in normal SAS code, but more complicated).
In this case since you are testing if the account numbers match between the two datasets it is like an INNER JOIN.
So you are taking three variables from the "monthly" dataset, but only for the account numbers that are also in the "staging" dataset. 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).
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.