Thank you! Made changes to code. I still see that length statement is not applied. data heart1 (drop=AgeatDeath Deathcause); length Smoking_Status $ 17; set heart; where status = "Alive"; if AgeCHDdiag=. then delete; If 0 =< smoking <= 6 then Smoking_Status= "None (0–5)"; else If 6 =< smoking <= 15 then Smoking_Status = "Moderate (6–15)"; else If 16 =< smoking <= 25 then Smoking_Status = "Heavy (16–25)"; else If smoking gt 25 then Smoking_Status = "Very Heavy (>25)"; else Smoking_Statuser = "Error"; run;
... View more
Here is the code - data heart1 (drop=AgeatDeath Deathcause); length Smoking_Status $ 17; set heart; where status = "Alive"; if AgeCHDdiag=. then delete; If 0 =< smoking <= 6 then Smoking_Statuser = "None (0–5)"; else If 6 =< smoking <= 15 then Smoking_Statuser = "Moderate (6–15)"; else If 16 =< smoking <= 25 then Smoking_Statuser = "Heavy (16–25)"; else If smoking gt 25 then Smoking_Statuser = "Very Heavy (>25)"; else Smoking_Statuser = "Error"; run;
... View more
Used current SAS studio to execute the following program. Length statement was applied to set the length (17) to "Smoking_Status" in the "if statement" below However, still, the values for "Smoking_Status" are truncated (see below in the table attributes). I would appreciate it if you could help me figure this out. Thanks!
... View more
I have two programs - DATA A1; DO I=1 TO 10; X+1; OUTPUT; END; RUN; Created the data set as 2) DATA A2; DO I=1 TO 10; i+1; X+1; OUTPUT; END; RUN; created the data set as I would appreciate it if you could explain how i+1 statement works on the second program. Thanks!
... View more