Help using Base SAS procedures

selecting certain observations

Accepted Solution Solved
Reply
Regular Contributor
Posts: 194
Accepted Solution

selecting certain observations

Hello!

I'm trying to add a contact name and email address to only observations that are public (Type=1)  (vs private (Type=2)).

I know how to add the observations using sql for all types but no for certain types.

I still want to keep the private facilities in the dataset but just want to add the admins to the public facilities

Here's my code:

proc sql;


create table admins as


select *


from admin


LEFT JOIN



ON distcode=dist_code


quit;

Any help you can give is appreciated Smiley Happy


Accepted Solutions
Solution
‎02-24-2015 01:06 PM
Super User
Posts: 19,817

Re: selecting certain observations

Did your code get cut off? I only see reference to one table but a LEFT JOIN...

You can add a filter to your join using ON/AND

ie

left join lookup

on distcode=dist_code AND public=1;

quit;

View solution in original post


All Replies
Solution
‎02-24-2015 01:06 PM
Super User
Posts: 19,817

Re: selecting certain observations

Did your code get cut off? I only see reference to one table but a LEFT JOIN...

You can add a filter to your join using ON/AND

ie

left join lookup

on distcode=dist_code AND public=1;

quit;

Regular Contributor
Posts: 194

Re: selecting certain observations

Thank  you very much Smiley Happy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 172 views
  • 0 likes
  • 2 in conversation