DATA Step, Macro, Functions and more

intck function not giving a blank

Reply
Contributor
Posts: 29

intck function not giving a blank

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

Trusted Advisor
Posts: 1,349

Re: intck function not giving a blank

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

Can you post your full code or log ?

Contributor
Posts: 29

Re: intck function not giving a blank

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. -##
Super User
Posts: 9,662

Re: intck function not giving a blank


options missing='.' ;


Super User
Posts: 6,927

Re: intck function not giving a blank

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 29

Re: intck function not giving a blank

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

Ask a Question
Discussion stats
  • 5 replies
  • 207 views
  • 0 likes
  • 4 in conversation