Programming the statistical procedures from SAS

Write Access Violation w PROC REG

Accepted Solution Solved
Reply
Super Contributor
Posts: 312
Accepted Solution

Write Access Violation w PROC REG

[ Edited ]

I am running a simple regression with the following code, with a data file, 21M in size, 4 columns (ID, date, amount, count), 300204 obs. I tested the code on a smaller size sample (2457 obs) and it ran smoothly. But with this larger sample (300204 obs), I got an error message after running about 23 hours. The message says:

sas.exe has stopped working.

A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

Then a button "close program".

 

proc printto log="D:\Analysis\30days.log";   /* to print log to a file */
run;
ods table parameterEstimates=ana30.logfile; /* to save coefficients */ PROC REG DATA=ana30.mydata; BY ID ; MODEL amount= count ; RUN;

Then in the windows event log, I saw 4 errors:

Critical SAS error:  Write Access Violation REG Exception occurred at (65a9f27)

Critical SAS error:  Write Access Violation REG Exception occurred at (1e49c0b)

Critical SAS error:  Write Access Violation REG Exception occurred at (1e49afa)

Critical SAS error:  Stack overflow detected REG Exception occurred at (4e849fc)

 

I have no idea which board to ask this question, and just try here and hope someone can give me some hints

 

Thank you very much!

 


Accepted Solutions
Solution
‎04-19-2016 09:41 PM
Grand Advisor
Posts: 16,897

Re: sas error :

Rick's answer is correct - most likely the QUIT is the issue.

 

proc printto log="D:\Analysis\30days.log";   /* to print log to a file */
run;

ods graphics off;
ods select parameterEstimates;
ods table parameterEstimates=ana30.logfile; /* to save coefficients */
PROC REG DATA=ana30.mydata;
   BY ID ;
   MODEL amount= count ;
RUN;
QUIT;

View solution in original post


All Replies
Grand Advisor
Posts: 16,897

Re: sas error :

What does your SAS log say?

 

Your data doesn't appear complex enough to cause any space issues...

 

24 hours also seems like way too long for a 300K file

Respected Advisor
Posts: 4,606

Re: sas error :

Similar thing happened to me and often goes away after restarting SAS. If it doesn't, you should open a ticket with SAS Tech Support.

PG
SAS Super FREQ
Posts: 3,310

Re: sas error :

I see a several problems with your code:

  1. If ODS GRAPHICS are on, this will produce a bunch of graphs.  Be sure to explicitly set ODS GRAPHICS OFF;
  2. Use ODS SELECT ParameterEstiamtes to suppress the other output tables.
  3. I am not familiar with the ODS TABLE statement. I do not see it in the documentation. I presume you meant to use ODS OUTPUT
  4. Because PROC REG is an interactive procedure, the PROC REG statement will not create the ODS OUTPUT until you type QUIT.  Use the QUIT stataement in place of the RUN statement to exit PROC REG.
Grand Advisor
Posts: 16,897

Re: sas error :

@Rick_SAS ODS Table is correct - and it can be used before proc. If you're also suppressing output then you have to use ODS output, so it's preferable to use ODS OUTPUT in general.

SAS Super FREQ
Posts: 3,310

Re: sas error :

As far as I can tell, ODS TABLE is not a documented statement.

Solution
‎04-19-2016 09:41 PM
Grand Advisor
Posts: 16,897

Re: sas error :

Rick's answer is correct - most likely the QUIT is the issue.

 

proc printto log="D:\Analysis\30days.log";   /* to print log to a file */
run;

ods graphics off;
ods select parameterEstimates;
ods table parameterEstimates=ana30.logfile; /* to save coefficients */
PROC REG DATA=ana30.mydata;
   BY ID ;
   MODEL amount= count ;
RUN;
QUIT;
Super Contributor
Posts: 312

Re: sas error :

Thank you for your replies and suggestions. I was doing something else so I did not follow up in time.

 

I googled and found the solution (hopefully) http://support.sas.com/kb/54/246.html

 

They have a hot fix and I just installed and followed their instructions.

 

I also use data from the work temporary library, not from the permanent library. Maybe this can be faster too.

 

I just output to the log, saving time to write log to the file (last time I got a message telling me log is full so I used this option). I forgot to clear the log last time before submitting the program.

 

Will see tomorrow if I have program again.

Super Contributor
Posts: 312

Re: sas error :

Thank you, . With your code, there was no error any more, and it ran much much faster.

 

Sorry that I did not come back to update in time. Was testing running SAS on a high performance computation facility (Linux).

One thing worthy to mention is, I tested my original program, which gave error on my windows7 PC, but it did not have any issue running on the HPC facility. And it finished much faster. I guess the HPC system has a much higher I/O (and of course faster CPU too).

Esteemed Advisor
Posts: 5,156

Re: Write Access Violation w PROC REG

Renamed to better specify the contents of the thread.

Data never sleeps
☑ This topic is SOLVED.

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

Discussion stats
  • 9 replies
  • 515 views
  • 0 likes
  • 5 in conversation