short answer: You can just remove the quote marks.
Macro variables are all about text substitution. It's a good idea to look at the value of your macro variables.
Below log shows that your macro variable Q_START will resolve to valid SAS code.
1 %let q_start= intnx('quarter',date(),-1);
2 %put &=q_start ;
Q_START=intnx('quarter',date(),-1)
In a DATA step with no macro code, you could code:
data tmp;
set safdata.sf;
where sampdate ge intnx('quarter',date(),-1) ;
run;
So you could code the same step using your macro variable like:
data tmp;
set safdata.sf;
where sampdate ge &q_start;
run;
SampDate is a numeric variable, storing a SAS date (number of days since Jan 1, 1960). The expression intnx('quarter',date(),-1) will return a numeric value (SAS date for the date that is the start of the prior quarter).
Yes, you could use &q_start in PROC SQL. You could use it anywhere you would like to insert the code intnx('quarter',date(),-1).
... View more