Hi,
Could someone help me how can i get the difference b/w target and actual completion of dates.
As per the image first row will give me -18 days whereas, the rest isn't giving me any overdue days. Could you please help me how to get the days count when actual is overdue with target date.
For getting days i have used :
proc sort data = safety_act; by INSPECTION; run;
data sa_date_diff;
set safety_act;
by INSPECTION;
days = intck('dtday',ACTION_TARGET_COMPLETE,ACTION_ACTUAL_COMPLETE);
put days=;
run;
So in a data step, assign today's date and time to the variable ACTION_ACTUAL_COMPLETE if it is missing.
The output is correct. After row one, since there is no ACTION_ACTUAL_COMPLETE, the number of DAYS should be missing. How could the answer be anything else?
Yes, you are right.
I want to show the number of over due days from Target date something like 3 days if i consider 26th June to till date(today).
So in a data step, assign today's date and time to the variable ACTION_ACTUAL_COMPLETE if it is missing.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.