1. The INVITE keyword must be on the main format (the format you would normally use EXFMT to write/read in your program).
2. The parameter WAITRCD(n) must be specified on the CRTDSPF command. "n" is the number of seconds to wait before control is returned to the program. Also specify RSTDSP(*YES) and MAXDEV(1). You can use OVRDSPF before opening the display file to change the value of "n."
3. The KNUM keyword must be specified on the F-spec for the WORKSTN file in your RPG program, with a value of 1 (RPG), or MAXDEV(*FILE) (RPGLE).
4. Instead of EXFMT, you use WRITE to the FORMAT name, and READ from the DISPLAY FILE name. The READ should have resulting indicators specified at the Lo and Eq positions (RPG), or the E extender (RPGLE).
5. After the READ, check the *STATUS field from the display file information data structure (RPG) or %STATUS (RPGLE). If the value is 01331, then the WAIT time expired and control returned. If it is NOT 01331, then the user caused control to return by pressing a function key.
Now this should work. If it does not, go to Search400.com's discussions and search for "waitrcd." That search will get you lots of advice and some good examples of actual code.
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Visit the ITKnowledge Exchange and get answers to your developing questions fast.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.
Dig Deeper on iSeries programming commands
Related Q&A from John Blenkinsop
When an error occurs on an IBM command, the diagnostic messages are sent first, then an escape message, which you can monitor. On AS/400 you see the ... Continue Reading
Learn how to 'append data to the file' with the FTP DIR command, and eliminate the hassle of having to end the FTP session and restart to view ... Continue Reading
RPGIV will 'think of' incoming integer fields as binary, and then will redefine them in the program structures as PACKED. So, when you chain a record... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.