SAS macro ERROR 180-322: expression is invalid or used out of proper order
I am trying to use SAS Macro Language on my company SAS Server. The rest of the code (SAS-base) works fine, but there are no macros. Even a simple% let throws 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 checked the system parameters under tools and the "macro" parameter is set to 1.
Does anyone know how to work properly with macros?
Thank:)
source to share
I would look at the macro option by doing proc parameters:
proc options option=macro;
run;
The macro parameter must be set at the time of the SAS call. Therefore, you may need to check the configuration file used by your SAS session. In a SAS server, it can mean talking to a SAS administrator, as there can be many config files for different logical servers ....
I was able to reproduce your results on a SAS PC by specifying -nomacro during the call. I know a lot of people who hate the macro language, but not so many that they have actually turned it off. My log after disabling the macro:
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.
source to share