IBM AS/400 Frozen Dessert Maker User Manual


 
Search by Zip Code
The zip code (ZIP) is used to position the CUSMSTL2 file by the SETLL operation.
Notice that the record format name CMLREC2 is used in the SETLL operation
instead of the file name CUSMSTL2. If no record is found, an error message is
displayed.
The SFLPRC subroutine handles the processing for the subfile: clearing, filling, and
displaying. The subfile is prepared for additional requests in subroutine SFLCLR. If
indicator 55 is on, no action occurs on the display, but the main storage area for
the subfile records is cleared. The SFLFIL routine fills the subfile with records. A
record is read from the CUSMSTL2 file. If the zip code is the same, the record
count (RECNUM) is incremented and the record is written to the subfile. This sub-
routine is repeated until either the subfile is full (indicator 21 on the WRITE opera-
tion) or end of file occurs on the CUSMSTL2 file (indicator 71 on the READE
operation). When the subfile is full or end of file occurs, the subfile is written to the
display by the EXFMT operation by the subfile-control record control format. The
user reviews the display and decides whether:
To end the program by pressing F3.
To restart the zip code by pressing F4. The PROMPT record format is not dis-
played, and the subfile is displayed starting over with the same zip code.
To fill another page by pressing ROLL UP. If end of file has occurred on the
CUSMSTL2 file, the current page is re-displayed; otherwise, the subfile is
cleared and the next page is displayed.
To continue with another zip code by pressing ENTER. The PROMPT record
format is displayed. The user can enter a zip code or end the program.
In Figure 185, the user enters a zip code in response to the prompt.
22:34:38 CUSTOMER SEARCH BY ZIP 9/30/94
Enter Zip Code 11201
ENTER - Continue F3 - End Job
Figure 185. 'Customer Search by Zip' prompt screen
The subfile is written to the screen as shown in Figure 186 on page 364.
Chapter 19. Example of an Interactive Application 363