IBM manual Search by Zip Code, ILE RPG for AS/400 Programmers Guide

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 386
Image 386

Search by Zip Code

********************************************************************

*

SUBROUTINE - SFLPRC

 

 

*

*

PURPOSE

- PROCESS SUBFILE AND DISPLAY

*

********************************************************************

C

SFLPRC

BEGSR

 

 

 

C

NXTPAG

TAG

 

 

 

C

 

EXSR

SFLCLR

 

 

C

 

EXSR

SFLFIL

 

 

C

SAMPAG

TAG

 

 

 

C

 

WRITE

FOOT2

 

 

C

 

WRITE

HEAD

 

 

C

 

EXFMT

SUBCTL

 

 

C

 

IF

*IN95

 

 

C

 

IF

NOT *IN71

 

 

C

 

GOTO

NXTPAG

 

 

C

 

ELSE

 

 

 

C

 

GOTO

SAMPAG

 

 

C

 

ENDIF

 

 

 

C

 

ENDIF

 

 

 

C

 

ENDSR

 

 

 

********************************************************************

*

SUBROUTINE - SFLFIL

 

 

*

*

PURPOSE

- FILL SUBFILE

 

*

********************************************************************

C

SFLFIL

BEGSR

 

 

 

C

 

DOW

NOT *IN21

 

 

C

ZIP

READE

CMLREC2

 

71

C

 

IF

*IN71

 

 

C

 

MOVE

*ON

*IN21

 

C

 

ELSE

 

 

 

C

 

ADD

1

RECNUM

 

C

 

WRITE

SUBFILE

 

21

C

 

ENDIF

 

 

 

C

 

ENDDO

 

 

 

C

 

ENDSR

 

 

 

********************************************************************

*

SUBROUTINE - SFLCLR

 

 

*

*

PURPOSE

- CLEAR SUBFILE RECORDS

 

*

********************************************************************

C

SFLCLR

BEGSR

 

 

 

C

 

MOVE

*ON

*IN55

 

C

 

WRITE

SUBCTL

 

 

C

 

MOVE

*OFF

*IN55

 

C

 

MOVE

*OFF

*IN21

 

C

 

Z-ADD

*ZERO

RECNUM

5 0

C

 

ENDSR

 

 

 

 

 

 

 

 

Figure

184 (Part

2 of 2).

Source for module SCHZIP

 

The file description specifications identify the disk file to be sea display device file to be used (SZIPMENU). The SFILE keyword for the file identifies the record format (SUBFILE) that is to be used as relative-record-number field (RECNUM) specified controls which record with subfile is being accessed.

The program displays the PROMPT record format and waits for the worksta user's response. F3 sets on indicator 03, which controls the end of th

362 ILE RPG for AS/400 Programmer's Guide

Page 386
Image 386
IBM manual Search by Zip Code, ILE RPG for AS/400 Programmers Guide