Hi,
I am trying to write a code where the output has to displayed as per the footnotes which are given below.
(1) I = age >=55; II = non-smoking, no CAD;
(2) 1 = age>55,no CAD; 2= no death;
ID is the unique variable.
SLCT and SLCT1 are Char variables which are converted to Numeric.
Any help in suggesting where the code has to corrected is appreciated.
Thank you.
data step_01;
set incl;
by ID;
attrib SLCT_ SLCT1_length= 5;
/*Footnote (1)*/
if SLCT= 'age>=55' then SLCT_=I;
else if SLCT='non-smoking,no CAD' then SLCT_=II;
/*Footnote (2)*/
if SLCT1= 'age>55,no CAD' then SLCT1_= 1;
else if SLCT1='no death' then SLCT1_=2;
run;
Regards,
Nasya
You are creating variables but I am not sure of the connection to "footnotes". In SAS Footnote usually refers to a Footnote statement which places text after the output of a procedure such as:
Title "This is a title to place at the top of output"; Footnote "Only 5 observations were selected for printing"; proc print data=sashelp.class (obs=5); run; /* turn off title and footnote*/ title; footnote;
Since you do not show how you are creating any output other than a data set you will need to provide more example of what you want.
This statement assigns the value of the variable I to SLCT_. Is that the desired action?
if SLCT= 'age>=55' then SLCT_=I;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.