IBM Support

Program Example of Automatically Refreshing a Screen Using fully free RPG

Troubleshooting


Problem

This document contains a program example of automatically refreshing a display screen (DSPF) using RPGLE free.

Resolving The Problem

This program example shows how to use INVITE processing to automatically refresh a Screen every 5 seconds with the current time.

Sample time out program with output only fields.

Display File Source:
 
     A                                      DSPSIZ(*DS3)
     A                                      CF03(03  'EXIT')
     A          R SCN1                      INVITE
     A                                  5 10'THE TIME IS:  '
     A                                  5 30TIME
     A                                 10 10'TESTING OUTPUT'
     A            FLD20         20   O 10 50                
DSPF compiled with DFRWTR *NO and WAITRCD 5 seconds:-
CRTDSPF   FILE(<yourlib>/TIMED)   SRCFILE(<yourlib>/QDDSSRC)   SRCMBR(TIMED) DFRWRT(*NO) WAITRCD(5)            

RPGLE Program Source:
**FREE
dcl-f TIMED workstn maxdev(*file); 
dcl-s x packed(2:0);               
                                   
for x = 1 to 5;                    
   FLD20 = 'COUNTER ' + %char(x);  
   write scn1;                     
   read(e) TIMED;                  
endfor;                            
                                   
*inlr = *on;                       

CRTBNDRPG   PGM(<yourlib>/TIMERPG) SRCFILE(<yourlib>/QRPGSRC) SRCMBR(TIMERPG)
Run the program from the command line:
CALL <yourlib>/TIMERPG
image-20230813204048-1
 

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHtAAM","label":"Programming ILE Languages"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

8151555

Document Information

Modified date:
09 December 2024

UID

nas8N1010188