I have a data set with many sas-date variables that represent dates on which certain events occured for each observation. If the event did not occur, the date variables are missing.
To count how many of the events occurred (and create a new variable with this information), I would simply use the N( var1, var2, varN...) function in a data step.
Now, if I need to count how many of these events occurred (i.e., how many variables have non-missing values) within a date range created by other variables, can I use the N function nested somehow in an if-then string? Is there another applicable function?
The data looks like this if my wording wasn't clear:
startdate enddate event1 event2 event3
4/12/98 5/15/98 4/14/98 5/26/98 4/30/98
And I need to find how many events happened between the startdate and enddate.
Thanks