/* Takes stem and creates a forged SQL/HTML pair suitable for stempros
* Output stream 1 - CELLFORM; Output stream 2 - SQL response
* Format of stem:
* stem.0 = number of elements total in stem
* stem.1 = name of elem 1
* stem.2 = name of elem 2
* ...
* stem.5 = name of elem 5
* stem.6 = data of elem 1
* stem.7 = data of elem 2
* ...
* stem.10 = data of elem 5
*/
/* Get our data from incoming stem pipe */
'CALLPIPE *:| stem invars.'
/* Loop for all the incoming vars */
cell = ''
data = ''
do x = 1 to invars.0/2
y = x+(invars.0/2)
cell = cell||invars.x||';'||length(invars.y)||'-'
data = data||invars.y
end /* invars.0 */
/* Spit out the cellform data to primary stream */
'CALLPIPE var cell |*.output.0:'
/* Spit out the sql concated data to secondary stream */
'CALLPIPE var data |*.output.1:'
exit