If you want to write code that does what INTCK does, that's cool. It's fun. Lots of ways to do this. However, when SAS provides a function, most likely it is more efficient than code we would write, plus INTCK doesn't care whether the date variable is seconds, minutes hours, days, etc. For example, if the login recorded at the hospital is at the minutes level, which would correspond to most sign-ins I've done at a clinic, then INTCK(HOURS,date1,date2) will work nicely. If you want to convert hours to days, just use the CEIL function; e.g., DAYS=CEIL(HOURS, Date1, date2)/24). That way you could have queue service time for walk-ins as well as hospital stay time in days.
... View more