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

Hi All,

 

I have a simple stored process, as below:

 

*ProcessBody;
%STPBEGIN;
PROC SQL;
CREATE TABLE TEST AS
SELECT * from SASHELP.CARS (OBS=2);
select * from TEST;
QUIT;
%STPEND;

when executed it says that table is created and table is presented from the select.

But it is not visible in the folder WORK.

 

The same code without %STPBEGIN; and %STPEND;, which is only code block, when executed, executes the same way but this time produces the table.

 

Why is that behavior ,

 

Lyudmil Petrov

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

WORK is individual for each SAS session, and in the case of stored processes, cleared after each STP execution, so you cannot expect to see it in any other WORK library. Create the dataset in a permanent library instead.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

WORK is individual for each SAS session, and in the case of stored processes, cleared after each STP execution, so you cannot expect to see it in any other WORK library. Create the dataset in a permanent library instead.

lyudmilpetrov
Calcite | Level 5

Thank you so much Kurt for your fast response, your answer perfectly explains why.

 

I am new to SAS and I am trying to execute the stored process within .NET, my Stored process is as follows

 

*ProcessBody;
%STPBEGIN;
PROC SQL;
CREATE TABLE BP AS
SELECT * from SASHELP.BASEBALL (OBS=2);
QUIT;
%STPEND;

 

How I can change it to make the table saved into permanent library.

 

Thank you so much in advance and all the best,

 

Lyudmil

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
  • 2 replies
  • 640 views
  • 1 like
  • 2 in conversation