Help using Base SAS procedures

Simple fix for standard PROC MEANS procedure issue?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Simple fix for standard PROC MEANS procedure issue?

I am a new SAS user and have spent a large amount of time on a problem that I think has a simple explanation. I'm wondering if anyone has any ideas I can explore.
 
I am trying to run a (very simple!) PROC MEANS procedure:
 
PROC MEANS DATA=merge.FullData2;
VAR C_PQLpTot;
RUN;
 
And I get this message:
 
NOTE: The SAS System stopped processing this step because of errors.
 
C_PQLpTot is a new variable I created that sums survey scores from the original imported data. Subjects answered three questions using a score of 0-4 and I applied code to transform 0-4 (0=100; 1=75; 2=50; 3=25; and 4=0) and then average their responses for a score between 0-100.
 
I have tried running PROC MEANS on different numeric variables in my dataset (both newly created variables and variables that were imported with the original data set) and get the same error.  
 
I am sure there is a simple fix for this because it is so straightforward, but I can't seem to figure it out! Thanks in advance for your help.
 
 
 

Accepted Solutions
Solution
‎11-03-2017 04:20 PM
Super User
Super User
Posts: 8,120

Re: Simple fix for standard PROC MEANS procedure issue?

Are you modifying the search paths for templates in your code? Have you actually been creating you own templates for ODS?
Open a ticket with SAS support. They should be the best place to get detailed support. They can work with you on what to test and probably will be able to fix it without a full install.

View solution in original post


All Replies
PROC Star
Posts: 1,283

Re: Simple fix for standard PROC MEANS procedure issue?

Please post your full log Smiley Happy

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

Hi Draycut,

 

This is what appears in the log in full after I try to run:


202  PROC MEANS DATA=merge.FullData2;
203  VAR C_PQLpTot;
204  RUN;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 423 observations read from the data set MERGE.FULLDATA2.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

PROC Star
Posts: 1,283

Re: Simple fix for standard PROC MEANS procedure issue?

I bet there is an error message in red in your log as well?

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

Unfortunately not - usually it will say something that directs me to the problem area but I just get the one error message. Here is part of the log from my previous coding to give a bit more context (the first part is the reverse coding I talked about, and it worked fine):

 

357
358  DATA merge.FullData2;
359      SET merge.FullData2;
360      ARRAY new (3) C_PedsQLC_P01 - C_PedsQLC_P03;
361      ARRAY old (3) C_PedsQLC_P1 - C_PedsQLC_P3;
362      Do i=1 to 3;
363          if old(i)=0 then new(i)=100;
364              else if old(i)=1 then new(i)=75;
365              else if old(i)=2 then new(i)=50;
366              else if old(i)=3 then new(i)=25;
367              else if old(i)=4 then new(i)=0;
368          end;
369          drop i;
370  C_PQLpNum = N(of C_PedsQLC_P01 C_PedsQLC_P02 C_PedsQLC_P03);
371  If C_PQLpNum GE 2 then C_PQLpTot = sum(C_PedsQLC_P01,C_PedsQLC_P02,C_PedsQLC_P03)/C_PQLpNum;
372  RUN;

NOTE: There were 423 observations read from the data set MERGE.FULLDATA2.
NOTE: The data set MERGE.FULLDATA2 has 423 observations and 261 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.03 seconds


373
374  /*Coding for MASC-10*/
375  PROC MEANS DATA=merge.FullData2;
376  VAR C_PQLpTot;
377  RUN;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 423 observations read from the data set MERGE.FULLDATA2.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

 

Super User
Posts: 23,771

Re: Simple fix for standard PROC MEANS procedure issue?

358  DATA merge.FullData2;
359      SET merge.FullData2;

 

You shouldn't code like that, it's a good way to destroy your data. 

 

PROC MEANS should run. After the data step, but before PROC MEANS can you add a proc contents and show the output?

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

As I said, I'm a new SAS user. I've changed the coding throughout so that SET statements create a new data set that is a modified version of the data set in the DATA statement.

 

