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

5- 17
Figure 5-13. Using a Local Data Area File (LDAFILE)
Comments
1 This line defines the file used for printing the report.
2 This line defines the Local Data Area file and begins the data
structure description for it. Notice that you do not use a File
Description Specification for a Local Data Area file.
Columns 7-14 contain LDA to identify this structure as a Local
Data Area structure. You must use LDA; other names are ignored.
Column 18 contains U to specify that this is a User Data
Structure (the data structure for the Local Data Area file).
Columns 19-20 contain DS to identify this as a data structure.
3 This line defines the first field, CNAME, of the data structure.
It is 40 characters long and starts in the first position of the
record. CNAME contains the company name.
4 This line defines the second field, COUNT, of the data
structure. It is 5 positions long and starts in position 101.
It contains the count of transactions.
5 This line increments the COUNT field.
6 This line begins the Output Specification that writes the
company name, CNAME, to the report file.
Using Subroutines
When there are a set of operations that you perform repeatedly from
different parts of your program, you should code them once as a
subroutine. Then, when you want to execute the subroutine, you enter a