I will try to explain better what I am looking for.From Sequel Server I am calling multiple stored procedures on db2/400 (below is snippet calling 2 procs on db2/400)Sequel Server Script:@RetValue char(200),@Library nvarchar(10),@File nvarchar(10),@Member nvarchar(10),@Error intExec ('Call QGPL.sp_ovrdbf(?,?,?,?)', @Library, @File, @Member, @Error) AT AS400SRV_IBMDASQLif @Error = -1 SET @RetValue = 'Error: occurred overding to file member ' + @Member RETURNExec ('Call QGPL.sp_alcobj(?,?,?,?)', @Library, @File, @Member, @Error) AT AS400SRV_IBMDASQLif @Error = -1 SET @RetValue = 'Error: occurred allocating file ' + @File + ' and member' + @Member RETURNCode on AS/400:create procedure sp_alcobj (in @library char(10), in @file char(10), in @member char(10), inout @error int) language sql begin declare command char(84); declare commandLength decimal(15,5); -- Exit handlers Declare EXIT HANDLER For SQLEXCEPTION Set @error = -1; -- Exception Error set command = 'alcobj obj((' || trim(@library) || '/' || @file || ' *file *excl ' || trim(@member) || '))'; set commandLength = decimal(length(trim(command)),15,5); call qsys/qcmdexc(command,commandLength); end; For each sp being called on db2/400 I need to capture any error conditions (which I think I'm doing). If there is no error I would like to return a successful message to my vb program as well. That is why I was asking if I could use an if @error = -1 'error message' else 'succesful'. Hope this explains better what I am after.