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
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: