[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
Reference Manual


Previous Contents Index

D.7 Body Group Presentation Rules

Figure D-3 points to the appropriate presentation rules for all permissible combinations of LINE NUMBER and NEXT GROUP clauses in CONTROL HEADING, DETAIL, and CONTROL FOOTING report groups.

Figure D-3 Body Group Presentation Rules


Body Group Presentation Rules

  1. Upper-limit rule:
    The first line number on which a body group can be presented is the first-detail-line value in the FIRST DETAIL phrase of the PAGE clause.
  2. Lower-limit rules:
    The last line number on which a CONTROL HEADING report group or DETAIL report group can be presented is the last-detail-line value in the LAST DETAIL phrase of the PAGE clause.
    The last line number on which a CONTROL FOOTING report group can be presented is the line number specified by the footing-line value in the FOOTING phrase of the PAGE clause.
  3. Fit test rules:
    1. If the value in LINE-COUNTER is less than the integer of the first absolute LINE NUMBER clause, then the body group will appear on the page on which the report is currently positioned.
      Otherwise, the RWCS executes page-advance processing. After the PAGE HEADING report group (if defined) has been processed, the RWCS determines whether the saved-next-group-integer location was set when the final body group was presented on the preceding page. (See final LINE-COUNTER setting rule 6a.) If saved-next-group-integer was not so set, the body group will be presented on the page on which the report is currently positioned. If saved-next-group-integer was so set, the RWCS:
      • Moves the saved-next-group-integer into LINE-COUNTER
      • Resets saved-next-group-integer to zero
      • Reapplies fit test rule 3a
    2. If a body group has been presented on the page on which the report is positioned, the RWCS computes a trial sum in a work location. The trial sum is computed by adding:
      • The contents of LINE-COUNTER
      • The integers of all LINE NUMBER clauses of the report group

      If the trial sum is not greater than the body group's lower-limit integer, then the report group is presented on the current page. If the trial sum exceeds the body group's lower-limit integer, then the RWCS executes page-advance processing. After the PAGE HEADING report group (if defined) has been processed, the RWCS reapplies fit test rule 3b.
      If no body group has yet been presented on the page on which the report is currently positioned, the RWCS determines whether the saved-next-group-integer location was set when the final body group was presented on the preceding page. (See final LINE-COUNTER setting rule 6a.)
      If saved-next-group-integer was not set, the body group appears on the page on which the report is currently positioned.
      If saved-next-group-integer was set, the RWCS:
      • Moves the saved-next-group-integer into LINE-COUNTER
      • Resets saved-next-group-integer to zero
      • Computes a trial sum in a work location

      The trial sum is computed by adding:
      • The contents of LINE-COUNTER
      • The integer 1
      • The integers of all but the first LINE NUMBER clause of the body group

      If the trial sum is not greater than the body group's lower-limit integer, then the body group is presented on the current page. If the trial sum exceeds the body group's lower-limit integer, then the RWCS executes page-advance processing. After the PAGE HEADING report group (if defined) has been processed, the RWCS presents the body group on that page.
    3. If a body group has been presented on the page on which the report is currently positioned, the RWCS executes page-advance processing. After the PAGE HEADING report group (if defined) has been processed, the RWCS reapplies Fit Test rule 3c.
      If no body group has yet been presented on the page on which the report is currently positioned, the RWCS determines whether the saved-next-group-integer location was set when the final body group was presented on the preceding page. (See final LINE-COUNTER setting rule 6a). If saved-next-group-integer was not set, the body group will be presented on the page on which the report is currently positioned. If saved-next-group-integer was set, the RWCS moves saved-next-group-integer into LINE-COUNTER and resets saved-next-group-integer to zero.
      If the value in LINE-COUNTER is less than the integer of the first absolute LINE NUMBER clause, the RWCS presents the body group on the page on which the report is currently positioned. Otherwise, the RWCS executes page-advance processing. After the PAGE HEADING report group (if defined) has been processed, the RWCS presents the body group on that page.
  4. First print line position rules:
    1. The first print line of the body group appears on the line number specified by the integer of its LINE NUMBER clause.
    2. The RWCS presents the first print line of the current body group on the line immediately following the line indicated by the value contained in LINE-COUNTER if these two conditions are true:
      • The value in LINE-COUNTER is equal to or greater than the line number specified by the first-detail-line value in the FIRST DETAIL phrase of the PAGE clause.
      • No body group has previously been presented on the page on which the report is currently positioned.

      The RWCS presents the first print line of the current body group on the line that is obtained by adding the contents of LINE-COUNTER and the integer of the first LINE NUMBER clause of the current body group if these two conditions are true:
      • The value in LINE-COUNTER is equal to or greater than the line number specified by the first-detail-line value in the FIRST DETAIL phrase of the PAGE clause.
      • A body group has previously been presented on the page to which the report is currently positioned.

      If the value in LINE-COUNTER is less than the line number specified by the first-detail-line value in the FIRST DETAIL phrase of the PAGE clause, then the RWCS presents the first print line of the body group on the line specified by the FIRST DETAIL phrase.
    3. The body group is not presented.
    4. The line number on which the RWCS presents the first print line is the sum of the contents of:
      • LINE-COUNTER
      • The integer of the first LINE NUMBER clause
  5. Next group rule:
    The integer of the absolute NEXT GROUP clause (next-group-line-num) must specify a line number that is: (a) not less than that specified in the FIRST DETAIL phrase of the PAGE clause, and (b) not greater than that specified in the FOOTING phrase of the PAGE clause.
  6. Final LINE-COUNTER setting rules:
    1. If the body group that has just been presented is a CONTROL FOOTING report group and if the CONTROL FOOTING report group is not associated with the highest level at which the RWCS detected a control break, then the final LINE-COUNTER setting is the line number on which the final print line of the CONTROL FOOTING report group was presented.
      If the line number on which the final print line of the body group was presented is less than the integer of the NEXT GROUP clause, then the RWCS places the NEXT GROUP integer into LINE-COUNTER as the final LINE-COUNTER setting. If the line number on which the final print line of the body group was presented is equal to or greater than the integer of the NEXT GROUP clause, then the RWCS places the line number specified by the FOOTING phrase of the PAGE clause into LINE-COUNTER as the final LINE-COUNTER setting. In addition, the RWCS places the NEXT GROUP integer into the saved-next-group-integer location.
    2. If the body group that has just been presented is a CONTROL FOOTING report group, and if the CONTROL FOOTING report group is not associated with the highest level at which the RWCS detected a control break, then the final LINE-COUNTER setting is the line number on which the final print line of the CONTROL FOOTING report group was presented.
      For all other cases the RWCS computes a trial sum in a work location. The trial sum is computed by adding:
      • The integer of the NEXT GROUP clause
      • The line number on which the final print line of the body group was presented

      If the sum is less than the line number specified by the footing-line value in the FOOTING phrase of the PAGE clause, then the RWCS places that sum into LINE-COUNTER as the final LINE-COUNTER setting.
      If the sum is equal to or greater than the line number specified by the footing-line value in the FOOTING phrase of the PAGE clause, then the RWCS places that line number into LINE-COUNTER as the final LINE-COUNTER setting.
    3. The final LINE-COUNTER setting is the line number on which the final print line of the CONTROL FOOTING report group was presented if:
      • The body group that has just been presented is a CONTROL FOOTING report group.
      • The CONTROL FOOTING report group is not associated with the highest level at which the RWCS detected a control break.

      For all other cases the RWCS places the line number specified by the footing-line value in the FOOTING phrase of the PAGE clause into LINE-COUNTER as the final LINE-COUNTER setting.
    4. The final LINE-COUNTER setting is the line number on which the final print line of the body group was presented.
    5. LINE-COUNTER is unaffected by the processing of a nonprintable body group.
    6. The final LINE-COUNTER setting is the line number on which the RWCS presents the final print line of the CONTROL FOOTING report group if:
      • The body group that has just been presented is a CONTROL FOOTING report group.
      • The CONTROL FOOTING report group is not associated with the highest level at which the RWCS detected a control break.

      For all other cases the RWCS uses the sum of these two items as the final LINE-COUNTER setting:
      • The line number on which the final print line was presented
      • The NEXT GROUP integer


Previous Next Contents Index