It's not clear what operations you want to perform against arrays of unknown sizes. Perhaps some example code can provide a starting point, and things can be added or refined as things progress. So, for a trivial example:
h dftactgrp( *NO )
D tmp_Ary1 s 10i 0
D tmp_Ary2 s 10
d chk_Arrays pr
d ary1 like( tmp_Ary1 ) dim( 99 ) const
d ary2 like( tmp_Ary2 ) dim( 99 ) const
D ary1 s like( tmp_Ary1 ) dim( 50 )
D ary2 s like( tmp_Ary2 ) dim( 50 )
/free
ary1( 1 ) = 12345 ;
ary2( 1 ) = 'Some value' ;
callP chk_Arrays ( ary1 : ary2 ) ;
*inlr = '1';
/end-free
P chk_Arrays b
d pi
d ary1 like( tmp_Ary1 ) dim( 99 ) const
d ary2 like( tmp_Ary2 ) dim( 99 ) const
d foundElems s 10i 0
/free
foundElems = 99 ;
return;
/end-Free
p E
The chk_Arrays() proc expects two arrays, one is dim(99) with 10-byte character elements and the other is dim(99) for integer elements. But the proc is called with arrays that are both defined as dim(50), and only a single element is populated in each array.
The proc only has a single executable statement. For the most part, the only reason that statement exists is to give a known spot for a debug breakpoint. Compile and run in debug, and display the two arrays when the breakpoint fires.
From there, a description of what else is needed would be helpful.