Yes.
[pre]
Call symput('qtrdata',%substr(&qtr,1,7));
[/pre]
will resolve to:
[pre]
Call symput('qtrdata',2009-12);
[/pre]
So 2009-12 = 1997.
SAS is doing an implicit numeric to char conversion and assigning '1997' to QTRDATA.
enclose your value into double quotes, like this
[pre]
Call symput('qtrdata',"%substr(&qtr,1,7)");
[/pre]
or
switch the macro function %substr to its datastep equivalent, and use double quotes arround QTR
[pre]
Call symput('qtrdata',substr("&qtr",1,7));
[/pre]
Cheers from Portugal
Daniel Santos @
www.cgd.pt