HP RPG/XL Programmer's Guide (30318-90001)

6- 4
Figure 6-2. Contents of the Source Library DACT1.SOURCE
Figure 6-3 lists the entries in the source library file, DACT2.
_____________________________________
| |
| O ACTNO |
| O FNAME |
| O LNAME |
| O ADDR1 |
| O ADDR2 |
| O ZIPCD |
| |
_____________________________________
Figure 6-3. Contents of the Source Library DACT2.SOURCE
Figure 6-4 shows, in effect, what the program looks like after the source
text is inserted. Source library text is inserted during the compilation
process; it is not incorporated as a permanent part of the source
program. In the listing, a "C" precedes the text that has been copied
and $COPY and $INCLUDE are changed to *COPY and *INCLUDE.
---------------------------------------------------------------
*COPY
$CONTROL RSPACE=2
H* EXTRACT RECORDS FROM D-ACCOUNTS
HDUMPRPG
FDACCOUNTIP F 200 200 AM DISC
F KIMAGE MARKET62
F KLEVEL READER
F KDSNAMED-ACCOUNTS
FDEXTRACTO F 200 DISC
FREPORT O F 132 132 LP
*INCLUDE DACT1
1 CIDACCOUNTNS 01
CI 3 8 ACTNO
CI 9 18 FNAME
CI 19 34 LNAME
CI 35 62 ADDR1
CI 63 90 ADDR2
CI 91 118 ADDR3
CI 119 128 ZIPCD
CI 129 134OPHONE
CI 135 136OPHEXT
CI 137 144 MAILC
CI 145 148OBDATE
CI 149 152 SRCCD
2 MI 153 154 TYPEC
CI 155 162 ADATE
3 I 1 200 RECORD
C* PERFORM FIELD COMPARES FOR RECORD SELECTION
C* .
C* .
C* .
---------------------------------------------------------------
Figure 6-4. A Source Program After Compilation
----------------------------------------------------------------
ODEXTRACTD 01 20
O RECRD 200
OREPORT H 1P
O 6 "ACCT #" R
O 18 "FIRST NAME" R
O 36 "LAST NAME " R
O 66 "ADDRESS 1 " +019
O 96 "ADDRESS 2 " +019