Death_SAS_Date = input(put(DEATH_DT, 8. -l), YYMMDD10.) - Index; Death_days = Death_SAS_Date - Index;
You're subtracting the index twice. You can literally copy and paste my previous code to get this right.
@Sujithpeta wrote:
My bad @Kurt_Bremser, I corrected the code as @Reeza posted
data M.Death; set M.Death; Death_SAS_Date = input(put(DEATH_DT, 8. -l), YYMMDD10.) - Index; Death_days = Death_SAS_Date - Index; run;
Death_SAS_Date still in the format of BEST12. and Death_days are also in the format of BEST12.
I corrected but it still gives the same output @Reeza
@Sujithpeta wrote:
@Reeza I tried the code but it's throwing error.
I also tried changing the YYMMDDN10. to YYMMDDN8. I had the same error.
Please copy and paste the SASLOG as text (not as an image) into the {i} window.
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.