DATA Step, Macro, Functions and more

Date Comparison in a Macro

Reply
N/A
Posts: 0

Date Comparison in a Macro

Hi All:

I'm trying to compare two dates in a macro and I'm getting the error message:

ERROR: Required operator not found in expression: input("&enddate",yymmdd8.) < intnx('year',input("&startdate",yymmdd8.),0,'end')

The statement that's causing the error is this:

%if input("&enddate",yymmdd8.) < intnx('year',input(&startdate",yymmdd8.),0,'end') %then
%do;
...other stuff...

Here, enddate = 20090331. I've done comparisons like this in the past and have never had an error like this. I'm sure I'm overlooking something very basic.

Thanks,

T.M. Foy
Super Contributor
Super Contributor
Posts: 3,174

Re: Date Comparison in a Macro

Posted in reply to deleted_user
You will need to explore using the %SYSFUNC macro language function when you want to integrate SAS CALL functions into macro language coding.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Date Comparison in a Macro

Thanks, I'll try that.
Ask a Question
Discussion stats
  • 2 replies
  • 124 views
  • 0 likes
  • 2 in conversation