Troubleshooting
Problem
This document demonstrates how to keep informational displays on the screen while a program is running and invoking other programs.
Resolving The Problem
This document demonstrates how to keep informational displays on the screen while a program is running and invoking other programs. Two sample cases are provided:
CL Source for Program XDELAY
ILE RPG Source for Program XSTSRPGLE

|
1. |
ILE RPG IV program XSTSRPGLE puts up an informational display, then calls CL program XDELAY to introduce a delay of a few seconds. During this time the informational display remains visible. XSTSRPGLE repeats this sequence twice, with slightly different informational text each time. |
| 2. | ILE CL program XSTSCLLE puts up an informational display, then calls CL program XDELAY to introduce a delay of a few seconds. During this time the informational display remains visible. XSTSCLLE repeats this sequence twice, with slightly different informational text each time. |
The sample source code follows:
DDS Source for Display File XDSPF
DDS Source for Display File XDSPF
* This display file is used to show informational screens at runtime.
* Note the file-level keyword INVITE, which in this case is used to keep
* the screen up.
*
A DSPSIZ(24 80 *DS3)
A INVITE
* Record definition for informational window.
A R WIN001
* Window size and border definition.
A WINDOW(7 15 12 50)
A WDWBORDER((*COLOR RED) -
A (*DSPATR RI) -
A (*CHAR '12345678'))
* Top window title.
A WDWTITLE( -
A (*TEXT 'TOP WINDOW TITLE') -
A (*COLOR WHT) -
A (*DSPATR RI) -
A *CENTER -
A *TOP)
* Bottom window title.
A WDWTITLE( -
A (*TEXT 'BOTTOM WINDOW TITLE') -
A (*COLOR WHT) -
A (*DSPATR RI) -
A *CENTER -
A *BOTTOM)
* Variable text filled in by the program which drives the display file.
A VARTEXT 10A O 2 21
* System date and time.
A 2 2DATE(*SYS)
A EDTCDE(Y)
A 2 41TIME
* Informational text. This can be replaced with literal text appropriate
* to the specific application.
A 4 16'INFORMATIONAL LINE 1'
A DSPATR(RI)
A COLOR(BLU)
A 5 16'INFORMATIONAL LINE 2'
A DSPATR(HI)
A COLOR(WHT)
A 6 16'INFORMATIONAL LINE 3'
A DSPATR(RI)
A COLOR(TRQ)
A 7 16'INFORMATIONAL LINE 4'
A DSPATR(HI)
A COLOR(YLW)
CL Source for Program XDELAY
/* This sample program is only used to introduce a slight delay in processing.*/
/*In actual applications, calls to XDELAY would be replaced by calls to + */
/* appropriate routines */
PGM
DLYJOB DLY(5)
ENDPGM
ILE RPG Source for Program XSTSRPGLE
**FREE
// Use external display file XDSPF to show informational screens
Dcl-F xdspf WORKSTN Usage(*Output);
// Prototype for XDELAY
Dcl-Pr Pgm_XDELAY ExtPgm('XDELAY') End-Pr;
// Set variable text for first informational screen
vartext = 'RPG test 1';
// Display informational screen
Write win001;
// Invoke sample program
Pgm_XDELAY();
// Set variable text for second informational screen
vartext = 'RPG test 2';
// Display informational screen
Write win001;
// Invoke sample program
Pgm_XDELAY();
// End program
*inlr = *on;
CL Source for Program XSTSCLLE
PGM
/* Use external display file XDSPF to show informational screens */
DCLF FILE(XDSPF)
/* Set variable text for first informational screen */
CHGVAR VAR(&VARTEXT) VALUE('CL test 1')
/* Display informational screen */
SNDF RCDFMT(WIN001)
/* Invoke sample program */
CALL PGM(XDELAY)
/* Set variable text for second informational screen */
CHGVAR VAR(&VARTEXT) VALUE('CL test 2')
/* Display informational screen */
SNDF RCDFMT(WIN001)
/* Invoke sample program */
CALL PGM(XDELAY)
ENDPGM
CALL XSTSCLE


[{"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":"a8m3p0000006x8GAAQ","label":"CL"},{"code":"a8m0z0000000CHtAAM","label":"Programming ILE Languages"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
21254146
Was this topic helpful?
Document Information
Modified date:
15 November 2024
UID
nas8N1017606