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 ;
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.
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.
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.
Because EG automatically appends a QUIT statement to the end of the SAS code that it submits.
What other steps do you recommend if the quit statement is present yet the error still appears when executing SQL?
I recommend that you start a new thread and show the code you are using and the log that contains the error.
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;
Rename it .
proc reg data=house ;
model price = lotsize bathrms ;
output out=prevrest_whatever p=prev r=res ;
run ;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.