You can pass files as parameters using prototyped calls to RPG programs and procedures. You can define file parameters for prototypes and procedure interface definitions, using the LIKEFILE keyword. The called program or procedure can perform any operation that is valid on the original file that was used to define the file parameter.
For an example of a program that passes a file parameter, see Example of passing a file and passing a data structure with the associated variables.