IBM AS/400 User Manual

Page of 489
 
Using Externally Described Disk Files
 
 
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*
A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++++*
A**FLDRED
DSTREF
DISTRIBUTION APPLICATION FIELD REFERENCE
A
R DSTREF
TEXT('Distribution Field Ref')
A* COMMON FIELDS USED AS REFERENCE
BASDAT
6
0
EDTCDE(Y) .1/
A
TEXT('Base Date Field')
A* FIELDS USED BY CUSTOMER MASTER FILE
CUST
5
CHECK(MF) .2/
COLHDG('Customer' 'Number')
A
NAME 
20 
COLHDG('Customer Name')
ADDR
R
REFFLD(NAME) .3/
COLHDG('Customer Address')
CITY
R
REFFLD(NAME) .3/
COLHDG('Customer City')
A
STATE 
CHECK(MF) .2/
COLHDG('State')
SRHCOD
6
CHECK(MF) .2/
COLHDG('Search' 'Code')
A
TEXT('Customer Number Search +
Code')
ZIP 
5
0
CHECK(MF) .2/
COLHDG('Zip' 'Code')
A
CUSTYP
1
0
RANGE(1 5) .4/
COLHDG('Cust' 'Type')
A
TEXT('Customer Type 1=Gov 2=Sch+
A
3=Bus 4=Pvt 5=Oth')
A
ARBAL
8
2
COLHDG('Accts Rec' 'Balance') .5/
EDTCDE(J) .6/
ORDBAL
R
REFFLD(ARBAL)
A
COLHDG('A/R Amt in' 'Order +
File')
LSTAMT
R
REFFLD(ARBAL)
A
COLHDG('Last' 'Amount' 'Paid')
A
TEXT('Last Amount Paid in A/R')
LSTDAT
R
REFFLD(BASDAT)
A
COLHDG('Last' 'Date' 'Paid')
A
TEXT('Last Date Paid in A/R')
CRDLMT
R
REFFLD(ARBAL)
COLHDG('Credit' 'Limit')
A
TEXT('Customer Credit Limit')
SLSYR
R+
2
REFFLD(ARBAL)
A
COLHDG('Sales' 'This' 'Year')
A
TEXT('Customer Sales This Year')
SLSLYR
R+
2
REFFLD(ARBAL)
A
COLHDG('Sales' 'Last' 'Year')
A
TEXT('Customer Sales Last Year') .7/
Figure  140.  Example of a field Reference File
This example of a field-reference file shows the definitions of the fields that are
used by the CUSMSTL (customer master logical) file as shown in Figure 139 on
page 283. The field-reference file normally contains the definitions of fields that are
used by other files. The following text describes some of the entries for this field-
reference file.
.1/
The BASDAT field is edited by the Y edit code, as indicated by the
keyword EDTCDE(Y). If this field is used in an externally described
output file for an ILE RPG program, the edit code used is the one speci-
fied in this field-reference file; it cannot be overridden in the ILE RPG
program. If the field is used in a program-described output file for an ILE
284
ILE RPG for AS/400 Programmer's Guide