Hi, I'm trying to use a macro to dynamically return a a text string that I would like proc sql to recognise as a variable to sum, however, it recognises as a character and fails. any ideas? %macro offsetnum(variable,startdate, enddate, plus); cats(&variable,intck('MONTH',datejul(&startdate),&enddate) + &plus) %mend; proc sql; create table as (select sum(%offsetnum("bal",startdate, enddate, 0)) as bal1 ; quit; I know that it resolves to "bal x" so I need to also strip the blank (in data step i used left, but sql is a bit more fussy) but I also know that even when the space has been removed I get the "ERROR: The SUM summary function requires a numeric argument" message. any ideas? Thanks
... View more