You can use Data Description Specifications (DDS) to describe files at the field level to the operating system. In DDS, each record format in an externally described file is identified by a unique record format name.
The record format specifications describe the fields in a record and the location of the fields in a record. The fields are located in the record in the order specified in DDS. The field description generally includes the field name, the field type (character, binary, external decimal, internal decimal, internal floating-point), and the field length (including the number of decimal positions in a numeric field). Instead of being specified in the record format for a physical or logical file, the field attributes can be defined in a field reference file. (See Figure 93.)
The keys for a record format are specified in DDS. When you use a Format 2 COPY statement, a table of comments is generated in the source program listing showing how the keys for the format are defined in DDS.
In addition, DDS keywords can be used to:
For a complete list of the DDS keywords that are valid for a database file, refer to the Database and File Systems category in the i5/OS Information Center at this Web site -http://www.ibm.com/systems/i/infocenter/.
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A**FLDREF DSTREF DISTRIBUTION APPLICATION FIELDS REFERENCE
A R DSTREF TEXT('DISTRIBUTION FIELD REF')
A* COMMON FIELDS USED AS REFERENCE
1 A BASDAT 6 0 EDTCDE(Y)
A TEXT('BASE DATE FIELD')
A* FIELDS USED BY CUSTOMER MASTER FILE
2 A CUST 5 CHECK(MF)
A COLHDG('CUSTOMER' 'NUMBER')
A NAME 20 COLHDG('CUSTOMER NAME')
3 A ADDR R REFFLD(NAME)
A COLHDG('CUSTOMER ADDRESS')
A CITY R REFFLD(NAME)
A COLHDG('CUSTOMER CITY')
2 A STATE 2 CHECK(MF)
A COLHDG('STATE')
A SRHCOD 6 CHECK(MF)
A COLHDG('SEARCH' 'CODE')
A TEXT('CUSTOMER NUMBER SEARCH CODE')
2 A ZIP 5 0 CHECK(MF)
A COLHDG('ZIP' 'CODE')
4 A CUSTYP 1 0 RANGE(1 5)
A COLHDG('CUST' 'TYPE')
A TEXT('CUSTOMER TYPE 1=GOV 2=SCH 3=B+
A US 4=PT 5=OTH')
5 A ARBAL 8 2 COLHDG('ACCTS REC' 'BALANCE')
A EDTCDE(J)
6 A ORDBAL R REFFLD(ARBAL)
A COLHDG('A/R AMT IN' 'ORDER FILE')
A LSTAMT R REFFLD(ARBAL)
A COLHDG('LAST' 'AMOUNT' 'PAID')
7 A TEXT('LAST AMOUNT PAID IN A/R')
A LSTDAT R REFFLD(ARBAL)
A COLHDG('LAST' 'DATE' 'PAID ')
A TEXT('LAST DATE PAID IN A/R')
A CRDLMT 8 2 COLHDG('CUSTOMER' 'CREDIT' 'LIMIT')
A EDTCDE(J)
A SLSYR 10 2 COLHDG('CUSTOMER' 'SALES' 'THIS YEAR')
A EDTCDE(J)
A SLSLYR 10 2 COLHDG('CUSTOMER' 'SALES' 'LAST YEAR')
A EDTCDE(J)This example of a field reference file (Figure 93) shows the definitions of the fields that are used by the CUSMSTL (customer master logical) file, which is shown in Figure 94. 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.