Is there a way to capture the output and any errors from upsShell.exe? I am running the following in a windows cmd batch script, however %ERRORLEVEL% always appears to be 0 even when I force the load to fail by loading a problematic file. Or will this process always succeed? Windows CMD command prompt batch script (ignore the extra spaces either side of tildes):
rem set script variables
rem get values from params file
FOR /F "eol=; tokens=1,2,3,4,5,6,7 delims=, " %%i in (%SHARE%\Config\Params.txt) do SET SERVER=%%~i& SET USER=%%~j& SET PASS=%%~k& SET APP=%%~l& SET DB=%%~m& SET DFGEXP=%%~n& SET FDMAPP=%%~o& SET LBSERVER=%%~p
rem execute fdm batch load
rem assess success or failure
if %ERRORLEVEL% EQU 0 goto NO_ERROR
rem do nothing
rem do something
Thinking about it further, I realise that errors are written out to Outbox\Logs\<username>.err, however the Windows command prompt batch process (using upsShell.exe) appears to be unaware that any errors actually occurred. When running the batch process through either the Hyperion FDM Task Manager or FDM Workbench, there is visual feedback to alert the user that the build failed. These two user interfaces must be obtaining an error code from somewhere, and it would be useful to be able to do the same using the batch process to be able to act accordingly.
Is there a way to obtain a result code / return value from somewhere?
I have also discovered that if the data file naming convention is incorrect (not in the "A~LOCATION~CATEGORY~PERIOD~RA.csv" format, for example), upsShell.exe happily processes the data file by moving it out of the OpenBatch folder and into a new folder, but the file is not loaded as it does not know where to map it to (as expected). However, there are no errors in the <username>.err error file in Outbox\Logs to inform the user! Again, some useful feedback from upsShell.exe would not go a miss either.
JamesD, I have the same requirement. I am trying to capture a return code from an automated upsShell step to abort the remainder of the steps if an error occurs. Did you ever find a way to accomplish this? Thanks.
the problem you have is the FDM batch functions handle the main errors and as a result the batch process is seen to be ending successfullly and that is what the upsshell.exe records. you may need to interegate the table(s) which holds the data which is displayed in the batch reports (Reports / batch reports) which is updated as the batch process runs / completes. If you follow the following thread, it may give you an idea as a similar issue was raised using Task Manager: Batch loader not erroring out if the validation failed also