BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
vnreddy
Quartz | Level 8

vnreddy_0-1688030355152.png

 

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;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

So in a data step, assign today's date and time to the variable ACTION_ACTUAL_COMPLETE if it is missing.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
vnreddy
Quartz | Level 8

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). 

PaigeMiller
Diamond | Level 26

So in a data step, assign today's date and time to the variable ACTION_ACTUAL_COMPLETE if it is missing.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 395 views
  • 1 like
  • 2 in conversation