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

Hi, 

 

I've a message error and i don't find the cause, I think maybe it's some configuration. I'm doing a proc reg and i need to have the residuals in a dataset. But the first time i run the program the dataset 'prevrest' is not generated and the second time i run the program, i see the dataset in work librery but when i try to open i have the message of the picture. 

I found here another post about the problem but the solution was 'restart' the pc and i tried that but the problem persists.

 

The problem is with SAS 9.4, I have executed exactly the same code in entreprise guide and that works fine.

 

Somebody could help me ? 

 

Thanks very much !

Lucia 

 

data house ; 
	set "D:\Users\lucia\Documentos\housing";
	prix_au_feet2 = price / lotsize ;
run ;

proc reg data=house ; 
	model price = lotsize bathrms ; 
	output out=prevrest p=prev r=res ; 
run ;

error sas.PNGlog.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

PROC REG is an interactive procedure. That means that it does not exit when you execute a RUN statement. Instead, it remains running, waiting to see whether you are going to submit more statements.

 

The procedure has opened a data set for writing and the data set will remain open until you use a QUIT statement or execute a new procedure. Thus the solution is to put the statement 

QUIT;

at the end of your program. That will close the data set.

 

 

View solution in original post

7 REPLIES 7
Rick_SAS
SAS Super FREQ

PROC REG is an interactive procedure. That means that it does not exit when you execute a RUN statement. Instead, it remains running, waiting to see whether you are going to submit more statements.

 

The procedure has opened a data set for writing and the data set will remain open until you use a QUIT statement or execute a new procedure. Thus the solution is to put the statement 

QUIT;

at the end of your program. That will close the data set.

 

 

luciacossaro
Obsidian | Level 7

Thanks you, that was the problem, now it's work fine.

 

I don't understad why thant happens with sas 9.4 and not with entreprise guide.

Rick_SAS
SAS Super FREQ

Because EG automatically appends a QUIT statement to the end of the SAS code that it submits.

Doug____
Pyrite | Level 9

What other steps do you recommend if the quit statement is present yet the error still appears when executing SQL?

Rick_SAS
SAS Super FREQ

I recommend that you start a new thread and show the code you are using and the log that contains the error.

Jagadishkatam
Amethyst | Level 16

 

Try running it in a fresh session. 

 

To clear any file which is opened, you could try the code below. Run this code to close any open file and then run your code.

 

%macro close_all_dsid;
  %local i rc;
  %do i=1 %to 1000;
    %let rc=%sysfunc(close(&i));
  %end;
%mend;
%close_all_dsid;
Thanks,
Jag
Ksharp
Super User

Rename it .

 

proc reg data=house ; 
	model price = lotsize bathrms ; 
	output out=prevrest_whatever p=prev r=res ; 
run ;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 10458 views
  • 4 likes
  • 5 in conversation