Absent Member.. Jonathan Feutz Absent Member..
Absent Member..
469 views

Command Results with Mutiple lines of input. Arrays/Multidim Arrays Possible? OO Lists/Iterators

I have result like this from a SSH command, i need all of the data from the command within different flow variables. I could do this with Lists/iterators. However I'm wondering if there is a simplier way to accomplish this. In scripting I would read the result into either an array or a multidimentional array, so I could access the result items at will, but arrays dont seem to exist in OO. Same thing applies to pulling data from tables, getting data one row at a time, works well for small amounts of data, but when you have to work with large result sets, the 'Get Next row' operation provides poor performance overall.

 

Example of the Result

# fetch_connections.pl servername

pool_name,servername,total_connections

pool1,server1,10

pool2,server2,4

pool3,server3,2

pool4,server4,1

 

Whats the best way to read in all the values into flow variables, use in different operations, and then display the final results? Interested how others have created flows for these types of actions.

 

 

 

 

Labels (1)
0 Likes
1 Reply
Absent Member.. george_cassar Absent Member..
Absent Member..

Re: Command Results with Mutiple lines of input. Arrays/Multidim Arrays Possible? OO Lists/Iterato

You can use the set flow variables operation in conjunction with a count to set the results of a step.

 

For your example the inputs for this operation can be

 

keyNames = pool_name${count},servername${count},total_connections${count},

myValues = pool_nameResult,servernameResult,total_connectionsResult,

 

delimeter =  ,

each iteration of the results will increment the count for each keyName thus creating a new flow variable for each result.

 

You can see in the context inspector a new var created for each result with the count var appended to make each result unique ie; pool_name0

 

View attached flow & image  - hopefully this helps... 

This may not be the best but it has worked for me.

 

With sql queries its much easier in that you can append all your query results then using the set flow variable operation you can set all you columnData to your rowData that way each heading = the var value.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.