The behavior relies on your setting the callingConvention property on both the call statement and the called program. The property value is either CallingConventionKind.Expanded or the short form, Expanded.
Record MyCompletePart type BasicRecord
10 myInt INT;
10 myInt02 INT;
10 myChars CHAR(5);
end
Record MySubPart type BasicRecord
10 myInt02 INT;
10 myChars CHAR(5);
end
myCompleteRecord MyCompletePart;
mySubRecord MySubPart;
myIntVar INT;
myInt02Var INT;
myCharsVar CHAR(5);
call MyProgram( myCompleteRecord ) { callingConvention=Expanded };
call MyProgram( myIntVar, mySubRecord ) { callingConvention=Expanded };
call MyProgram( myIntVar, myInt02Var, myCharsVar) { callingConvention=Expanded };
Program MyProgram type BasicProgram ( myCompleteRecord MyCompletePart )
{ callingConvention=Expanded }
end
Program MyProgram type BasicProgram ( myIntVar INT, mySubRecord MySubPart )
{ callingConvention=Expanded }
end
Program MyProgram type BasicProgram ( myIntVar INT, myInt02Var INT, myCharsVar CHAR(5))
{ callingConvention=Expanded }
end
Any of the three call-statement argument lists is valid for any of the three called-program parameter lists.
Record X type BasicRecord
10 myChar CHAR(4)[2];
20 mySubChar01 char(2);
20 mySubChar02 char(2);
end
When you use Expanded, each leaf (mySubChar01 or mySubChar02) is passed in a contiguous block of memory even though the fields in that leaf are not stored contiguously. The data must be copied, and the extra processing takes time. For details on how multidimensional structure field arrays are stored, see “Arrays.”
If you are passing a structure field array explicitly, see “How to pass structure field arrays.”