Hello i have the below data & the program. How come the number of observation in work.test3 has 4 observations instead of 3.
data dbp;
input id sbp dbp;
datalines;
2001 145 92
2002 130 87
2003 117 78
2004 135 85
2005 145 79
;
run;
data
work.test1
work.test2
work.test3;
set dbp;
if sbp gt 140 and dbp gt 90 then output work.test1;
if sbp gt 120 and dbp lt 80 then output work.test2;
else output work.test3;
run;
Thank you in advance for your help.
Akter
Hello
Add an else as shown below. It will solve your issue
data
work.test1
work.test2
work.test3;
set dbp;
if sbp gt 140 and dbp gt 90 then output work.test1;
else
if sbp gt 120 and dbp lt 80 then output work.test2;
else output work.test3;
run;
Hello
Add an else as shown below. It will solve your issue
data
work.test1
work.test2
work.test3;
set dbp;
if sbp gt 140 and dbp gt 90 then output work.test1;
else
if sbp gt 120 and dbp lt 80 then output work.test2;
else output work.test3;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: