BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8
merge ACCT_NEW_ALL_MAC(IN=A) rate_MAC DEC_ACCT_MAC_OCA_SUM2;
by account_no
if a

Select * from  ACCT_NEW_ALL_MAC A 
left join rate_MAC B on A.account_no=B.account_no
left join DEC_ACCT_MAC_OCA_SUM2 C A.account_no=C.account_no

Hi I am trying to write SAS merging three tables into SQL, please could you review for me and let me know if it make sense?

Thanks.

3 REPLIES 3
LinusH
Tourmaline | Level 20

Sure, unless you have other logic in the data step this (almost) the same logic.

But if it's existing code, why change (unless it's to be sent down to a database for processing)?

Data never sleeps
PeterClemmensen
Tourmaline | Level 20

Hard to say without seeing your entire code, but looks right.

ballardw
Super User

How many variables are in common between the data sets other than the By variable(s)?

If there are any then the result of the Merge is almost certainly going to be quit different than that SQL.

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
  • 3 replies
  • 484 views
  • 0 likes
  • 4 in conversation