BookmarkSubscribeRSS Feed
Triz
Calcite | Level 5

Hello, I need to execute a Stored Procedure (SP) loaded in a Teradata Database. This Stored Procedure return the status of execution, and I need to take this status to determine the next steps in my workflow. I execute the SP using:

proc sql;

execute (call bd.procedure_name(status_var));

...

Is there any way to take the value of 'Status_var'?

 

Thank you very much in advance

 

Regards, 

Beatriz

1 REPLY 1
LinusH
Tourmaline | Level 20

Generally speaking, you cannot use EXECUTE if you want to feed the resukt back to the calling SAS session.

You have to use the SELECT * FROM CONNECTION TO construct.

But, this uses a query as a parmeter. And id understand TD SP correctly, the result is fed back to avariable, rather than a query result.

So my guess is that this hard to accomplish OOTB.

Workaround? - if you can store the status_var in a table, then query that in a seconf call using SELECT * FROM CONNECTION TO.

Data never sleeps

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1394 views
  • 0 likes
  • 2 in conversation