Hi Bill,
Yes, you can write macros which operate as functions. For example, suppose you need to compute the study day of a visit, and you have both the visit date and first day of study med (Day 1) on the record. The following macro can be called as a function:
%macro studyday (visdt, day1dt);
visdt - day1dt + (visdt >= day1dt);
%mend studyday;
It could be invoked in a DATA step like this:
data studydys;
set olddata;
studyday = %studyday(visdt, day1dt);
run;
Hope this helps,
Nancy
... View more