Reputation: 41
I'm trying to use SAS macro language on my company's SAS Server. The rest of the (SAS-base) code works fine, but macros don't. Even a simple %let causes an error (this is the first line in the program):
5789 %let pgm = XXX ;
-
180
ERROR 180-322: Statement is not valid or it is used out of proper order
I have checked the system options under tools and the 'macro' option is set to 1.
Anybody know how to get macros working properly?
Thanks :)
Upvotes: 4
Views: 5147
Reputation: 6378
I would check the macro option by running proc options:
proc options option=macro;
run;
The macro option needs to be set during SAS invocation. So you may need to check the config file used by your SAS session. In server SAS, could mean talking with your SAS admin as there may be a plethora of config files for different logical servers....
I was able to replicate your results in PC SAS by specifying -nomacro during invocation. I've known plenty of people who hate the macro language, but never so much that they actually turn it off. My log after turning off the macro language is:
1 proc options option=macro;
2 run;
SAS (r) Proprietary Software Release 9.3 TS1M2
NOMACRO Do not allow use of SAS macro facility
3
4 %let x=1;
-
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
Upvotes: 2