BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jcis7
Pyrite | Level 9

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

2 REPLIES 2
Reeza
Super User

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;

jcis7
Pyrite | Level 9

Thank  you very much Smiley Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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