You can use subfiles to read or write a number of records to and from a display in one operation.
Example:
The following subfile example uses DDS from T1520DDG and T1520DDH to display a list of names and telephone numbers.
CRTDSPF FILE(MYLIB/T1520DDG) SRCFILE(QCPPLE/QADDSSRC)
Figure 147. T1520DDG -- DDS Source for a Subfile Display
|
CRTPF FILE(MYLIB/T1520DDH) SRCFILE(QCPPLE/QADDSSRC)
R ENTRY
NAME 10A
PHONE 10A
David 435-5634
Florence 343-4537
Irene 255-5235
Carrie 747-5347
Michele 634-4557
CRTBNDC PGM(MYLIB/T1520SUB) SRCFILE(QCPPLE/QACSRC)
Figure 148. T1520SUB -- ILE C Source to Use Subfiles
|
This program uses _Ropen() to open subfile T1520DDG and physical file T1520DDH. The subfile is then initialized with records from the physical file. Subfile records are written to the display using the _Rwrited() function.
CALL PGM(MYLIB/T1520SUB)
+--------------------------------------------------------------------------------+ | | | | | David 435-5634 | | Florence 343-4537 | | Irene 255-5235 | | Carrie 747-5347 | | Michele 643-4557 | | | | | | | | | | <PAGE DOWN> FOR NEXT PAGE | | <PAGE UP> FOR PREVIOUS PAGE | | | | | | | +--------------------------------------------------------------------------------+
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.