query to see match and non match records

Hi,
I am running below query an getting match counts for table a and table b, i also want to
see nonmatch records for site_id and dm_id how can i do tht so i want is give me list
of all site_id which no texist in dim_id


   PROC SQL;
  CREATE TABLE test as (
    select
        site_id,DM_ID
      from DIM._DIM a
      inner join stage.pc_dm b
      on input(a.site_id,best32.) = b.DM_ID);
      quit;
sam2929Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

theartfuldazzlerCommented:
Hi

You can use the EXCEPT operator in Proc SQL:

PROC SQL;
 CREATE TABLE test as
   Select input(site_Id,best32.) As dm_Id from dim._dim
  Except
    Select dm_Id from stage.PC_dm;

This selects all site_ids in dim._dim that are not in stage.PC_dm
PROC SQL;
Create table a_notB as
  Select input(a.site_id,best32.) As dm_Id from DIM._DIM
    Except
    Select DM_ID FROM stage.pc_dm;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sam2929Author Commented:
hi,
with this new expert exchange how can i put my question in sas?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.