Try this make a test script with the content below and save to a location like c:\tmp\test.bat. Script content below
@echo off
echo This is a test script
set errorlevel=0
echo Message from the script - errorlevel in script is set to %errorlevel%
set resexe=%errorlevel%
This will exit with the errorlevel set in the script (which is 0)
Now make a test Uproc to run the script, call is something like TEST_PROC1. make it type CL_INT. when you edit it add in the code below to call the script you just made.
@echo off
echo "This is a message from the Uproc"
REM ### Now running script ###
call c:\tmp\test.bat
echo Message from the Uproc - errorlevel from the script just run is %errorlevel%
set resexe=%errorlevel%
Run the Uproc using a suitable submission account, hopefully the result will be as below.
$!** PROCEDURE .. : TEST_UPROC1
$!** VERSION .....: 000
$!** EXECUTION .. : 0001270
_!**
_!** PROCESS DATE : 08/11/2018
_!**
_!------------------------------------------------
$!** PARAMETERS. : None
_!------------------------------------------------
_!** VARIABLES
_!------------------------------------------------
$!** INHERITANCE VARIABLES
_!================================================
"This is a message from the Uproc"
This is a test script
Message from the script - errorlevel in script is set to 0
Message from the Uproc - errorlevel from the script just run is 0