On Wed, Jul 30, 2008 at 8:49 AM, Richard Van Dorn
> The only thing that distinguishes the outpatient from the inpatient
> services is if the date of service falls between the date of admission
> and the date of discharge. So in the prior example February 8th precedes
> the admission to the hospital on February 9th.
> Sorry that the example wasn't as clear as it could have been.
Since the DOA and DOD are numbers in SAS, they can be held in an array. A
DOW does the work. There could be one or two admissions within a ID, so a
2-cell array is used but it can be modified to any number of admissions.
set have (where = (not missing(DOA)));
array st _temporary_;
array en _temporary_;
count + 1;
st[count] = doa;
en[count] = dod;
if st le dos le en then continue;
else if st le dos le en then continue;
This is one another way.