with putenv API you can create/update *JOB Environment variable inside RPG program
command WRKENVVAR will show all Environment variables for actual job.
dcl-pr putenv int(10) extproc('putenv');
*n pointer value options(*string:*trim) ;
end-pr;
putenv('QIBM_QSH_CMD_ESCAPE_MSG=Y') ;