In the below code I get as error the one declared in the title. Due to the fact that the option validvarname=any is used, I would expect that the space in the variable should not cause an error in the proc freq ouput. Please, share what I'm missing
%do j=1 %to &nclass;
options validvarname=any;
proc freq data=&train noprint;
tables &var / out="_&var2.&j"n (drop=count) missing;
where &target=&j;
run;
%end j;
MPRINT(NB): proc freq data=move.language_det_train noprint;
SYMBOLGEN: Macro variable VAR resolves to "rank_ a"n SYMBOLGEN: Macro variable VAR2 resolves to rank_ a
SYMBOLGEN: Macro variable J resolves to 1
ERROR: The value '_RANK_ A1'n is not a valid SAS na
Why do you want a blank in a dataset name? Just remove it from &var2, and you can also remove the ".."n for the dataset name. It will REALLY make your future work easier.
If you insist on making your life miserable, use
options validmemname=extend;
Why do you want a blank in a dataset name? Just remove it from &var2, and you can also remove the ".."n for the dataset name. It will REALLY make your future work easier.
If you insist on making your life miserable, use
options validmemname=extend;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.