Surey, you can accomplish this in RPG by compiling your display file with the option of DEV(*NONE). Then, in your RPG program, specify MAXDEV(*FILE) in the F spec for the display file. In the C specs for this display, you must issue a separate write and read instead of EXFMT. On the READ instruction, specify the (E) extension i.e. READ(E). Immediately following this statement, you can test the %ERROR function and if it is true your display has “timed out” and control returns to your RPG program. Prior to running this RPG you must have in your leading CL program or on a command line, the OVRDSPF instruction with WAITRCD(3). This means that you are giving it 3 seconds to “time out”. Of course, you can specify any number of seconds that you want. F and C spec examples are below.
FMID008 CF E WORKSTN MAXDEV(*FILE)
C WRITE MAIN1 FORMAT
C READ(E) MID008
C IF %ERROR SCREEN TIMED OUT