BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
Thanks, I'll try that.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 637 views
  • 0 likes
  • 2 in conversation