Page 1 of 1
RTVJOBA TYPE function in UI
Posted: Thu Dec 29, 2011 1:13 pm
by tholt
We have CL programs that RTVJOBA TYPE(&TYPE) to determine if the job is running in batch or interactively. If it is interactive we will display a prompt screen but if in batch we use settings from the LDA or some other source. The type in UI programs returns as batch when we need for it to show as interactive. What can we check to see if the job is running as a UI session (other than the job name of "PROFOUNDUI")?
Re: RTVJOBA TYPE function in UI
Posted: Thu Dec 29, 2011 1:23 pm
by David
Yes, Profound UI sessions run in batch jobs. So, the information RTVJOBA is giving you is technically correct.
You can determine if you are running in a Profound UI session by looking for environment variable 'PROFOUNDUI' in the job. The PUI session controller sets this to '1'.
For example:
RPG CODE
If getenv('PROFOUNDUI') <> *Null;
// Running in Profound UI session.
EndIf;
Note that if you are running in a Genie session, none of this applies. In that case, you have a 5250 interactive job, and RTVJOBA would indicate this.