GET_PROCESS_INFO returns the column count of the first process line instead of the current line
search cancel

GET_PROCESS_INFO returns the column count of the first process line instead of the current line

book

Article ID: 451866

calendar_today

Updated On:

Products

Automic Automation

Issue/Introduction

We observed unexpected behavior when using GET_PROCESS_INFO with the COLUMNS parameter inside a process loop.

According to the documentation, GET_PROCESS_INFO(Process, COLUMNS) returns the number of columns in the current line of the specified data sequence if it used with in a process loop.

However, when a process contains lines with different numbers of columns, GET_PROCESS_INFO(&HND#, COLUMNS) does not appear to evaluate the current line. Instead, it returns the column count of the first line for all subsequent lines.

The following simplified script reproduces the behavior:

:SET &HND# = CREATE_PROCESS(NEW)
:SET &RESULT# = PUT_PROCESS_LINE(&HND#, "abc,def", ",")
:SET &RESULT# = PUT_PROCESS_LINE(&HND#, "abc", ",")
:SET &RESULT# = PUT_PROCESS_LINE(&HND#, "abc,def,ghi", ",")
:PROCESS &HND#
:  SET &LINE# = GET_PROCESS_LINE(&HND#)
:  SET &INDEX# = GET_PROCESS_INFO(&HND#, INDEX)
:  SET &COLUMNS# = GET_PROCESS_INFO(&HND#, COLUMNS, &INDEX#)
:  PRINT "Line &INDEX#: '&LINE#'; COLUMNS=&COLUMNS#"
:ENDPROCESS
:CLOSE_PROCESS &HND#

The report shows column count as 2 for all the lines whereas the process contains different column count 

Environment

24.4.X, 26.X

Cause

Product working as expected and the documentation needs to be updated.

Resolution

The documentation will be updated as follows:
COLUMNS: Retrieves the number of columns the defined Line has. Use this key with the Line parameter to define the number of the Line that should be used for that purpose. If you do not specify Line, the first Line is retrieved.

Verify the fix version listed below or a newer version if available.
Fix version(s): 
Component: Documentation
Will be fixed in version 24.4.6 and 26.1.0