BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

From my log (again - Windows 10, SAS/STAT 14.1)

 

42   PROC FREQ data=counts;
43
44   WEIGHT count;
45
46   EXACT RELRISK RISKDIFF;
47
48
49
50   TABLE trt*response/riskdiff;
51
52   ods output RelRisk1ExactCL=relrisk;
53
54   ods output RiskDiffCol1=riskdiff;
55
56   RUN;

NOTE: Writing HTML Body file: sashtml1.htm
WARNING: Computing exact confidence limits for this problem may require much time and memory.
         Press the system interrupt key to terminate exact computations.
NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables.
NOTE: The data set WORK.RELRISK has 9 observations and 5 variables.
NOTE: There were 4 observations read from the data set WORK.COUNTS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           27.77 seconds
      cpu time            27.34 seconds

Again, under 30 seconds.  At least the log gives a warning about time and memory.  This may be a case where you don't have adequate memory set aside for the exact algorithm to enumerate possible outcomes with fixed marginal totals.

 

SteveDenham

View solution in original post

14 REPLIES 14
SteveDenham
Jade | Level 19

This may be as simple as forgetting the semi-colon on your run; statement.

 

SteveDenham

Anki9
Calcite | Level 5

I have a semi-colon on my run; statement.

PaigeMiller
Diamond | Level 26

Show us the full code of your PROC FREQ. Since the dataset has only 4 observations, please show us the data as well.

--
Paige Miller
Anki9
Calcite | Level 5
DATA COUNTS; input TRT RESPONSE COUNT;
cards;
1 1 12
1 2 2
2 1 7
2 2 9
;

ODS select none;

PROC FREQ ;
WEIGHT COUNT;
EXACT RELRISK RISKDIFF;
TABLE TRT*RESPONSE/riskdiff;
ods output RelRisk1ExactCL=relrisk;
ods output RiskDiffCol1=riskdiff;
RUN;

ODS select all;
PaigeMiller
Diamond | Level 26

I don't know why it is taking so long. Your code runs PROC FREQ in under 5 seconds on my computer.

--
Paige Miller
Kurt_Bremser
Super User
 74         DATA COUNTS; input TRT RESPONSE COUNT;
 75         cards;
 
 NOTE: The data set WORK.COUNTS has 4 observations and 3 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 80         ;
 81         
 82         ODS select none;
 83         
 84         PROC FREQ ;
 85         WEIGHT COUNT;
 86         EXACT RELRISK RISKDIFF;
 87         TABLE TRT*RESPONSE/riskdiff;
 88         ods output RelRisk1ExactCL=relrisk;
 89         ods output RiskDiffCol1=riskdiff;
 90         RUN;
 
 NOTE: The default method for EXACT RELRISK is now METHOD=SCORE. To use the previous default method (in SAS/STAT 14.2 and earlier 
       releases), you can specify EXACT RELRISK(METHOD=NOSCORE).
 NOTE: The default method for EXACT RISKDIFF is now METHOD=SCORE. To use the previous default method (in SAS/STAT 14.2 and earlier 
       releases), you can specify EXACT RISKDIFF(METHOD=NOSCORE).
 NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables.
 NOTE: The data set WORK.RELRISK has 9 observations and 5 variables.
 NOTE: There were 4 observations read from the data set WORK.COUNTS.
 NOTE:  Verwendet wurde: PROZEDUR FREQ - (Gesamtverarbeitungszeit):
       real time           3.64 seconds
       cpu time            3.61 seconds

University Edition on a 2015 MacBook Pro.

SteveDenham
Jade | Level 19

Here is my time on this one (Windows 10, SAS/STAT 14.1)

1    DATA COUNTS; input TRT RESPONSE COUNT;
2    cards;

NOTE: The data set WORK.COUNTS has 4 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


7    ;
8
9    ODS select none;
10
11   PROC FREQ ;
12   WEIGHT COUNT;
13   EXACT RELRISK RISKDIFF;
14   TABLE TRT*RESPONSE/riskdiff;
15   ods output RelRisk1ExactCL=relrisk;
NOTE: Writing HTML Body file: sashtml.htm
16   ods output RiskDiffCol1=riskdiff;
17   RUN;

NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables.
NOTE: The data set WORK.RELRISK has 9 observations and 5 variables.
NOTE: There were 4 observations read from the data set WORK.COUNTS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.98 seconds
      cpu time            0.70 seconds


18
19   ODS select all;

Less than a second in total real time.  That is why I suspect what @ballardw came up with.

 

SteveDenham

Reeza
Super User
Restart SAS and see if the problem persists. If it does, restart SAS again and try the most basic code (example below) and see if it works.

proc means data=sashelp.class;run;

Anki9
Calcite | Level 5

Anki9
 

my dataset:

 

trt       response     count

1         1                   5

1          2                296

2          1                 2

2           2               150

 

all 3 variables are format best12.

 

my procedure is below which is running forever:

ODS select none;

PROC FREQ data=counts;

WEIGHT count;

EXACT RELRISK RISKDIFF;

 

TABLE trt*response/riskdiff;

ods output RelRisk1ExactCL=relrisk;

ods output RiskDiffCol1=riskdiff;

RUN;

;

ODS select all;

 

  

 

 

 

Tom
Super User Tom
Super User

So you are not just doing simple counts.  You have asked for it to do exact statistical calculations.

You might want to share your data with SAS support and see if your particular data combination is confusing that algorithm and putting into some type of infinite loop.

SteveDenham
Jade | Level 19

From my log (again - Windows 10, SAS/STAT 14.1)

 

42   PROC FREQ data=counts;
43
44   WEIGHT count;
45
46   EXACT RELRISK RISKDIFF;
47
48
49
50   TABLE trt*response/riskdiff;
51
52   ods output RelRisk1ExactCL=relrisk;
53
54   ods output RiskDiffCol1=riskdiff;
55
56   RUN;

NOTE: Writing HTML Body file: sashtml1.htm
WARNING: Computing exact confidence limits for this problem may require much time and memory.
         Press the system interrupt key to terminate exact computations.
NOTE: The data set WORK.RISKDIFF has 4 observations and 9 variables.
NOTE: The data set WORK.RELRISK has 9 observations and 5 variables.
NOTE: There were 4 observations read from the data set WORK.COUNTS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           27.77 seconds
      cpu time            27.34 seconds

Again, under 30 seconds.  At least the log gives a warning about time and memory.  This may be a case where you don't have adequate memory set aside for the exact algorithm to enumerate possible outcomes with fixed marginal totals.

 

SteveDenham

Anki9
Calcite | Level 5
Thank you so much for your quick solution.
PaigeMiller
Diamond | Level 26

Or, you don't even have a RUN; statement, this would cause the appearance of "running forever".

--
Paige Miller
ballardw
Super User

@PaigeMiller wrote:

Or, you don't even have a RUN; statement, this would cause the appearance of "running forever".


Or the code has the RUN; but was not submitted such as highlighting and submitting only the lines above the Run;

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 14 replies
  • 2451 views
  • 4 likes
  • 7 in conversation