You can re-direct stdin by running a batch session:
mbpro -db dbname -p program.p < input.file
Alternately, use the ENTRY event to get the current field, check it's PROGRAM-NAME() and SELF:NAME values for the field you want, and modify SELF:SCREEN-VALUE as appropriate.
To update other fields in the frame, use widget-handle:PREV-SIBLING and widget-handle:NEXT-SIBLING to walk the frame's widget tree.