DDS concepts

Example of a subfile with paging by OS/400 program and high-level language program

The following example describes a combined method of paging a subfile that uses system resources efficiently. In some applications, the number of records in the subfile could be quite large. However, the application user may want to view only the first page or two of these records. In this case, it may be faster and more efficient for the application program to build the subfile a page at a time as requested by the user. The OS/400 program handles the paging of records in the subfile. It also returns a Page Up key indicator to the high-level language program when another page should be added to the end of the subfile. The application user can detect no difference between a page up request handled by the OS/400 program and one handled by the high-level language program.

+--------------------------------------------------------------------------------+
|                                                                                |
|NAME                               DEPARTMENT     PHONE                         |
|                                                                                |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXX     NNNN                          |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

The following keywords are important in the example:
SFLPAG
SFLSIZ

The SFLSIZ value is larger than the SFLPAG value. The subfile is paged by the SFLPAG value.

Figure 9. Subfile with Paging by OS/400 Program and High-Level Language Program in DDS

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R SETSFL                    SFL
00020A  50                                  SFLNXTCHG
00030A            NAME          30   0  5  2
00040A            DEPT          10      5 40
00050A            PHONE          4   0  5 58
00060A          R SETCTL                    SFLCTL(SETSFL)
00070A                                      SFLSIZ(0034)     (1)
00080A                                      SFLPAG(0017)
00090A  40                                  SFLDSP
00100A  41                                  SFLDSPCTL
00110A  42                                  SFLDLT
00120A  43                                  SFLCLR
00130A  49                                  SFLEND           (2)
00140A N49                                  ROLLUP(26)
00150A                                      LOCK
00160A                                      OVERLAY
00170A            SETRRN         4S 0H      SFLRCDNBR(CURSOR)(3)
00180A                                  3  2'NAME'
00190A                                  3 40'DEPARTMENT'
00200A                                  3 58'PHONE'
     A

Legend:

(1)
The SFLSIZ value must be greater than the SFLPAG value so that the OS/400 program will handle paging within the subfile. A maximum of 9 999 records can be stored in the subfile.

(2)
The SFLEND keyword can be specified with the ROLLUP keyword. One indicator can be used to option both keywords. The application program turns on the indicator to disable the Page Up key and omit the plus sign (+) on the last subfile page when the last page of the subfile is displayed.

(3)
The SFLRCDNBR keyword should be specified so the last subfile page can be displayed after it is built by the high-level language program.

Records in the subfile with changed input fields (modified data tags) will be changed after a new page is added to the subfile by the high-level language program.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]