SQL Job stuck in “Start initiated” status when additional indent present in script on Process tab
search cancel

SQL Job stuck in “Start initiated” status when additional indent present in script on Process tab

book

Article ID: 88084

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Error Message :
​java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 

For the full errormessage please see description

A SQL Job stays in a "Start initiated" status when a script with an additional indent is executed in the Process Tab and the SQL Agent writes forced Traces. 

Investigation
  1. Create a SQL Job with the following script in the Process Tab:
:READ &RNNR#,,,"2288358", 
:set &rnnr# = FORMAT(&rnnr#,'0') 

!AgentenLOG 
:set &act_txt#=''; 
:SET &HND# = PREP_PROCESS_REPORT(, &rnnr#, "PLOG",,"COL=DELIMITER", "DELIMITER=*'*") 
:PROCESS &HND# 
: SET &RET# = GET_PROCESS_LINE(&HND#,1) 
: set &act_txt# = "&act_txt# &RET#" 
:ENDPROCESS 
:CLOSE_PROCESS &HND# 
!"REPORT"; 
:set &rep_txt# = "" 
:SET &HND# = PREP_PROCESS_REPORT(, &rnnr#, "REP",,"COL=DELIMITER", "DELIMITER=*'*") 
:PROCESS &HND# 
: SET &RET# = GET_PROCESS_LINE(&HND#,1) 
: set &rep_txt# = "&rep_txt# &RET#" 
:ENDPROCESS 

SQL_SET_STATEMENT_TERMINATOR TERM='@'; 
SELECT count (*) from EH;@ 
  1. Execute the SQL Job.
Results

Actual:  
Job stays in a "Start initiated" status and the SQL Agent writes forced Traces. 
Expected:  Job should run to completion.  

If the script is modified and the indent at the beginning of the line containing "!"Report";" is removed from the Process tab the Job works correctly.

Error Messages from the Trace file:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
at java.util.LinkedList.checkElementIndex(Unknown Source) 
at java.util.LinkedList.get(Unknown Source) 
at com.uc4.ex.sql.JCLSplitter.split(JCLSplitter.java:66) 
at com.uc4.ex.sql.SQLConsumer.syntaxOk(SQLConsumer.java:589) 
at com.uc4.ex.Job.jclSyntaxError(Job.java:327) 
at com.uc4.ex.JobRoutine.executeJob(JobRoutine.java:221) 
at com.uc4.ex.MessageDispatcher.dispatchLogicalMessage(MessageDispatcher.java:139) 
at com.uc4.ex.cp.CPConnection.dispatch(CPConnection.java:767) 
at com.uc4.ex.cp.CPConnection.access$200(CPConnection.java:70) 
at com.uc4.ex.cp.CPConnection$3.run(CPConnection.java:700) 
at com.uc4.ex.ThreadPool$RunnableDecorator.run(ThreadPool.java:53) 
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
at java.util.concurrent.FutureTask.run(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 

 
java.lang.Exception: Log Stack 
at com.uc4.ex.logging.LogService.forcedTrace(LogService.java:482) 
at com.uc4.ex.MessageDispatcher.dispatchLogicalMessage(MessageDispatcher.java:251) 
at com.uc4.ex.cp.CPConnection.dispatch(CPConnection.java:767) 
at com.uc4.ex.cp.CPConnection.access$200(CPConnection.java:70) 
at com.uc4.ex.cp.CPConnection$3.run(CPConnection.java:700) 
at com.uc4.ex.ThreadPool$RunnableDecorator.run(ThreadPool.java:53) 
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
at java.util.concurrent.FutureTask.run(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source)

Environment

OS Version: N/A

Cause

Cause type:
Defect
Root Cause: Indented comment lines in an SQL job cause IndexOutOfBoundsException errors, and the job gets stuck in a status of "Start initiated" .

Resolution

Update to a fix version listed below or a newer version if available.

Fix Status: Released

Fix Version(s):
Automation Engine 12.0.2 - Available
Automation Engine 11.2.5 – Available

Additional Information

Workaround :
 Remove the additional indent in the script.