GENERATE

Produce either a detail report or a summary report; test controls; generate control breaks; print totals, detail lines, headings, and footings; clear counters and accumulators; and, paginate the report.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Syntax:

GENERATE dataname|reportname

Parameters:

dataname Produce a detail report. Specify dataname in the TYPE clause as DETAIL.
reportname Produce a summary report that contains no detail lines. Use reportname only if the referenced report group description contains a CONTROL clause, at least one REPORT HEADING, REPORT FOOTING, CONTROL HEADING, CONTROL FOOTING, or DETAIL group, and no more than one DETAIL report group

Comments:

  • On first GENERATE clause execution, AMB saves the control values. During other GENERATE executions, AMB tests these control values to determine control breaks until it detects one. When a control break occurs, AMB saves the new set of control values.
  • During report printing, AMB processes PAGE HEADING and PAGE FOOTING report groups for each page.
  • When the first GENERATE clause of a report executes, AMB processes, in order, the report groups defined in the report description-- REPORT HEADING, PAGE HEADING, and CONTROL HEADINGs, (from major to minor order).
  • When GENERATE dataname executes, AMB processes the designated report group. When GENERATE reportname executes, AMB performs certain steps to process a DETAIL report group.
  • When a GENERATE clause other than the first one executes, AMB locates control breaks. The rules for determining the equality of control data items are the same as for relation conditions. If a control break occurs
    • CONTROL FOOTING, USE procedures and CONTROL FOOTING, SOURCE statements are able to access the control data item values.
    • AMB processes the CONTROL FOOTING report groups in minor to major order. AMB does not process the CONTROL FOOTING report groups of a higher level than where the control break occurs.
    • AMB processes the CONTROL HEADING report groups in major to minor order. AMB does not process the CONTROL HEADING report groups of a higher level than where the control break occurs.
  • GENERATE processing can only occur after INITIATE processing and before TERMINATE processing, for the report.