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.
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)?
Hard to say without seeing your entire code, but looks right.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.