Checking the Return Code for XCOMTCP or XCOM62
search cancel

Checking the Return Code for XCOMTCP or XCOM62

book

Article ID: 27838

calendar_today

Updated On:

Products

XCOM Data Transport XCOM Data Transport - Windows XCOM Data Transport - Linux PC

Issue/Introduction

How to check the Return Code for XCOMTCP or XCOM62?

Environment

  • XCOM™ Data Transport® for Windows
  • XCOM™ Data Transport® for UNIX/Linux PC

Resolution

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).