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

i know this is fairly similar to other posts but i am just missing something about getting this to work right.  so i have two tables, a and b with fields that match, 1, 2, 3, 4.  so i need to get a field in a to Y on an inner join to table b.  i know sql really well but am new to sas and i am using eg. 

 

so, if fields 1, 2, 3, and 4 match between the two tables it needs to set a.z='Y'...

 

1 ACCEPTED SOLUTION

Accepted Solutions
me55
Quartz | Level 8

i think i solved my own problem.  here is the code i am using...

 

proc sql;
update  a
    set a.z='Y'
    where exists
        (select * from b
            where a.1=b.1 and a.2=b.2 and a.3=b.3
            and a.4=b.4);

 

i havent checked it but i believe this works well and gets what i need it to. 

 

thanks...

 

View solution in original post

1 REPLY 1
me55
Quartz | Level 8

i think i solved my own problem.  here is the code i am using...

 

proc sql;
update  a
    set a.z='Y'
    where exists
        (select * from b
            where a.1=b.1 and a.2=b.2 and a.3=b.3
            and a.4=b.4);

 

i havent checked it but i believe this works well and gets what i need it to. 

 

thanks...

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

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
  • 1 reply
  • 512 views
  • 1 like
  • 1 in conversation