November 14, 2005 at 12:52 pm
I am periodically receiving the error below when running a .bat file under server job agent in SQL 2000. Any ideas where to look for the root cause of the error?
[LOG] Step 1 of job 'job name here' (0x6B0008AF4463D5458CA91C915A2008E0) has caused an exception in the CmdExec subsystem and has been terminated
Thanks.
Gary
November 14, 2005 at 1:12 pm
November 14, 2005 at 1:37 pm
Here it is. I've had it happen on a couple different .bat files though so I don't think it is an error in the .bat file as it runs successfully probably 95% of the time.
@echo on
del D:\MasonGains\gainscs\project\Mfgcuts\sendmfg.mfg
del D:\MasonGains\gainscs\project\Mfgcuts\mfglogfile
log /w D:\MasonGains\gainscs\project\Mfgcuts\mfglogfile
call D:\MasonGains\gainscs\project\gainsinit.bat
call logmsg %1 "===================================================="
call logmsg %1 "Check for txt files to send"
set fname="%@findfirst[D:\MasonGains\gainscs\project\mfgcuts\*.txt]"
:nextfile
Iff %fname NE "" then
call logmsg %1 "===================================================="
call logmsg %1 "Copy to send file"
copy %fname d:\masongains\gainscs\project\mfgcuts\sendmfg.mfg
on error goto errortag
call logmsg %1 "===================================================="
call logmsg %1 "Move file to backup directory"
move %fname d:\masongains\gainscs\project\mfgcuts\mfgbackup
on error goto errortag
call logmsg %1 "===================================================="
call logmsg %1 "Sen text file to AS/400"
call ftpput d:\masongains\gainscs\project\mfgcuts\sendmfg.mfg I2APPARO.GAINS %1
on error goto errortag
call logmsg %1 "===================================================="
call logmsg %1 "Set Trigger file to start PO Process"
::echo %@strip[/,%_date],%@strip[:,%_time],I2Process
del GAINI2P
::call logmsg GAINI2P "%@strip[/,%_date], %@strip[:,%_time], I2Process"
echo>>GAINI2P %@strip[/,%_date]%@strip[:,%_time]I2Process
call logmsg http://ftp.log "===================================================="
call logmsg http://ftp.log "Send Trigger File to AS/400"
call ftpput GAINI2P. GAINI2P.GAINI2P %1
on error goto errortag
DELAY 5
call logmsg %1 "===================================================="
call logmsg %1 "Check for more text files"
set fname="%@findnext[D:\MasonGains\gainscs\project\mfgcuts\*.txt]"
DELAY 5
goto nextfile
else
set fname="%@findclose[D:\MasonGains\gainscs\project\mfgcuts\*.txt]"
endiff
goto exittag
:errortag
copy D:\MasonGains\gainscs\project\Mfgcuts\mfglogfile D:\MasonGains\gainscs\project\Mfgcuts\errlog
:exittag
del D:\MasonGains\gainscs\project\Mfgcuts\sendmfg.mfg
call logmsg %1 "===================================================="
call logmsg %1 "MFG CUT PRocess Completed Successfully"
call logmsg %1 "===================================================="
type D:\MasonGains\gainscs\project\Mfgcuts\mfglogfile >>cintasmfgcutdet.log
exit 0
November 14, 2005 at 2:10 pm
I would suggest possibly using the job setup output file option to possibly catch more information as to why your .bats are periodically failing. You may also want to write in some more logging/debugging info. into your.bat.
November 14, 2005 at 2:27 pm
Thanks. I do have quite a bit of logging and error trapping but unfortunately when this error occurs, the job just stops and does not output anything to the log files. I saw in some further research that this was a bug in SQL 6.5 that Microsoft supposively fixed so I may see if I can get a hold of them to see if maybe that patch didn't make it into latest version.
November 14, 2005 at 2:30 pm
November 14, 2005 at 2:46 pm
Thanks for the replies!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply