Essentially the functor I created simply protects the date field. Nothing too fantastic. Note that the program that uses the functor has NO GLOBAL FIELDS IN ITS D SPECS! RPG programs with thousands of globally defined fields are difficult to maintain so the functor has a big plus in that regard.
The three RPG sources below are (1.) the FUNCTOR module containing the ILE subprocedures, (2.) FUNCTOR_H the copybook that contains the prototypes and (3.) FUNCTOR_T the program that uses the ILE subprocedures.
Create the modules and program with the following commands (changing CURLIB as necessary):
chgcurlib ... crtrpgmod functor dbgview(*source) crtrpgmod functor_t dbgview(*source) crtpgm functor_t module(functor_t functor) actgrp(home)