Hi Everyone,
Is there a way to get the value of an option into a dataset.\ ?
for example if i run the below statement it prints the value of option to the log.
but is there a way to get this value in a dataset so that i can check if mprint option is set to Mprint or nomprint?
proc options option=mprint; run;
Macro variables are more common:
/* Save the value of the MPRINT system option */
%let mprint_option = %sysfunc(getoption(MPRINT));
@NN wrote:
Hi Everyone,
Is there a way to get the value of an option into a dataset.\ ?for example if i run the below statement it prints the value of option to the log.
but is there a way to get this value in a dataset so that i can check if mprint option is set to Mprint or nomprint?
proc options option=mprint; run;
You can use the DMOPTSAVE command with a data set to save the current settings of all options to a data set such as Work.myopts in the Display Manager. Not sure about other interfaces like Enterprise Guide or SAS Studio.
How you issue the command depends on your system.
You could then search for the name of the option, Optname and Optvalue. The on/off type options like MPRINT have values of "0" (off) or "1" (on). The option values are character because many of the system options like FMTSEARCH can have character values.
Macro variables are more common:
/* Save the value of the MPRINT system option */
%let mprint_option = %sysfunc(getoption(MPRINT));
@NN wrote:
Hi Everyone,
Is there a way to get the value of an option into a dataset.\ ?for example if i run the below statement it prints the value of option to the log.
but is there a way to get this value in a dataset so that i can check if mprint option is set to Mprint or nomprint?
proc options option=mprint; run;
If you ever need to reset that option back to it's original value, you could use this macro (inspired by @SASJedi ) : https://core.sasjs.io/mp__resetoption_8sas.html
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.