Originally posted by: RT123
Hi Paul,
The shell script pasted above works, but it doest return the correct error code when it fails. I am trying to call a series of maps using shell. My Shell script will call the first map which will consequently call the second map.
Now if my second map fails i get the error on screen "Exit call failed". I want to fail the map, but the return code is 0 and hence the map completes successfully. Can you let me know how i can modify the below script to fail base don error code.
Thanks
#!/bin/ksh
## --------------------------------------------------------------------------- #
## #
## --------------------------------------------------------------------------- #
. /$MACHINE/apps/common/librairies_communes.ksh
. /$MACHINE/apps/common/jobInitialize.ksh ${0} "$*"
# --------------------------------------------------------------------------- #
# VARIABLES
# --------------------------------------------------------------------------- #
#export PARM="/abcdefgh/apps/xyz/config/"
#export _GEDPARM="/abcdefgh/apps/xyz/config/config.mrn"
FLOG=${SYSOUT}
#PARAM=${PARM}
# --------------------------------------------------------------------------- #
#
# --------------------------------------------------------------------------- #
f_GenDateFromDB()
{
echo "*-------------------------------------------------------*"
echo "* Launch the map *"
echo "*-------------------------------------------------------*"
echo $_GEDPARM
#echo $PARAM
${DTX_HOME_DIR}/bin/dtxcmdsv /abcdefgh/apps/xyz/map/DATE_MAP.mmc
CODE_RET=$?
if [ $CODE_RET -ne 0 ]
then
echo "Failed to execute DATE_MAP.mmc - KO" > ${FLOG}
exit 1
else
echo "Successful executution of DATE_MAP.mmc OK" > ${FLOG}
fi
}a
# --------------------------------------------------------------------------- #
# MAIN
# --------------------------------------------------------------------------- #
jobDebut
f_GenDateFromDB
jobFin
#IBM-Websphere-Transformation-Extender#DataExchange#IBMSterlingTransformationExtender