02-27-2018 08:18 PM
This should be straightforward because SAS dates are just formatted numbers so subtracting one from the other should give you the length of stay. However if you want something more precise you'll have to give us more details - check out this post for how to frame your question so we can help you better (in particular we'd need some sample data). https://communities.sas.com/t5/SAS-Support-Communities/How-to-ask-a-good-question-and-receive-a-fast...
02-27-2018 09:00 PM
If your dates are SAS dates then the SQL column expression should be
intck("day", admissionDate, dischargeDate) + 1 as lengthOfStay
+ 1 is assuming that a patient admitted and discharged on the same day will have a length of stay of 1 day.