am working on the study day macro below but it gives an error in the log the program is a reference code as am new to clinical sas i was trying to calculate studyday by accepting 3 columns from 3 tables to be used to calculate the studyday... can u help me with this... requirement... thanks
SYMBOLGEN: Macro variable ENDC resolves to aestdtc
SYMBOLGEN: Macro variable ENDC resolves to aestdtc
ERROR: Required operator not found in expression: length(&endc)=10
ERROR: The macro STDYDATES will stop executing.
plz can anyone give a idea on how this statement can be resolved?
%macro stdydates(studyday=, endc=, refdate=);
%if &endc= '' %then &studyday=.;
%else %do;
%if length(&endc)=10 %then %do;
%if input(substr(&endc,1,10),yymmdd10.) < input(substr(&refdate,1,10),yymmdd10.)
%then &studyday=input(substr(&endc,1,10), yymmdd10.) -
input(substr(&refdate,1,10), yymmdd10.);
%else &studyday=input(substr(&endc,1,10), yymmdd10.) -
input(substr(&refdate,1,10), yymmdd10.) + 1;
%end;
%else %if length(&endc)=8 %then %do;
%if input(&endc, yymmdd8.)<input(substr(&refdate,1,10), yymmdd10.)
%then &studyday=input(&endc, yymmdd8.) - input(substr(&refdate,1,10),yymmdd10.);
%else &studyday=input(&endc, yymmdd8.) - input(substr(&refdate,1,10), yymmdd10.)+1;
%end;
%end;
%mend stdydates;
options mprint symbolgen;
%stdydates(studyday=ST,endc=aestdtc, refdate=rfstdtc);