0
votes

I am trying to run a perfectly executable SAS script through excel VBA, but it's throwing the error:

"SAS variable name e.g. '2018'n is not valid"

I am aware that SAS variables should not start with a numeric value, but I am feeding it as SAS literal using 'var-name'n, and it is perfectly running in SAS environment using EG 9.2. Therefore it should ideally run in VBA too as VBA is also running the script in a SAS environment.

I can resolve this issue by renaming the variable, but I just want to know the exact reason why it's giving an error in VBA.

Any help will be much appreciated.

Thanks in advance!

Mohit

1
Show the VBA code you are using to run the SAS code. Is the EG profile connecting to local or remote SAS server ?Richard
Show the value of the VALIDVARNAME option in both sessions. You can use PROC OPTIONS or the GETOPTION() function to see the current setting..Tom

1 Answers

0
votes

Variable names that start with a number are not valid unless you have set the VALIDVARNAME option to ANY.