IBM AS/400 Frozen Dessert Maker User Manual


 
Passing Prototyped Parameters
*=================================================================*
* SUBROUTINE: GetStreet#
* Get the character form of the street number, left-adjusted *
* and padded on the right with blanks. *
*=================================================================*
C GetStreet# BEGSR
C MOVEL Street# CStreet# 10
*-----------------------------------------------------------------*
* Find the first non-zero. *
*-----------------------------------------------------------------*
C '0' CHECK CStreet# Non0 5 0
*-----------------------------------------------------------------*
* If there was a non-zero, substring the number starting at *
* non-zero. *
*-----------------------------------------------------------------*
C IF Non0 > 0
C SUBST(P) CStreet#:Non0 CStreet#
*-----------------------------------------------------------------*
* If there was no non-zero, just use '0' as the street number. *
*-----------------------------------------------------------------*
C ELSE
C MOVEL(P) '0' CStreet#
C ENDIF
C ENDSR
Figure 68 (Part 2 of 2). Source for procedure FMTADDR
*=================================================================*
* Prototype for FMTADDR - format an address
*=================================================================*
DFmtAddr PR
D addr 70
D strno 5 0 CONST
D st 20 CONST
D cty 15 OPTIONS(*NOPASS) CONST
D prov 15 OPTIONS(*NOPASS) CONST
Figure 69. Source for /COPY member with Prototype for Procedure FMTADDR
Figure 70 on page 144 shows the source for the procedure PRTADDR. This pro-
cedure serves to illustrate the use of FMTADDR. For convenience, the three proce-
dures which would each call FMTADDR are combined into this single procedure.
Also, for the purposes of the example, the data is program-described.
Since PRTADDR is 'three procedures-in-one', it must define three different
address data structures. Similarly, there are three parts in the calculation specifica-
tions, each one corresponding to programs at each stage. After printing the
address, the procedure PRTADDR ends.
Chapter 10. Calling Programs and Procedures 143