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:
- len1 would be equivalent to the length of the array. For example if ARRAY = [1,2,3], len would be equal to 3.
- Each member of the array should be printed.
Actual Results:
- len1 is equivalent to "JOBCARD.0" not the actual length.
- The program fails on the for loop due to a IRX0041I (Bad arithmetic conversion) and doesn't print out the members/
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.