If by 'specific' you mean that you exactly know the option's name then I prefer things like
%* display selected options on log ;
%put %sysfunc(getoption(linesize,keyword)) ;
%put %sysfunc(getoption(pagesize,keyword)) ;
If you change these options within a SAS session (be it foreground or background) temporarily, good practice is to do it somewhat like
%let _ls = %sysfunc(getoption(linesize,keyword)) ;
%let _ps = %sysfunc(getoption(pagesize,keyword)) ;
options linesize=200 pagesize=100 ; /* hypothetic values */
%* do some SAS things here ;
options &_ls &_ps ;
Alternatively you could use procedures OPTSAVE and OPTLOAD to front-end temporary modifications.
when wanting the value of system options, avoid typing with a macro like:
%macro sy(op) /des='get system option with keyword' ;
%sysfunc( getoption(&op, keyword))
%mend sy ;
%put %sy(ls) %sy(ps) %sy(sasautos);
becomes a concise and convenient way to check the value of an option (not much more than the option name itself !)
%let old_opts = %sy(mlogic) %sy(mprint) %sy(symbolgen) ;
provides a brief way to collect and store options before changing them, as you might want when you start some more macro development
learn the convenience of placing your macros in your sasautos folder and inserting your sasautos folder at the beginning of the SASAUTOS system option, with something like
option sasautos=( mymacros sasautos ) ;
in your autoexec.sas
I'm replying to your original question.
Using proc options to check multiple formats is just fine. The first way you presented it is correct and will work. You said it did not work? (Your second method will produce an error. Since you didn't have "option=" before "linesize, SAS trys to interpret "linesize" as another option for the procedure and fails.)
You can also add the option 'value' and you will get more information, e.g.
Now I know why it works for me and not you. You're running SAS 9.2m2 and I was using 9.3. At 9.2m2 you can only get information on one option at a time. At 9.3 there's more flexibility and you can even to this:
proc options option=(linesize pagesize);
But you can't do that at 9.2m2.
I didn't realize that until I saw your log which version you were using.