BookmarkSubscribeRSS Feed
trevand
Obsidian | Level 7

Can it be problematic to overwrite temporary data sets? I use multiple data set and proc sql steps to create various variables and the final data set. Proc sql gives a warning if you use the same data recursively. I read here and there that it could be problematic but just wanted to double check and know why it could be problematic?

 

data temp;
set temp;
run;
proc sql;
create table temp as select * from temp;
run;

 

5 REPLIES 5
Astounding
PROC Star

The biggest problem is that these programs replace the original version of TEMP.  If you need it (such as if you kater discover a logic error), you no longer have the original input available.

Depending on the size of the data sets, you can be running up the bill.  Each step needs to read the entire data set and output all the observations.  It's easy to get into bad habits, such as using more steps that you actually need.  Typically, input and output are much more costly than data manipulation statements.

Ksharp
Super User

Nope. That would not be a problem.

If you want to get rid of this WARNING info ,you need option "undo_policy=".

 

data temp;
set sashelp.class;
run;
proc sql  UNDO_POLICY=none;
create table temp as select * from temp;
quit;
trevand
Obsidian | Level 7

@Ksharp What about overwriting using a data set statement? I read here and there that it could cause problems and I should avoid it.

PaigeMiller
Diamond | Level 26

@trevand wrote:

@Ksharp What about overwriting using a data set statement? I read here and there that it could cause problems and I should avoid it.


@Astounding already explained this.

--
Paige Miller
Ksharp
Super User
If you are using a data step statement, that WARNING info would not appeared.
They are doing the same thing I think.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 674 views
  • 2 likes
  • 4 in conversation