Windows job does not have a trailer printed in report
search cancel

Windows job does not have a trailer printed in report

book

Article ID: 204925

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

A windows job that calls a .bat file does not have a the trailer at the end.

Expected behavior: Job report should show something similar to:

[End of standard out]

c:\>C:\Automic\Automation.Platform\Agents\windows\bin\UCXJWX6M.EXE JNR=0001356818 MNR=0101 PNR=2300 IPA=10.74.112.164 TYP=E RET=00000000 TXT="        Job ended" 
Program 'UC4 Job Messenger' version '12.3.3+build.1591976936160' started
UCMDJP: *********************************************************************
UCMDJP: ** JOB 0001356818 (ProcID:0000020696) ENDED AT 10.12.2020/06:18:10 **
UCMDJP: **                                    UTC TIME 10.12.2020/14:18:10 **
UCMDJP: ** --------------------------------------------------------------- **
UCMDJP: **                                    USED:      0.000 CPU         **
UCMDJP: *********************************************************************
Program 'UC4 Job Messenger' version '12.3.3+build.1591976936160' terminated normally

Actual behavior - Nothing written after standard out finishes:

[End of Standard out]

There is no change to functionality, the job still ends with the correct status and ret code

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Cause

The Windows job calls a .bat file

Resolution

This seems to be the nature of running a .bat file from the process as once the .bat file exits, it exits the .bat file above it as well (which is what Automic uses to run windows jobs).

This can also be seen with a simple test outside of automic:

1) Create a .bat file, foo.bat.  Add these lines:

dur > test.txt
bar.bat
dir >> test.txt

bar.bat simply has:
echo test

the dir >> test.txt line never gets executed because as soon as the nested .bat file, bar.bat, exits, the entire thing exits.