What I have tried:
Program A:
call PROGRAMB ARRAY val1 val2
PROGRAM B:
PARSE arg ARRAY val1 val2
/* test to see if ARRAY is passed successfully */
/* len1 equals the length of ARRAY */
interpret "len1 = "ARRAY".0"
say 'len1: ' len1
DO i=0 TO len1
say 'current line: '
interpret "say "ARRAY".i"
END;
Expected Results:
Actual Results:
Solutions I have tried:
https://www.bde-gmbh.de/tipps-tricks/zos-rexx/how-to-pass-stems-as-procedure-arguments-in-rexx/
But this method only works for passing arrays to functions within the same program.
You can't pass a stem (array) to an external Rexx EXEC. Look into using NEWSTACK, PUSH, QUEUE, QUEUED(), PULL, DELSTACK. These are all documented in the keyword instructions, built-in functions, and TSO/E external functions sections of the TSO/E Rexx Reference