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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: