A SERVICE OF

logo

Passing Prototyped Parameters
*=================================================================*
* PRTADDR - Print an address
* Calls FmtAddr to format the address
*=================================================================*
FQSYSPRT O F 80 PRINTER
*-----------------------------------------------------------------*
* Prototype for FmtAddr
*-----------------------------------------------------------------*
DFmtAddr PR
D addr 70
D strno 5 0
D st 20
D cty 15 OPTIONS(*NOPASS)
D prov 15 OPTIONS(*NOPASS)
DAddress S 70
*-----------------------------------------------------------------*
* Stage1: Original address data structure.
* Only street and number are variable information.
*-----------------------------------------------------------------*
D Stage1 DS
D Street#1 5P 0 DIM(2) CTDATA
D StreetNam1 20 DIM(2) ALT(Street#1)
*-----------------------------------------------------------------*
* Stage2: Revised address data structure as city information
* now variable.
*-----------------------------------------------------------------*
D Stage2 DS
D Street#2 5P 0 DIM(2) CTDATA
D Addr2 35 DIM(2) ALT(Street#2)
D StreetNam2 20 OVERLAY(Addr2:1)
D City2 15 OVERLAY(Addr2:21)
*-----------------------------------------------------------------*
* Stage3: Revised address data structure as provincial
* information now variable.
*-----------------------------------------------------------------*
D Stage3 DS
D Street#3 5P 0 DIM(2) CTDATA
D Addr3 50 DIM(2) ALT(Street#3)
D StreetNam3 20 OVERLAY(Addr3:1)
D City3 15 OVERLAY(Addr3:21)
D Province3 15 OVERLAY(Addr3:36)
*-----------------------------------------------------------------*
* 'Program 1'- Use of FMTADDR before city parameter was added.
*-----------------------------------------------------------------*
C DO 2 X 50
C CALLP FMTADDR (Address:Street#1(X):StreetNam1(X))
C EXCEPT
C ENDDO
Figure 70 (Part 1 of 2). Source for procedure PRTADDR
144 ILE RPG for AS/400 Programmer's Guide