How to Check the Return Code for XCOMTCP or XCOM62?

Document ID : KB000027838
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How to Check the Return Code for XCOMTCP or XCOM62?

Answer:

Here is a sample script to obtain the error return value from a non-queued XCOMTCP. This procedure does not work for queued transfers. The procedure is the same if using the XCOM62 command. In this case, the script just prints out the error number before exiting.

xcomtcp -c1 -f /usr/spool/xcom/config/xcom.cnf QUEUE=NO
status=$?
if [ $status > 0 ]
then
echo $status
fi
exit 0

The return code is usually a 3 digit number which corresponds to the error message number for non zero return codes. There is a unix restriction where return codes cannot be greater than 256. The return code is modulo 256. Therefore an XCOMU0298E would give you 42 as a return code (298-256=42).