BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RichardDeVen
Barite | Level 11

Sample Program

options pagesize=max;
%put NOTE: PAGESIZE=%sysfunc(getoption(pagesize));

proc optsave out=work.sasoptions;
run; data _null_; set work.sasoptions; where optname='PAGESIZE'; put optname= optvalue=; run; proc optload data=work.sasoptions;
run; %put NOTE: PAGESIZE=%sysfunc(getoption(pagesize));

Log 

136  options pagesize=max;
137
138  %put NOTE: PAGESIZE=%sysfunc(getoption(pagesize));
NOTE: PAGESIZE=32767
139
140  proc optsave out=work.sasoptions ;run;

NOTE: The data set WORK.SASOPTIONS has 307 observations and 2 variables.
NOTE: PROCEDURE OPTSAVE used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


141
142  data _null_;
143    set work.sasoptions;
144    where optname='PAGESIZE';
145    put optname= optvalue=;
146  run;

OPTNAME=PAGESIZE OPTVALUE=32767
NOTE: There were 1 observations read from the data set WORK.SASOPTIONS.
      WHERE optname='PAGESIZE';
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


147
148  proc optload data=work.sasoptions;run;

NOTE: PROCEDURE OPTLOAD used (Total process time):
      real time           1.10 seconds
      cpu time            1.04 seconds

149
150  %put NOTE: PAGESIZE=%sysfunc(getoption(pagesize));
NOTE: PAGESIZE=55

The pagesize value in the save data set is clearly 32767. 

 

Why does OPTLOAD change it to 55?

1 ACCEPTED SOLUTION

Accepted Solutions
RichardDeVen
Barite | Level 11

Hi Tom: 

 

Turns out that ORIENTATION is the culprit.

Details

Changing the value of this option might result in changes to the values of the portable LINESIZE= and PAGESIZE= system options.

The order of the option values as retrieved by OPTLOAD determine the outcome.  ORIENTATION will overwrite prior retrieved LS and PS.

INFO: SYSSCPL=X64_10PRO SYSVLONG4=9.04.01M6P11072018
INFO: PAGESIZE=32767                               /* current PS */
INFO: LINESIZE=256                                 /* current LS */

log saved options - order retrieved affected by where clause
INFO: OPTNAME=LINESIZE OPTVALUE=256                /* set LS */
INFO: OPTNAME=ORIENTATION OPTVALUE=PORTRAIT        /* sets LS and PS tacitly */
INFO: OPTNAME=PAGESIZE OPTVALUE=32767              /* set PS */

optloaded options - order retrieved affected by where clause
INFO: PAGESIZE=32767                               /* last set PS */ 
INFO: LINESIZE=98                                  /* last set LS */ 

Is the output of this example code

options nosource nonotes;
options pagesize=max linesize=max;

%put INFO: &=SYSSCPL &=SYSVLONG4;
%put INFO: PAGESIZE=%sysfunc(getoption(pagesize));
%put INFO: LINESIZE=%sysfunc(getoption(linesize));

proc optsave out=work.sasoptions;
run;

data _null_;
  set work.sasoptions;
  where optname in ('LINESIZE' 'PAGESIZE' 'ORIENTATION');
  put 'INFO: ' optname= optvalue=;
run;

proc optload data=work.sasoptions;
  where optname in ('LINESIZE' 'PAGESIZE' 'ORIENTATION');
run;

%put INFO: PAGESIZE=%sysfunc(getoption(pagesize));
%put INFO: LINESIZE=%sysfunc(getoption(linesize));

 

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

Are you running on Windows?  It does not do it for me on Unix.

 

For me it seems to be reverting to some type of default value that is different than yours.  Also does it for LINESIZE.

1050  %put ps=%optval(pagesize) ls=%optval(linesize);
ps=100 ls=145
1051  proc optload data=save; run;

NOTE: PROCEDURE OPTLOAD used (Total process time):
      real time           12.07 seconds
      cpu time            1.15 seconds


1052  %put ps=%optval(pagesize) ls=%optval(linesize);
ps=41 ls=134

I wonder if there is a user preference somewhere that overrides it?  

Or just a Windows bug?

Tom
Super User Tom
Super User

So if you only reload the PAGESIZE and LINESIZE options it works.

So now just need to figure out which of the other 299 options is messing it up.

 

1077  %put ps=%optval(pagesize) ls=%optval(linesize);
ps=100 ls=145
1078  proc optload data=save(where=(optname in ('PAGESIZE','LINESIZE'))); run;

NOTE: PROCEDURE OPTLOAD used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


1079  %put ps=%optval(pagesize) ls=%optval(linesize);
ps=100 ls=145
RichardDeVen
Barite | Level 11

Hi Tom: 

 

Turns out that ORIENTATION is the culprit.

Details

Changing the value of this option might result in changes to the values of the portable LINESIZE= and PAGESIZE= system options.

The order of the option values as retrieved by OPTLOAD determine the outcome.  ORIENTATION will overwrite prior retrieved LS and PS.

INFO: SYSSCPL=X64_10PRO SYSVLONG4=9.04.01M6P11072018
INFO: PAGESIZE=32767                               /* current PS */
INFO: LINESIZE=256                                 /* current LS */

log saved options - order retrieved affected by where clause
INFO: OPTNAME=LINESIZE OPTVALUE=256                /* set LS */
INFO: OPTNAME=ORIENTATION OPTVALUE=PORTRAIT        /* sets LS and PS tacitly */
INFO: OPTNAME=PAGESIZE OPTVALUE=32767              /* set PS */

optloaded options - order retrieved affected by where clause
INFO: PAGESIZE=32767                               /* last set PS */ 
INFO: LINESIZE=98                                  /* last set LS */ 

Is the output of this example code

options nosource nonotes;
options pagesize=max linesize=max;

%put INFO: &=SYSSCPL &=SYSVLONG4;
%put INFO: PAGESIZE=%sysfunc(getoption(pagesize));
%put INFO: LINESIZE=%sysfunc(getoption(linesize));

proc optsave out=work.sasoptions;
run;

data _null_;
  set work.sasoptions;
  where optname in ('LINESIZE' 'PAGESIZE' 'ORIENTATION');
  put 'INFO: ' optname= optvalue=;
run;

proc optload data=work.sasoptions;
  where optname in ('LINESIZE' 'PAGESIZE' 'ORIENTATION');
run;

%put INFO: PAGESIZE=%sysfunc(getoption(pagesize));
%put INFO: LINESIZE=%sysfunc(getoption(linesize));

 

ChrisHemedinger
Community Manager

@RichardDeVen Nice sleuthing. SAS options nuances can be tricky to track down!

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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
  • 4 replies
  • 341 views
  • 3 likes
  • 3 in conversation