Exit1 not to report failure in controlM

HI Team,

I running below script from controlM and job is reporting as failure everyday so i tried to change the if exitstatus=1 (send only email) but not to end as a job is failed. can you let me know where i have to change this script to make the script not to fail but instead send email and complete successfully

        && write_log "read complete and matched for ${YEAR}-${MONTH}-${DAY}" \
        && EXITSTATUS=0; } ;} \
        || { write_error "Failed read incomplete and is not matching with ${JOBFILE}" \
        && EXITSTATUS=1; }; }
return ${EXITSTATUS}
}

#
# Main
#

EXITSTATUS=1
[ $# -ne 7 ] && [ $# -ne 6 ] && usage && exit ${EXITSTATUS}
dfs fs -ls -d ${CLOUDDIR} > /dev/null 2>&1 || { write_error "${CLOUDDIR} does not exist. Exiting now!!!!" && exit ${EXITSTATUS}; }
dfs fs -ls ${JOBFILE} > /dev/null 2>&1 || { write_error "${JOBFILE} does not exist. Exiting now!!!!" && exit ${EXITSTATUS}; }

create_log_dir && create_log_files && read_check && EXITSTATUS=0

[ ${EXITSTATUS} -ne 0 ] && notify_error "!!!${ENVIRONMENT}: Validating ${SRCSYSTEMTYPE} files for job ${STATUS} failed!!!" ${LOG} ${ERROR}

exit ${EXITSTATUS}

It will be easier for our members to make suggestions for you if you post the entire script (maybe adding line numbers) instead of a code fragment from the script.

Thanks.

The trouble I see is that we dont know if this is a shell script and what shell you are using ( usually most scripts in controlM were in csh, but that was some time ago and I hope things have changed...) or is it and here it gets more delicate, controlM scripting languages for jobs...

Thank you for response,

This is Shell script bash, placed in server and calling the from command line of controlM job.
this for validating the number of job records between two tables. if there is no records on the second table script will end with exit1 and controlM is throwing as job failure so trying to make this to end with exit0 but not to end with failure