10-05-2017 05:33 AM - edited 10-05-2017 05:34 AM
I came upon a very curious problem:
I have a code in which I use name literals:
data "dataset mit leerzeichen"n; set sashelp.class; "variable mit leerzeichen"n = 1; run;
Now, when I run the above code in a interactive EG-Session, it works perfectly fine, i.e. no errors or warnings.
However, when I run the exact same code in Batch-Mode, I get the following ERROR MESSAGE:
ERROR: The name variable mit leerzeichen is not a valid SAS name.
Thanks in advance for any helpful pointing into the direction of solving this issue.
10-05-2017 06:13 AM
Try putting the following two options statements at the start of your code
options validmemname=extend; options validvarname=any; data "dataset mit leerzeichen"n; set sashelp.class; "variable mit leerzeichen"n = 1; run;
I can only assume you're using different autoexecs when running in batch and interactive with one containing the options and one not.
10-05-2017 11:49 AM - edited 10-05-2017 11:50 AM
Hello Mr. Brooks,
thank you for your advice. It worked!
I do have a follow-up question, however:
Do you know how to output the system options into a SAS data set? I only get them into the LOG, when executing this code:
PROC OPTIONS; RUN;
As a workaround one could of course divert the log with PROC PRINTTO:
filename divlog "/pathname/logdiverted.txt"; PROC PRINTTO LOG=divlog; run; PROC OPTIONS ; RUN;
However, I end up having a file on which I then would have to further work on.
10-05-2017 01:29 PM
You can use Proc Optsave for that i.e.
proc optsave out=opts; run;
and reload the options with
Proc optload data=opts;
if you need to make option settings temporarily and then restore them (as often as needed).
Need further help from the community? Please ask a new question.