Overlay a display file record format with the subfield of a data structure

Discussions relating to writing software in ILE RPG (RPG IV). This includes both fixed and free format RPG.
Post Reply
LUCAG
Posts: 9
Joined: Tue Mar 28, 2023 9:00 am

Overlay a display file record format with the subfield of a data structure

Post by LUCAG »

Hello everyone, to your knowledge is it possible to define in freeform a data structure that overlays the record format of a display file?
In practice, I have a display file called VIDEO1, which contains a REC1 record format. REC1 has three input fields if1, if2, if3 and two output fields of1, of2.

After defining

Code: Select all

Dcl-F VIDEO1 WORKSTN INDDS(dspf1) usropn;
how can i define something like

Code: Select all

dcl-ds rec1ds likerec(REC1:*all); 
but in a way that rec1ds.if1 and IF1 share the same memory and the same content?
Scott Klement
Site Admin
Posts: 909
Joined: Sun Jul 04, 2021 5:12 am

Re: Overlay a display file record format with the subfield of a data structure

Post by Scott Klement »

Can you explain why you want to do this?
Post Reply