/*Calculating timeframe between treatment and diagnosis*/
data CDCSTVST.CDC_Site_Timeframe;
set CDCSTVST.CDC_Site_SAS_Positive_Only;
days=(INTCK('days', colldate, Treatment_Date));
put days=;
run;
I am using the code above to calculate days between diagnosis and treatment. it is giving me . (blank) in days column.
please help
If I am understanding your reply above, you have a variable named TREATMENT_DATE1, but your code refers to TREATMENT_DATE which doesn't exist. Could that be it?
Please show us the LOG for this data step code (not just the ERROR or WARNING messages) by pasting the log as text into the window that appears when you click on the {i} icon.
A few things to consider and examine to why that's happening.
1. check whether your date variables are character or numeric. A proc contents will give you this information. If it is character. convert to numeric in a new assignment variable.
2. Looking at proc contents you could also determine whether your date variables are Datetime(number of seconds from jan 1,1960) values or date values(number of days from jan 1,1960) by looking at the format. If it is datetime use 'dtdays' interval.
3. Check if there are missing values.
Ok great. So it appears both are numeric SAS dates that are formatted as mmddyy10. Have you checked for missing values? You could use a filter for missing and count. Determine the ratio of missing to non missing, and missing to total count.
Also @Dhana18 . Your proc contents report has Treatment_Date1 with 1 as suffix to the name while your code has Treatment_Date
days=(INTCK('days', colldate, Treatment_Date));
Is that a typo?
If I am understanding your reply above, you have a variable named TREATMENT_DATE1, but your code refers to TREATMENT_DATE which doesn't exist. Could that be it?
Please show us the LOG for this data step code (not just the ERROR or WARNING messages) by pasting the log as text into the window that appears when you click on the {i} icon.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.