IBM Support

RPG Example of a Window with Variable Start Position

Troubleshooting


Problem

This document contains an example of a Window with a variable starting line and column.

Resolving The Problem

The following is an example of a Window with a variable starting line and column:

DDS Source WINPOS2:
 
     A                                      CA03(03)
     A          R WINDOW1                   WINDOW(&LIN &POS 9 30)
     A  02                                  RMVWDW
     A            LIN            2S 0P
     A            POS            2S 0P
     A          R RECORD1                   WINDOW(WINDOW1)
     A            FLD1           5A     7  2
     A            FLD2          20A     8  5
     A          R DUMMY                     ASSUME
     A                                  2  3' '    
Compile using CRTDSPF   FILE(<yourlib>/WINPOS2) SRCFILE(<yourlib>/QDDSSRC) 

ILE RPG Source WINPOSR2:
**FREE
Ctl-Opt DEBUG;
Dcl-F WINPOS2    WORKSTN;
//
LIN = 5;
POS = 2;
Write WINDOW1;
Exfmt RECORD1;
LIN += 6;
Write WINDOW1;
*IN02 = '0';
Write WINDOW1;
Exfmt RECORD1;
*INLR = *ON;         
Compile using CRTBNDRPG   PGM(<yourlib>/WINPOSR2) SRCFILE(<yourlib>/QRPGLESRC)
Call from command line:
> CALL WINPOSR2 
image-20250507161519-1

Press ENTER 

image-20250507161555-2


[{"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

7991511

Document Information

More support for:
IBM i

Component:
Programming ILE Languages

Software version:
All Versions

Operating system(s):
IBM i

Document number:
683317

Modified date:
07 May 2025

UID

nas8N1010260

Manage My Notification Subscriptions