Here's a technique that will not only speed development of your application programs, it will also provide consistency throughout your programs, while documenting the file structure at the same time.
Create a program file specifically for code which will dimension file arrays and equate variable names to the individual fields or attributes within a record. This code will be 'included' in the application programs when they are compiled. The following is an example of code which dimensions the CUSTOMER file and equates variable names to the individual fields within a record. It exists in a program file called FILE.DEF
Example:
FILE.DEF CUSTOMER
001
* DIMENSION AND DEFINE CUSTOMER FILE
002
DIM CUSTOMER.REC(10)
003
EQUATE CUST.NAME TO CUSTOMER.REC(1)
004
EQUATE CUST.ATTN TO CUSTOMER.REC(2)
005
EQUATE CUST.STREET TO CUSTOMER.REC(3)
006
EQUATE CUST.CITY TO CUSTOMER.REC(4)
007
EQUATE CUST.STATE TO CUSTOMER.REC(5)
008
EQUATE CUST.ZIP TO CUSTOMER.REC(6)
009
EQUATE CUST.PHONE TO CUSTOMER.REC(7)
010
EQUATE CUST.FAX TO CUSTOMER.REC(8)
011
EQUATE CUST.OPEN.INV TO CUSTOMER.REC(9)
012
EQUATE CUST.AR.BAL TO CUSTOMER.REC(10)
This code is then 'included' in the individual application programs which reference the CUSTOMER file. An example is shown in the CUST.MNT program below.
BP CUST.MNT
001
PROGRAM CUST.MNT
002
* CUSTOMER MAINTENANCE
003
* KPB 08/24/01
004
*
005
INCLUDE BP STND.VAR
006
INCLUDE FILE.DEF CUSTOMER
007
*
008
* BUILD SCREEN VARIABLE FOR DISPLAY OF FIELD HEADINGS