I have created a new table out of two datasets using left join. However since some of the format is incorrect in dataset 2, there are some missing values in the joined new table. I know which values to add but I am stuck on the syntax. How do I add on to the missing values in this code? Do I make a seperate proc sql? or do I use if/else statements? If it is something like if/else, where would I put them? If it is a different concept, please let me know. Feel free to use the sample code from my work below or simplify it to whatever you would use. Thank you!
proc sql;
create table final as
select L.*, R.*
from A as L
left join B as R
on (substr(L.One, length(L.One)-1)=substr(R.Two,length(R.Two)-1)
and substr(L.State, length(L.State)-1)) ;
quit;
proc print data = final;
run;
Why did you create new thread?
Since the 2 questions are still unanswered, you won't get much help.
Please make an effort to explain the final output properly:
Provide example data and expected output and processing logic you want implemented.
Marking this as spam to avoid duplicates.
Please use the original thread .
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.