SCHNAMD: DDS for a Display Device File

Figure 1. DDS for display device file SCHNAMD
     A*****************************************************************
     A*     FILE NAME:  SCHNAMD                                       *
     A*  RELATED PGMS:  SCHNAM                                        *
     A* RELATED FILES:  CUSMSTL3   (LOGICAL FILE)                     *
     A*   DESCRIPTION:  THIS IS THE DISPLAY FILE SCHNAMD. IT HAS 7    *
     A*                 RECORD FORMATS.                               *
     A*****************************************************************
     A                                      REF(CUSMSTL3)
     A                                      CHGINPDFT(CS)
     A                                      PRINT(QSYSPRT)
     A                                      INDARA
     A                                      CA03(03 'END OF JOB')
     A          R HEAD
     A                                      OVERLAY
     A                                  2  4TIME
     A                                      DSPATR(HI)
     A                                  2 25'CUSTOMER SEARCH & INQUIRY BY NAME'
     A                                      DSPATR(HI UL)
     A                                  2 70DATE
     A                                      EDTCDE(Y)
     A                                      DSPATR(HI)
     A          R FOOT1
     A                                 23  6'ENTER - Continue'
     A                                      DSPATR(HI)
     A                                 23 29'F3 - End Job'
     A                                      DSPATR(HI)
     A          R FOOT2
     A                                 23  6'ENTER - Continue'
     A                                      DSPATR(HI)
     A                                 23 29'F3 - End Job'
     A                                      DSPATR(HI)
     A                                 23 47'F4 - Restart Name'
     A                                      DSPATR(HI)
     A          R PROMPT
     A                                      OVERLAY
     A                                  5  4'Enter Search Name'
     A                                      DSPATR(HI)
     A            SRCNAM    R        I  5 23REFFLD(NAME CUSMSTL3)
     A                                      DSPATR(CS)
     A          R SUBFILE                   SFL
     A                                      CHANGE(99 'FIELD CHANGED')
     A            SEL            1A  B  9  8DSPATR(CS)
     A                                      VALUES(' ' 'X')
     A            ZIP       R        O  9 54
     A            CUST      R        O  9 43
     A            NAME      R        O  9 17
     A          R SUBCTL                    SFLCTL(SUBFILE)
     A                                      SFLSIZ(0013)
     A                                      SFLPAG(0013)
     A  55                                  SFLCLR
     A N55                                  SFLDSPCTL
     A N55                                  SFLDSP
     A                                      ROLLUP(95 'ROLL UP')
     A                                      OVERLAY
     A                                      CF04(04 'RESTART SEARCH NAME')
     A                                  5  4'Search Name'
     A            SRCNAM    R        O  5 17REFFLD(NAME CUSMSTL3)
     A                                      DSPATR(HI)
     A                                  7  6'Select'
     A                                      DSPATR(HI)
     A                                  8  6' "X"       Customer Name '
     A                                      DSPATR(HI)
     A                                      DSPATR(UL)
     A                                  8 42' Number     Zip Code   '
     A                                      DSPATR(HI)
     A                                      DSPATR(UL)
     A          R CUSDSP
     A                                      OVERLAY
     A                                  6 25'Customer'
     A            CUST           5S 0O  6 35DSPATR(HI)
     A                                  8 25'Name'
     A            NAME          20A  O  8 35DSPATR(HI)
     A                                 10 25'Address'
     A            ADDR1         20A  O 10 35DSPATR(HI)
     A            ADDR2         20A  O 11 35DSPATR(HI)
     A                                 13 25'City'
     A            CITY          20A  O 13 35DSPATR(HI)
     A                                 15 25'State'
     A            STATE          2A  O 15 35DSPATR(HI)
     A                                 15 41'Zip Code'
     A            ZIP            5S 0O 15 50DSPATR(HI)
     A                                 17 25'A/R Balance'
     A            ARBAL         10Y 2O 17 42DSPATR(HI)
     A                                      EDTCDE(J)

The DDS for the SCHNAMD display device file contains seven record formats: HEAD, FOOT1, FOOT2, PROMPT, SUBFILE, SUBCTL, and CUSDSP.

The PROMPT record format requests the user to enter a zip code and search name. If no entry is made, the display starts at the beginning of the file. The user can press F3, which sets on indicator 03, to end the program.

The SUBFILE record format must be defined immediately preceding the subfile-control record format SUBCTL. The subfile-record format defined with the keyword SFL, describes each field in the record, and specifies the location where the first record is to appear on the display (here, on line 9).

The subfile-control record format SUBCTL contains the following unique keywords:
  • SFLCTL identifies this format as the control record format and names the associated subfile record format.
  • SFLCLR describes when the subfile is to be cleared of existing records (when indicator 55 is on). This keyword is needed for additional displays.
  • SFLDSPCTL indicates when to display the subfile-control record format (when indicator 55 is off).
  • SFLDSP indicates when to display the subfile (when indicator 55 is off).
  • SFLSIZ specifies the total size of the subfile. In this example, the subfile size is 13 records that are displayed on lines 9 through 21.
  • SFLPAG defines the number of records on a page. In this example, the page size is the same as the subfile size.
  • ROLLUP indicates that indicator 95 is set on in the program when the roll up function is used.

The OVERLAY keyword defines this subfile-control record format as an overlay format. This record format can be written without the IBM® i system erasing the screen first. F4 is valid for repeating the search with the same name. (This use of F4 allows a form of roll down.)

The CUSDSP record format displays information for the selected customers.