errors U00020365 and U00020364 when using array in :BEGINREAD .. :ENDREAD block

book

Article ID: 208951

calendar_today

Updated On:

Products

CA Automic One Automation CA Automic Workload Automation - Automation Engine CA Automic Workload Automation - Automation Engine

Issue/Introduction

when addressing an array using a script variable within an :BEGINREAD .. :ENDREAD block, one of the above mentioned errors occurs when the script variable is set to the max size of the array right before the :ENDREAD command.


Use the following script for reproduction (uncomment the version which you want to test):

 

! ###### Version 1 - using a loop ==> error U00020364 Runtime error in object 'xxxx', line 'xxx'. Array index out of bounds.
!:DEFINE &key#,string,3
!
!:SET &i# = 1
!:BEGINREAD
!:  WHILE &i# <= 2
!:    P "i= &i#"
!:    READ &key#[&i#],'00',"Enter Value &i#","V &i#",'K'
!:    SET &i# = ADD(&i#,1)
!:  ENDWHILE
!:  P "i= &i#"
!:  READ &key#[&i#],'00',"Enter Value &i#","V &i#",'K'
!:ENDREAD
!!###################################
!
!
!
!!###################################
!! ###### Version 2 - same thing without loop ==> same error
!:DEFINE &key#,string,3
!
!:SET &i# = 1
!:BEGINREAD
!:  P "i= &i#"
!:  READ &key#[&i#],'00',"Enter Value &i#","V &i#",'K'
!:  SET &i# = ADD(&i#,1)
!:  P "i= &i#"
!:  READ &key#[&i#],'00',"Enter Value &i#","V &i#",'K'
!:  SET &i# = ADD(&i#,1)
!:  P "i= &i#"
!:  READ &key#[&i#],'00',"Enter Value &i#","V &i#",'K'
!:ENDREAD
!!###################################
!
!
!
!
!!###################################
!! ###### Version 3 - error U00020365 Runtime error in object 'xxx', line 'xxx'. Array index is not numeric or includes decimal numbers.
!:DEFINE &key#,string,3
!:DEFINE &value#,string,3
!!
!:SET &i# = 1
!:WHILE &i# <= 2
!:  SET &i# = FORMAT(&i#)
!:  SET &key#[&i#] = 'Key &i#'
!:  SET &value#[&i#] = 'Value &i#'
!:  SET &i# = ADD(&i#,1)
!:ENDWHILE
!!
!:SET &i# = 1
!:BEGINREAD
!:  WHILE &i# <= 2
!:    READ &value#[&i#],'00',&key#[&i#],&value#[&i#],'K'
!:    SET &i# = ADD(&i#,1)
!:  ENDWHILE
!:  READ &key#[&i#],'00','Key','Key 3','K'
!:  READ &value#[&i#],'00','Value','Value 3','K'
!!:  READ &newkey#,'00','Key','Key 3','K'
!!:  READ &newvalue#,'00','Value','Value 3','K'
!:ENDREAD
!!
!!:SET &key#[&i#] = &newkey#
!!:SET &value#[&i#] = &newvalue#
!!
!:SET &i# = 1
!:WHILE &i# <= 3
!:  PRINT '&key#[&i#] &value#[&i#]'
!:  SET &i# = ADD(&i#,1)
!:ENDWHILE
!!###################################
!
!
!
!!###################################
!! ###### Version 4 - no error
!:DEFINE &key#,string,3
!:DEFINE &value#,string,3
!!
!:SET &i# = 1
!:WHILE &i# <= 2
!:  SET &i# = FORMAT(&i#)
!:  SET &key#[&i#] = 'Key &i#'
!:  SET &value#[&i#] = 'Value &i#'
!:  SET &i# = ADD(&i#,1)
!:ENDWHILE
!!
!:SET &i# = 1
!:BEGINREAD
!:  WHILE &i# <= 2
!:    READ &value#[&i#],'00',&key#[&i#],&value#[&i#],'K'
!:    SET &i# = ADD(&i#,1)
!:  ENDWHILE
!!:  READ &key#[&i#],'00','Key','Key 3','K'
!!:  READ &value#[&i#],'00','Value','Value 3','K'
!:  READ &newkey#,'00','Key','Key 3','K'
!:  READ &newvalue#,'00','Value','Value 3','K'
!:ENDREAD
!!
!:SET &key#[&i#] = &newkey#
!:SET &value#[&i#] = &newvalue#
!!
!:SET &i# = 1
!:WHILE &i# <= 3
!:  PRINT '&key#[&i#] &value#[&i#]'
!:  SET &i# = ADD(&i#,1)
!:ENDWHILE
!!###################################

Cause

Software Bug

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

The issue has been confirmed to be a bug and will be fixed with V12.2.9 and V12.3.6.

 

Currently no release date is known.