Supported RPG Features

The LIKEFILE keyword defines a procedure parameter whose type is a file reference. The referenced file is typically a TEMPLATE file (compile-time only, no I/O at startup):

DCL-F MYFILE DISK USAGE(*INPUT) TEMPLATE;

DCL-PR doWork;
  inFile LIKEFILE(MYFILE);
END-PR;

Any file with the same characteristics as the template may be passed to the procedure. Within the called procedure, I/O on the file parameter uses data structures.