Your SAS programs, embedded in web apps and elsewhere

message PROC SQL

Reply
Regular Contributor
Posts: 163

message PROC SQL

I am creating a small stp web app.
I created some PK in a small table. The thing is, when an insert happens the STP will fail if there is a integrity constraint violation. Is there some PROC SQL OPTION or something that when the violation happens I can take this 'error return code' and send a message instead of failing?

jp
SAS Employee
Posts: 13

Re: message PROC SQL

after proc sql you can check for the errors in the proc sql execution as
%if &sqlrc ne 0 %then
%do;
%let ReturnCustomError=Error During insert ;
%return;
%end;

/* SQLXRC - contains the DBMS-specific return code that is returned by the Pass-Through Facility. */
Ask a Question
Discussion stats
  • 1 reply
  • 180 views
  • 0 likes
  • 2 in conversation