we are using before/afterjob subroutines to call stored procedures through sqlplus before/after our job executes. We are not able to get back errors when there are some issues with Stored Procedure execution. For example even when there is no such Stored Procedure present in database, the job terminates fine without even logging a warning. Please suggest what changes should be done to get back errors into the subroutine and abort the job in case of errors.
DS subroutine code:
Code: Select all
inputStrCount = DCOUNT(input_string,",")
Dimension A(inputStrCount )
FOR X = 1 TO inputStrCount
inputToken = FIELD(input_string,",",X )
A(X) = trim(inputToken)
Call DSLogInfo ("InputArg " :A(X),'');
NEXT X
Call DSExecute('DOS','SQLPLUS' : ' ' : A(2) : '/' : A(3) : '@' : A(1) : ' @' : A(4),Output, SystemReturnCode );
ErrorCode = SystemReturnCode;
Code: Select all
CALL CDB_SELF_PREF('Y');
UPDATE STG_MIGRATION_STATUS SET JOB_STATUS = 'Completed' where TABLE_NAME = 'XYZ';
COMMIT;
EXIT;