How do you auto refresh a display in a RPG program?

10 pts.
Tags:
RPG
We would like a never ending RPG display program to refresh every five minutes. Any suggestions?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Is the display strictly for output or is input also allowed?

If output only, then simply write to the display (with DFRWRT(*NO)), delay the program for 5 minutes, and then write to the display again. You can delay the program in a variety of ways: the sleep API documented <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/apis/sigsleep.htm”> here,</a> receiving a message from a *DTAQ when the message will never be sent and using the QRCVDTAQ Wait time parameter documented <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/apis/qrcvdtaq.htm”> here, </a> using the CL DLYJOB command documented <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/cl/dlyjob.htm”> here,</a> etc.

If you need to also accept input from the display then you can associate a *DTAQ with the *DSPF. The program could then be notified via the QRCVDTAQ API when either data is available from the device or 5 minutes has passed. This is discussed in Chapter 12 (Waiting for Input from a Display File, an ICF File, and a Data Queue) of <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/books/sc415715.pdf”> this manual.</a>

I hope this helps,
Bruce Vining
www.brucevining.com

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    Hi, You could also try specifying the WAITRCD(numer_of_seconds_to_wait) parameter on the display file, or using OVRDSPF WAITRCD(numer_of_seconds_to_wait). You may have to monitor for an error in your RPG program, there is an error generated when the wait time is reached. Best to just try it and see how it goes. You can just use a resulting LOW indicator in RPG to trap the error. Cheers, Martin Gilbert.
    23,730 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following