BookmarkSubscribeRSS Feed
mnew
Calcite | Level 5
Experts:

If you only need to find out a few specific system options, what is the most efficient way?

I tried a couple ways and failed:
proc options option = pagesize option=linesize;
proc options options = pagesize linesize;

I studied the Help. The group = is certainly better than just proc options;
Any better ways?
Thank you!
the lazy beginner
12 REPLIES 12
piggy
Fluorite | Level 6
proc options;
run;
can be used to check all default options.

Proc options
group =errorHandling;
Run ;

can be used to check certain group of options;

proc options option = pagesize ;
run;

can be used to check single option.

However, I am beginner too. Waiting for real expert to answer your question.
Robert_Bardos
Fluorite | Level 6
If by 'specific' you mean that you exactly know the option's name then I prefer things like
[pre]
%* display selected options on log ;
%put %sysfunc(getoption(linesize,keyword)) ;
%put %sysfunc(getoption(pagesize,keyword)) ;
[/pre]
If you change these options within a SAS session (be it foreground or background) temporarily, good practice is to do it somewhat like
[pre]
%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 ;
[/pre]
Alternatively you could use procedures OPTSAVE and OPTLOAD to front-end temporary modifications.
mnew
Calcite | Level 5
Great suggestions! Also helped me to learn more about SAS macro. (I've only read briefly about the topic before.) Thank you!
Peter_C
Rhodochrosite | Level 12
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 ;
then
%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 !)
similarly
%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

good luck
peterC
mnew
Calcite | Level 5
Awesome. I'm going to file this one for the days when the word macro no longer intimidates me!
mnew
Calcite | Level 5
Thank you. There is so much to learn!
martha_sas
SAS Employee
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.

proc options option=pagesize option=linesize value;
run;
mnew
Calcite | Level 5
Thank you for the reply. I double-checked. Here is the log I got. For some reason, only the value for second option comes back.

1 proc options option = pagesize option=linesize;
2 run;

SAS (r) Proprietary Software Release 9.2 TS2M2

LINESIZE=96 Line size for SAS log and SAS procedure output
NOTE: PROCEDURE OPTIONS used (Total process time):

3 proc options option = pagesize option=linesize value;
4 run;

SAS (r) Proprietary Software Release 9.2 TS2M2

Option Value Information For SAS Option LINESIZE
Option Value: 96
Option Scope: DMS Process
How option value set: Unknown
NOTE: PROCEDURE OPTIONS used (Total process time):
martha_sas
SAS Employee
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.
mnew
Calcite | Level 5
I see. I didn't consider the possibility of version difference at all. Thank you.
Ksharp
Super User
There is a dictionary table (dictionary.options) which can do the same thing.
[pre]
proc sql;
select optname,setting
from dictionary.options
where optname in ('LINESIZE' 'PAGESIZE' 'COMPRESS');
quit;

[/pre]


Ksharp
mnew
Calcite | Level 5
Thank you. Tried and it worked nicely.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 1658 views
  • 0 likes
  • 6 in conversation