Jackson:
Arguments are **passed both ways** if simple variables or arrays as in CALL SUB( DIO, MAT WHATEVER, .... ). The subroutine sees any values transferred, and the caller sees values returned.
Arguments must be one-to-one matched between the Calling program and the sub: CALL WHOSIS (DIO, MAT WHATEVER, 9) ---> SUBROUTINE WHOSIS( VAR1, MAT ARRAY2, VAR3)
The exception is when you want to pass a value to the subroutine, and NOT have any changes reflected in the variable on return. You then decouple the variable in one of the following ways:
Generically, CALL SUB ( (DIO) ) ... the extra parentheses is the magic.
Often if the variable is a number, CALL SUB ( DIO + 0 ) or, if a string, CALL SUB ( DIO:'' ) but these are less efficient than the parentheses enclosure.
An array cannot be decoupled (imsr).
AND any expression's value is passed to the sub, but obviously cannot be returned: CALL SUB( DIO* XXX+1 )
Hope this helps
Chandru Murthi