BookmarkSubscribeRSS Feed
hellohere
Pyrite | Level 9

I am running some codes repeatedly. It was OK. Somehow somewhere it pops out a warning

" Unable to restore 'Stat.Reg.NObs' from template store!“.

 

Anyone knows how to deal with this? I donot like to reboot the SAS, and too much need to redone. 

 

16203  %put "between &stind.+&stoff. and &endind.-&endrange.";
"between 5050+50 and 5583-40"
16204              ods exclude all;
16205              ods output ParameterEstimates = _index_avg_parms;
16206                  proc reg data=&ds.(where=(ind between &stind.+&stoff. and &endind.-&endrange.));
16207                      by tick;
16208                      model _ret_t=ind;
16209                  run;

ERROR: Unable to restore 'Stat.Reg.NObs' from template store!
NOTE: The SAS System stopped processing this step because of errors.
WARNING: Output 'ParameterEstimates' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also,
         verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that the
         NOPRINT option is not used.
NOTE: PROCEDURE REG used (Total process time):
      real time           0.07 seconds
      cpu time            0.03 seconds

16209!                     quit;
16210              ods exclude none;

 

6 REPLIES 6
Tom
Super User Tom
Super User

Looks like it is probably related to this issue with SAS Statistical Graphics settings.

https://support.sas.com/kb/67/210.html

 

Either turn off Stat Graphics or fix the paths used by it.

Rick_SAS
SAS Super FREQ

It looks like SAS cannot load a standard ODS template (for the NOBS tables).  Have you been modifying templates or changing the path for templates?
Please run the following statement and post the result:

ods path show;

@WarrenKuhfeld shows how to correctly modify templates in the blog article, "A deeper dive into item stores."

After we see your ODS path, we can probably figure out what is wrong. The fix might be a simpe as 

 

ods path reset;

 

Ksharp
Super User

I noticed that you have WHERE condition :

 proc reg data=&ds.(where=(ind between &stind.+&stoff. and &endind.-&endrange.));

Maybe That is where reason from .

When You add IF or WHERE condition ,that would lead to an empty dataset ,and that empty dataset would generate this WARNING , I think.

So I suggest you to write some code to check this dataset is empty or have enough obs to do PROC REG. Like:

data _ds;
 set &ds.(where=(ind between &stind.+&stoff. and &endind.-&endrange.));
run;

%let dsid=%sysfunc(open(_ds));
%let nobs=%sysfunc(attrn(&dsid,nlobs));
%let dsid=%sysfunc(close(&dsid));

%put &=nobs. ;

%if &nobs ne 0 %then %do;
ods exclude all;
ods output ParameterEstimates = _index_avg_parms;
    proc reg data=_ds;
        by tick;
        model _ret_t=ind;
    run;
%end;
Rick_SAS
SAS Super FREQ

@Ksharp If the data contained no observations, the OP would get a different ERROR:

ods exclude all;
ods output ParameterEstimates = _index_avg_parms;
proc reg data=sashelp.class(where=(Age>100));
   model weight=height;
run;
quit;
ods exclude none;

ERROR: No valid observations are found.

Ksharp
Super User

@Rick_SAS 

That is what I suggested. I meet such kind of problem before.

The reason why I suggest this code is that I  notice there is a WARNING msg under ERROR, that WARNING would appeared if the data is not good enough to fit this model.

 

Maybe this data is not suited for PROC REG. For example, this dataset has only one or two obs ,that is not enough to fit a REG model. 

%if &nobs > 10 %then %do;

That might suppress these ERROR/WARNING message.

Just could give it a try  I think.

 

 

Rick_SAS
SAS Super FREQ

If you've solved the problem, please select a correct answer and close the thread. If you still need help, please update the thread.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 404 views
  • 1 like
  • 4 in conversation