BookmarkSubscribeRSS Feed
GenDemo
Quartz | Level 8

Hi All

 

So this is a bit of a wierd occurance. I am used to the intck function returning a missing value if one of the two dates are missing. But in an excersice I'm busy with, it returns a zero. I can't understand why. I moked up a little dummy data set as well to test, and then it returns a missing value.

 TAT = intck('minute', FIRST_APP_SUBMISSION_DATE, First_Action_Datetime);

 Capture.PNG

 

both variables are datetime22.3

I'd really appreciate some insight.

 

GD

5 REPLIES 5
Shmuel
Garnet | Level 18

Do you have a RETAIN on TAT ? or maybe some other statement that damage TAT value ?

Can you post your full code or log ?

GenDemo
Quartz | Level 8
Hi

Unfortunately, I can't really post the code due to risk of sensitive
information or IP. No I don't have a retain function on TAT. I'll check
again when I am back in the office on Monday.

GD

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Ksharp
Super User

options missing='.' ;


Kurt_Bremser
Super User

You should have a

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).

in your log that points to the intck call. If not, then the missing value was somehow "calculated away" before that.

If the NOTE is there, then you might have options missing set to a non-default value, or TAT was manipulated after the function call. This could even happen by TAT being present in a dataset where you don't expect it.

GenDemo
Quartz | Level 8

*facepalm* sorry guys....

I did something idiotic....just after the calculation I reset the TAT variable to 0 if its missing...

 

TAT = intck('minute', FIRST_APP_SUBMISSION_DATE, First_Action_Datetime);

ind_2pm = (timepart(FIRST_APP_SUBMISSION_DATE) <='14:00:00't);

if TAT < 0 then do;

neg_TAT = TAT;

TAT = 0;

end;

 

thnx again...

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
  • 5 replies
  • 3141 views
  • 0 likes
  • 4 in conversation