File transfer ENDED_NOT_OK with return code = 0 when the source file does not exist

Document ID : KB000090092
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
File transfer ENDED_NOT_OK with return code = 0 when the source file does not exist
Resolution:

Symptoms

When you run a File transfer job with non-exist source file, the status for the job often said "ENDED_NOT_OK", with return code = 0

How to capture this error: "file does not exist" and send notification via Runtime tab


Cause

The return code = 0 with ENDED_NOT_OK status is normal behavior of UC4 system


Resolution

To capture the "file does not exist" error: 

As the report job generated with message: the file ... does not exist", you will capture it and change the return code of the job to a number > 0, so that the alert will be sent to you

put these commands in the Post Process tab of file transfer to get alert when the file transfering does not exist 

:SET &HND# = PREP_PROCESS_REPORT("JOBF",,"REP","*does not exist*") 
:PROCESS &HND# 
: SET &RET# = GET_PROCESS_LINE(&HND#) 
: PRINT &RET# 
: MODIFY_STATE RETCODE=50 
:ENDPROCESS