Hi All,
whenn I run this code, it works fine:
proc optsave out= work.default_options;
run;
data _null_;
set work.default_options;
call symputx(compress("optname"||_N_) , compress(optname));
run;
%MACRO do_it;
data append_set ;
length optionsname optionswert $100.;
%DO i=1 %TO &anz_opts. ;
optionsname = "&&optname&i..";
optionswert = getoption("&&optname&i..");
output;
%END;
run;
%mend;
%do_it;However, when I specify a return value option (e.g.: "defaultvalue") as a second argument in the getopiton function:
proc optsave out= work.default_options;
run;
data _null_;
set work.default_options;
call symputx(compress("optname"||_N_) , compress(optname));
run;
%MACRO do_it;
data append_set ;
length optionsname optionswert $100.;
%DO i=1 %TO &anz_opts. ;
optionsname = "&&optname&i..";
optionswert = getoption("&&optname&i.." ,DEFAULTVALUE );
output;
%END;
run;
%mend;
%do_it;I get a note stating that "Variable DEFAULTVALUE is uninitialized."
As far as I understand the help documentation on "getoption" it should be possible to add a second argument to the function.
Am I missing something?
Have you tried putting quotes around DEFAULTVALUE?
I can't test it myself for a few hours,but that's often how a DATA step determines that a word is not a variable name..
Have you tried putting quotes around DEFAULTVALUE?
I can't test it myself for a few hours,but that's often how a DATA step determines that a word is not a variable name..
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.