Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For example, consider the following instance where a "departmental expenditure" file called EXPEND is read: 

Panel
No Format

       FILE:  "EXPEND"

 

                       Company    Department    Amount

                       Number      Number       Spent                        #COMPNO     #DEPNO      #AMOUNT


                       Number      Number       Spent
                       #COMPNO     #DEPNO      #AMOUNT
                         02          11        276.35


                         01          14        100.12


                         01          17        764.37


                         02          12       1945.24


                         01          19         89.12


                         02          14        568.23


                         01          15        375.89

 

                         etc, etc .......

To produce a summary of expenditure by company, we could first define a "working list" called #SUMMARY as follows:

   

...

  DEFINE   FIELD(#SUMCOMPNO)

...

 REFFLD(#COMPNO)

...

     DEFINE   FIELD(#SUMAMOUNT)

...

 REFFLD(#AMOUNT)
 

...

     DEF_LIST NAME(#SUMMARY)

...

 FIELDS(#SUMCOMPNO #SUMAMOUNT)

...

              TYPE(*WORKING)

...

 NBR_ENTRYS(50)         

...

This working list can be "visualized" as a multiple occurrence structure (or array):

...