Hello,
I have two variables BEGIN and END in a dataset A, and Dataset B has a variable called DIAGNOSIS CODE. I would like to see if any value in the diagnosis code variable falls in the range between Begin and End variable.
Example:
Dataset A(Have) Dataset B(Have) Dataset C(want)
Begin End Diagnosis code Flag
1 3 5 2
7 10 2 17
16 24 11
17
Thanks for all your help!
Like this?
proc sql; select CODE as FLAG from HAVE1, HAVE2 where CODE between BEGIN and END;
Like this?
proc sql; select CODE as FLAG from HAVE1, HAVE2 where CODE between BEGIN and END;
Thanks very much!
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.