Hi guys,
I am having a problem with a simple code. I am trying to use the if then else syntax but I feel like the else part is not been taken into account by SAS Studio. Here is the code:
data WORK.HEART_plus;
set WORK.HEART_complete;
if AgeCDHdiag = . then cat_AgeCDHdiag=0;
else cat_AgeCDHdiag=1;
run;
The WORK.HEART_complete table comes from filtering the missing values of the smoking, weight, and cholesterol variables from the HEART table.
typo error -> you have the variable name wrong.
@luigipugliese wrote:
Hi guys,
I'm not a guy so I guess I shouldn't answer your question?
Check your log, there's likely a note about an variable not being initialized which points to a typo error. If not, post your full code and log.
@luigipugliese wrote:
Hi guys,
I am having a problem with a simple code. I am trying to use the if then else syntax but I feel like the else part is not been taken into account by SAS Studio. Here is the code:
data WORK.HEART_plus;
set WORK.HEART_complete;
if AgeCDHdiag = . then cat_AgeCDHdiag=0;
else cat_AgeCDHdiag=1;
run;
The WORK.HEART_complete table comes from filtering the missing values of the smoking, weight, and cholesterol variables from the HEART table.
what does it mean when a variable is uninitialized? I think that is the only relevant note from the LOG.
thanks in advance.
typo error -> you have the variable name wrong.
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!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.