I ran PROC contents (see bolded section):

 

DATA merge.FullData6;
 SET merge.FullData5;
 ARRAY new (3) C_PedsQLC_P01 - C_PedsQLC_P03;
 ARRAY old (3) C_PedsQLC_P1 - C_PedsQLC_P3;
 Do i=1 to 3;
  if old(i)=0 then new(i)=100;
   else if old(i)=1 then new(i)=75;
   else if old(i)=2 then new(i)=50;
   else if old(i)=3 then new(i)=25;
   else if old(i)=4 then new(i)=0;
  end;
  drop i;
C_PQLpNum = N(of C_PedsQLC_P01 C_PedsQLC_P02 C_PedsQLC_P03);
If C_PQLpNum GE 2 then C_PQLpTot = sum(C_PedsQLC_P01,C_PedsQLC_P02,C_PedsQLC_P03)/C_PQLpNum;
RUN;

 

PROC CONTENTS DATA=merge.FullData6;
RUN;

 

PROC MEANS DATA=merge.FullData6;
VAR C_PQLpTot;
RUN;

 

And received this error (again, see bold):

 

169
170  PROC CONTENTS DATA=merge.FullData6;
171  RUN;

ERROR: Unable to restore 'Base.Contents.Attributes' from template store!
NOTE: PROCEDURE CONTENTS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

NOTE: The SAS System stopped processing this step because of errors.
172


173  PROC MEANS DATA=merge.FullData6;
174  VAR C_PQLpTot;
175  RUN;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 423 observations read from the data set MERGE.FULLDATA6.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

 

 

Super User
Posts: 23,771

Re: Simple fix for standard PROC MEANS procedure issue?

 

You seem to have some other issues. have you tried restarting your computer and SAS?

 

If not, you may need to check if your installation is correct, something has clearly messed up your settings.

 

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

I have restarted my computer and SAS, same issue remains.
Super User
Super User
Posts: 9,599

Re: Simple fix for standard PROC MEANS procedure issue?

Not sure if this will affect it, but call you library anything other than SAS reserved words, in this case "merge" is a reserved word.  This is very bad form, and can cause issues all over the place.  So call you library something else then try it (probably best in a new session) and see if that changes it.  Also please avoid coding ALL IN CAPITALS (or mixed case), as it makes code hard to read.

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

Thank you - this is helpful going forward in any case. I replaced 'merge' with 'alldata' to avoid use of a reserved word and will avoid CAPS going forward. Unfortunately still having the same issue with my current coding after these changes.
Super User
Super User
Posts: 8,120

Re: Simple fix for standard PROC MEANS procedure issue?

Sounds like you are having trouble with ODS.  Can you produce any output?  Can run the PROC MEANS with the NOPRINT option and OUTPUT statement so that are not generating any printed output and instead are just generating a new dataset.

 

Your SASUSER profile might be locked or corrupted.

Your WORK directory might be full.

Or worse something might be messed up with the SAS installation that is causing the error about the ODS template.

Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

Thanks Tom. My work directory is not full and I have never seen any errors related to my SAS user profile. When I first started there was an error related to the ODS template (I can't remember what it was or how I fixed it at the time). I have tried everything else suggested here, so I am wondering if reinstallation of SAS would be the next step.
Solution
‎11-03-2017 04:20 PM
Super User
Super User
Posts: 8,120

Re: Simple fix for standard PROC MEANS procedure issue?

Are you modifying the search paths for templates in your code? Have you actually been creating you own templates for ODS?
Open a ticket with SAS support. They should be the best place to get detailed support. They can work with you on what to test and probably will be able to fix it without a full install.
Occasional Contributor
Posts: 9

Re: Simple fix for standard PROC MEANS procedure issue?

Okay - thank you. I haven't modified any paths or created any templates. I'll open a ticket and go from there. Thanks again for your help!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 16 replies
  • 217 views
  • 0 likes
  • 5 in conversation