HP 3000 Manuals

Data Division in the Report Writer Module (cont.) [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Language Reference for the Series 700 and 800

Data Division in the Report Writer Module (cont.) 

Presentation Rules Tables (cont.) 

Table 10-6  below points to the appropriate presentation rules for all
permissible combinations of LINE NUMBER and NEXT GROUP clauses in a PAGE
FOOTING report group.

          Table 10-6.  Page Footing Presentation Rules 

--------------------------------------------------------------------------------------------
|                         |                                                                |
|                         |                       Appliable Rules***                       |
|                         |                                                                |
--------------------------------------------------------------------------------------------
|                         |                                                                |
|           **            |              If the PAGE clause is specified****               |
|                         |                                                                |
--------------------------------------------------------------------------------------------
|            |            |            |            |            |            |            |
|  Sequence  |    NEXT    |   Upper    |   Lower    |   First    |    Next    |   Final    |
|  of LINE   |   GROUP    |   Limit    |   Limit    |   Print    |   Group    |   LINE-    |
|   NUMBER   |   clause   |            |            |    Line    |            |  COUNTER   |
|  clause*   |            |            |            |  Position  |            |  Setting   |
|            |            |            |            |            |            |            |
--------------------------------------------------------------------------------------------
|            |            |            |            |            |            |            |
|     AR     |  Absolute  |     1      |     2      |     3a     |     4a     |     5a     |
|            |            |            |            |            |            |            |
--------------------------------------------------------------------------------------------
|            |            |            |            |            |            |            |
|     AR     |  Relative  |     1      |     2      |     3a     |     4b     |     5b     |
|            |            |            |            |            |            |            |
--------------------------------------------------------------------------------------------
|            |            |            |            |            |            |            |
|     AR     |            |     1      |     2      |     3a     |            |     5c     |
|            |            |            |            |            |            |            |
--------------------------------------------------------------------------------------------
|            |            |            |            |            |            |            |
|            |            |            |            |     3b     |            |     5d     |
|            |            |            |            |            |            |            |
--------------------------------------------------------------------------------------------

*     See the section "Line Number Clause Notation"  for a description
      of the abbreviations used in column 1

**    A blank entry in column 1 or column 2 indicates that the named
      clause is totally absent from the report group description entry.

***   A blank entry in an applicable rules column indicates the absence
      of the named rule for the given combination of LINE NUMBER and NEXT
      GROUP clauses.

****  If the PAGE clause is omitted from the report description entry,
      then a page footing report group can not be defined.  (See the
      section "The TYPE Clause" .)

The page footing presentation rules are as follows:

   1.  Upper limit rule.

       The first line number on which the page footing report group can
       be presented is the line number obtained by adding one to the
       value of integer-5 of the FOOTING phrase of the PAGE clause.

   2.  Lower limit rule.

       The last line number on which the page footing report group can be
       presented is the line number specified by integer-1 of the PAGE
       clause.

   3.  First print line position rules.

          a.  The first print line of the page footing report group is
              presented on the line specified by the integer of its LINE
              NUMBER clause.

          b.  The page footing report group is not presented.

   4.  Next group rules.

          a.  The NEXT GROUP integer must be greater than the line number
              on which the final print line of the page footing report
              group is presented.  In addition, the NEXT GROUP integer
              must not be greater than the line number specified by
              integer-1 of the PAGE clause.

          b.  The sum of the NEXT GROUP integer and the line number on
              which the final print line of the page footing report group
              is presented must not be greater than the line number
              specified by integer-1 of the PAGE clause.

   5.  Final LINE-COUNTER setting rules.

          a.  After the page footing report group is presented, the RWCS
              places the NEXT GROUP integer into LINE-COUNTER as the
              final LINE-COUNTER setting.

          b.  After the page footing report group is presented, the RWCS
              places the sum of the NEXT GROUP integer and the line
              number on which the final print line of the PAGE FOOTING
              report group was presented into LINE-COUNTER as the final
              LINE-COUNTER setting.

          c.  After the PAGE FOOTING report group is presented the final
              LINE-COUNTER setting is the line number on which the final
              print line of the PAGE FOOTING report group was presented.

          d.  LINE-COUNTER is unaffected by the processing of a
              nonprintable report group.

Report Footing Presentation Rules.   

Table 10-7 below points to the appropriate presentation rules for all
permissible combinations of LINE NUMBER and NEXT GROUP clauses in a
report footing report group.  The report footing presentation rules are
as follows:

   1.  Upper limit rules.

          a.  If a page footing report group has been presented on the
              page to which the report is currently positioned, then the
              first line number on which the report footing report group
              can be presented is one greater than the final LINE-COUNTER
              setting established by the page footing report group.

              Otherwise the first line number on which the report footing
              report group can be presented is the line number obtained
              by adding one and the value of integer-5 of the PAGE
              clause.

          b.  The first line number on which the report footing report
              group can be presented, is the line number specified by the
              HEADING phrase of the PAGE clause.

   2.  Lower limit rule:

       The last line number on which the report footing report group can
       be presented is the line number specified by integer-1 of the PAGE
       clause.

   3.  First print line position rules:

          a.  The first print line of the report footing report group is
              presented on the line specified by the integer of its LINE
              NUMBER clause.

          b.  If a page footing report group has been presented on the
              page to which the report is currently positioned, then the
              sum of the final LINE-COUNTER setting established by the
              page footing report group and the integer of the first LINE
              NUMBER clause of the report footing report group defines
              the line number on which the first print line of the report
              footing report group is presented.  Otherwise the sum of
              the integer of the first LINE NUMBER clause of the report
              footing report group, and the line number specified by the
              value of integer-5 of the FOOTING phrase of the PAGE clause
              defines the line number on which the first print line of
              the report footing report group is presented.

          c.  The NEXT PAGE phrase in the first absolute LINE NUMBER
              clause directs that the report footing report group is
              presented on a page on which no other report group has been
              presented.  The first print line of the report footing
              report group is presented on the line number specified by
              the integer of its LINE NUMBER clause.

          d.  If LINE IS NEXT PAGE is the only LINE clause in this report
              group, the first line of the report heading report group is
              presented on line HEADING integer-2.

          e.  The sum of the content of LINE-COUNTER and the integer of
              the first LINE NUMBER clause defines the line number on
              which the first print line is presented.

          f.  The report footing report group is not presented.

   4.  Final LINE-COUNTER setting rules.

          a.  The final LINE-COUNTER setting is the line number on which
              the final print line of the report footing report group is
              presented.

          b.  LINE-COUNTER is unaffected by the processing of a
              nonprintable report group.

          Table 10-7.  Report Footing Presentation Rules 

	       Click here to view figure.
            

*     See the section "Line Number Clause Notation"  for a description
      of the abbreviations used in column 1

**    A blank entry in column 1 or column 2 indicates that the named
      clause is totally absent from the report group description entry.

***   A blank entry in an applicable rules column indicates the absence
      of the named rule for the given combination of LINE NUMBER and NEXT
      GROUP clauses.

+     See "The LINE NUMBER Clause"  

The COLUMN NUMBER Clause 

Function 

The COLUMN NUMBER clause identifies a printable item and specifies the
position of the item on a print line.

General Format 

     COLUMN NUMBER IS integer-1

Syntax Rules 

   1.  The COLUMN NUMBER clause can be specified only at the elementary
       level within a report group.  The COLUMN NUMBER clause, if
       present, must appear in or be subordinate to an entry that
       contains a LINE NUMBER clause.

   2.  Within a given print line, the printable items should be defined
       in ascending column number order such that each printable item
       defined occupies a unique sequence of contiguous character
       positions.
________________________________________________________________________
|(OSVS)                                                                |
|No restrictions on the sequence of COLUMN NUMBER clauses are          |
|enforced.                                                             |
________________________________________________________________________

            

General Rules 

   1.  The COLUMN NUMBER clause indicates that the object of a SOURCE
       clause or the object of a VALUE clause or the sum counter defined
       by a SUM clause is to be presented on the print line.  The absence
       of a COLUMN NUMBER clause indicates that the entry is not to be
       presented on a print line.

   2.  Integer-1 specifies the column number of the leftmost character
       position of the printable item.

   3.  The RWCS supplies space characters for all positions of a print
       line that are not occupied by printable items.

   4.  The leftmost position of the print line is considered to be column
       number 1.

The DATA-NAME Clause 

Function 

A data-name specifies the name of the data item being described.

General Format 

     data-name-1

Syntax Rule 

In the report section data-name-1 need not appear in a data description
entry.

General Rule 

In the Report Section, data-name-1 must be given in the following cases:

   a.  When data-name-1 represents a report group to be referred to by a
       GENERATE or a USE statement in the procedure division.

   b.  When reference is to be made to the sum counter in the procedure
       division or report section.

   c.  When a DETAIL report group is referenced in the UPON phrase of the
       SUM clause.

   d.  When data-name-1 is required to provide sum counter qualification.

The GROUP INDICATE Clause 

Function 

The GROUP INDICATE clause specifies that the associated printable item is
presented only on the first occurrence of its report group after a
control break or page advance.

General Format 

     GROUP INDICATE

Syntax Rule 

The GROUP INDICATE clause must be specified only in a DETAIL report group
entry that defines a printable item.

General Rules 

   1.  If a GROUP INDICATE clause is specified, it causes the SOURCE or
       VALUE clause to be ignored and spaces supplied, except:

          a.  On the first presentation of the DETAIL report group in the
              report, or:

          b.  On the first presentation of the DETAIL report group after
              every page advance, or:

          c.  On the first presentation of the DETAIL report group after
              every control group.

   2.  If the report description entry specifies neither a PAGE clause
       nor a CONTROL clause, then a GROUP INDICATE printable item is
       presented the first time its DETAIL is presented after the
       INITIATE statement is executed.  Thereafter spaces are supplied
       for indicated items with SOURCE or VALUE clauses.

Level-Number 

Function 

The level-number indicates the position of a data item within the
hierarchical structure of a report group.

General Format 

     level-number

Syntax Rules 

   1.  A level-number is required as the first element in each data
       description entry.

   2.  Data description entries subordinate to an RD entry must have
       level-numbers 01 through 49 only.

General Rules 

   1.  The level-number 01 identifies the first entry in a report group.

   2.  Multiple level 01 entries subordinate to a report description
       entry having the level indicator RD do not represent implicit
       redefinitions of the same area.

The LINE NUMBER Clause 

Function 

The LINE NUMBER clause specifies vertical positioning information for its
report group.

General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  Integer-1 and integer-2 must not exceed three significant digits
       in length.

       Neither integer-1 nor integer-2 can be specified in such a way as
       to cause any line of a report group to be presented outside the
       vertical subdivision of the page designated for that report group
       type, as defined by the PAGE clause.  (See the section "The PAGE
       Clause"  earlier in this chapter.)

       Integer-2 can be zero.

   2.  Within a given report group description entry, an entry that
       contains a LINE NUMBER clause must not contain a subordinate entry
       that also contains a LINE NUMBER clause.

   3.  Within a given report group description entry, all absolute LINE
       NUMBER clauses must precede all relative LINE NUMBER clauses.

   4.  Within a given report group description entry, successive absolute
       LINE NUMBER clauses must specify integers that are in ascending
       order.  The integers need not be consecutive.

   5.  If the PAGE clause is omitted from a given report description
       entry, only relative LINE NUMBER clauses can be specified in any
       report group description entry within that report.

   6.  Within a given report group description entry a NEXT PAGE phrase
       can appear only once and, if present, must be 
       in the first LINE NUMBER clause in that report group description
       entry.

   7.  A LINE NUMBER clause with the NEXT PAGE phrase can appear only in
       the description of body groups and in a REPORT FOOTING report
       group.

   8.  Every entry that defines a printable item (see the section "The
       COLUMN NUMBER Clause"  earlier in this chapter) must either
       contain a LINE NUMBER clause, or be subordinate to an entry that
       contains a LINE NUMBER clause.

   9.  The first LINE NUMBER clause specified within a PAGE FOOTING
       report group must be an absolute LINE NUMBER clause.

General Rules 

   1.  A LINE NUMBER clause must be specified to establish each print
       line of a report group.

   2.  The RWCS affects the vertical positioning specified by a LINE
       NUMBER clause, before presenting the print line established by
       that LINE NUMBER clause.

   3.  Integer-1 specifies an absolute line number.  An absolute line
       number specifies the line number on which the print line is
       presented.

   4.  Integer-2 specifies a relative line number.  If a relative LINE
       NUMBER clause is not the first LINE NUMBER clause in the report
       group description entry, then the line number on which its print
       line is presented is determined by calculating the sum of the line
       number on which the previous print line of the report group was
       presented and integer-2 of the relative LINE NUMBER clause.  If
       integer-2 is zero, the line will be printed on the same line as
       the previous print line.

       If a relative LINE NUMBER clause is the first LINE NUMBER clause
       in the report group description entry, then the line number on
       which its print line is presented is determined by specified
       rules.  (See the section "Presentation Rules Tables"  earlier
       in this chapter.)

   5.  The NEXT PAGE phrase specifies that the report group is to be
       presented beginning on the indicated line number on a new page.
       (See the section "Presentation Rules Tables"  earlier in this
       chapter.)  You need not specify integer-1 for the NEXT PAGE
       phrase.

The NEXT GROUP Clause 

Function 

The NEXT GROUP clause specifies information for vertical positioning of a
page following the presentation of the last line of a report group.
General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  A report group entry must not contain a NEXT GROUP clause unless
       the description of that report group contains at least one LINE
       NUMBER clause.

   2.  Integer-1 and integer-2 must not exceed three significant digits
       in length.

   3.  If the PAGE clause is omitted from the report description entry
       only a relative NEXT GROUP clause can be specified in any report
       group description entry within that report.

   4.  The NEXT PAGE phrase of the NEXT GROUP clause must not be
       specified in a PAGE FOOTING report group.

   5.  The NEXT GROUP clause must not be specified in a REPORT FOOTING
       report group or in a PAGE HEADING report group.

General Rules 

   1.  Any positioning of the page specified by the NEXT GROUP clause
       takes place after the presentation of the report group in which
       the clause appears.  (See the section "Presentation Rules Tables"
        earlier in this chapter.)

   2.  The RWCS uses the vertical positioning information supplied by the
       NEXT GROUP clause along with information from the TYPE and PAGE
       clauses, and the value in LINE-COUNTER, to determine a new value
       for LINE-COUNTER. (See the section "Presentation Rules Tables"  
       earlier in this chapter.)

   3.  The NEXT GROUP clause is ignored by the RWCS when it is specified
       on a CONTROL FOOTING report group that is at a level other than
       the highest level at which a control break is detected.

   4.  The NEXT GROUP clause of a body group refers to the next body
       group to be presented, and therefore can affect the location at
       which the next body group is presented.  The NEXT GROUP clause of
       a REPORT HEADING report group can affect the location at which the
       PAGE HEADING report group is presented.  The NEXT GROUP clause of
       a PAGE FOOTING report group can affect the location at which the
       REPORT FOOTING report group is presented.  (See the section
       "Presentation Rules Tables"  earlier in this chapter.)

The SIGN Clause 

Function 

The SIGN clause specifies the position and the mode of representation of
the operational sign when it is necessary to describe these properties
explicitly.

General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  The SIGN clause can be specified only for a numeric data
       description entry whose PICTURE contains the character "S".

   2.  The numeric data description entries to which the SIGN clause
       applies must be described, implicitly or explicitly, as USAGE IS
       DISPLAY.

   3.  When the SIGN clause is included in a report group description
       entry, the SEPARATE CHARACTER phrase 
       must be specified.

General Rules 

   1.  The optional SIGN clause, if present, specifies the position and
       the mode of representation of the operational sign for the numeric
       data description entry to which it applies.  The SIGN clause
       applies only to numeric data description entries whose PICTURE
       contains the character "S"; The "S" indicates the presence of, but
       neither the representation nor, necessarily, the position of the
       operational sign.

   2.  A numeric data description entry whose PICTURE contains the
       character "S", but to which no optional SIGN clause applies, has
       an operational sign, but neither the representation nor,
       necessarily, the position of the operational sign is specified by
       the character "S".  In this (default) case, General Rule 3 does
       not apply to such signed numeric data items.  The representation
       of the default operational sign is defined in the section
       Selection Of Character Representation And Radix in the chapter
       COBOL Concepts.

   3.  Since a SIGN clause in a report group description entry must
       specify the SEPARATE CHARACTER phrase, then:

          a.  The operational sign will be presumed to be the leading
              (or, respectively, trailing) character position of the
              elementary numeric data item; this character position is
              not a digit position.

          b.  The letter "S" in a PICTURE character-string is counted in
              determining the size of the item (in terms of standard data
              format characters).

          c.  The operational signs for positive and negative are the
              standard data format characters "+" , and "-",
              respectively.

   4.  Every numeric data description entry whose PICTURE contains the
       character "S" is a signed numeric data description entry.  If a
       SIGN clause applies to such an entry and conversion is necessary
       for purposes of computation or comparisons, conversion takes place
       automatically.

The SOURCE Clause 

Function 

The SOURCE clause identifies the sending data item that is moved to an
associated printable item defined within a report group description
entry.

General Format 

     SOURCE IS identifier-1

Syntax Rules 

   1.  Identifier-1 can be defined in any section of the data division.
       If identifier-1 is a report section item it must be a:

          a.  PAGE-COUNTER, or:

          b.  LINE-COUNTER, or:

          c.  Sum counter that is part of the report within which the
              SOURCE clause appears.

   2.  Identifier-1 specifies the sending data item of the implicit MOVE
       statement that the RWCS executes to move the content of the data
       item referenced by identifier-1 to the printable item.
       Identifier-1 must be defined such that it conforms to the rules
       for sending items in the MOVE statement.  (See the section The 
       MOVE Statement in the chapter The Nucleus.)

General Rule 

The RWCS formats the print lines of a report group just prior to
presenting the report group.  (See the section "The TYPE Clause"  
earlier in this chapter.)  It is at this time that the implicit MOVE
statements specified by SOURCE clauses are executed by the RWCS.

The SUM Clause 

Function 

The SUM clause establishes a sum counter and names the data items to be
summed.

General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  The data item that is the subject of the report group description
       entry in which the SUM clause appears must not be defined as
       alphabetic.  Identifier-1 must reference a numeric data item.  If
       identifier-1 is defined in the report section, identifier-1 must
       reference a sum counter.

       If the UPON phrase is omitted, any identifiers 
       in the associated SUM clause which are themselves sum 
       counters must be defined either in the same report group that
       contains this SUM clause or in a report group which is at a lower
       level in the control hierarchy of this report.

       If the UPON phrase is specified, any identifiers in the associated
       SUM clause must not be sum counters.

   2.  Data-name-1 must be the name of a DETAIL report group described in
       the same report as the CONTROL FOOTING 
       report group in which the SUM clause appears.  Data-name-1 can be
       qualified by a report-name.

   3.  A SUM clause can appear only in the description of a CONTROL
       FOOTING report group.

   4.  Data-name-2 must be one of the data-names specified on the CONTROL
       clause for this report.  Data-name-2 must not be a lower level
       control than the associated control for the report group in which
       the RESET phrase appears. 

       FINAL, if specified in the RESET phrase, must also appear in the
       CONTROL clause for this report.
________________________________________________________________________
|This rule is not enforced.  (OSVS)                                    |
________________________________________________________________________

            

   5.  The highest permissible qualifier of a sum counter is the
       report-name.

General Rules 

   1.  The SUM clause establishes a sum counter.  The sum counter is a
       numeric data item with an optional sign.  At object time, the RWCS
       adds into the sum counter the value in each data item referenced
       by identifier-1.  This addition is consistent with the rules for
       arithmetic statements.  (See the sections Arithmetic Statements 
       and Overlapping Operands in the chapter The Nucleus.)

   2.  The size of the sum counter is equal to the number of receiving
       character positions specified by the PICTURE clause that
       accompanies the SUM clause in the description of the elementary
       item.

   3.  Only one sum counter exists for an elementary report entry
       regardless of the number of SUM clauses specified in the
       elementary report entry.

   4.  If the elementary report entry for a printable item contains a SUM
       clause, the sum counter serves as a source data item.  The RWCS
       moves the data contained in the sum counter, according to the
       rules of the MOVE statement, to the printable item for
       presentation.

   5.  If a data-name appears as the subject of an elementary report
       entry that contains a SUM clause, the data-name is the name of the
       sum counter; the data-name is not the name of the printable item
       that the entry can also define.

   6.  It is permissible for procedure division statements to alter the
       contents of sum counters.

   7.  Addition of the values of the data items referenced by identifiers
       into sum counters is performed by the report writer control system
       during the execution of GENERATE and TERMINATE statements.  There
       are three categories of sum counter incrementing called
       subtotalling, crossfooting, and rolling forward.  Subtotalling is
       accomplished only during execution of GENERATE statements and
       after any control break processing but before processing of the
       DETAIL report group.  (See the section "The GENERATE Statement"
        later in this chapter.)  Crossfooting and rolling forward are
       accomplished during the processing of CONTROL FOOTING report
       groups.  (See the section "The TYPE Clause"  later in this
       chapter.)

   8.  The UPON phrase provides the capability to accomplish selective
       subtotalling for the DETAIL report groups named in the phrase.

   9.  The RWCS adds each individual addend into the sum counter at a
       time that depends upon the characteristics of the addend.

          a.  When the addend is a sum counter defined in the same
              CONTROL FOOTING report group, then the accumulation 
              of that addend into the sum counter is termed crossfooting.

              Crossfooting occurs when a control break takes place and at
              the time the CONTROL FOOTING report group is processed.

              Crossfooting is performed according to the sequence in
              which sum counters are defined within the CONTROL FOOTING
              report group.  That is, all crossfooting into the first sum
              counter defined in the CONTROL FOOTING report group is
              completed, and then all crossfooting into the second sum
              counter defined in the CONTROL FOOTING report group is
              completed.

              When one of the addends is the sum counter defined by the
              data description entry in which that SUM clause appears,
              the initial value of that sum counter at the time of
              summation is used in the summing operation.

          b.  When the addend is a sum counter defined in a lower level
              CONTROL FOOTING report group, then the accumulation of that
              addend into the sum counter is termed rolling forward.  A
              sum counter in a lower level CONTROL FOOTING report group
              is rolled forward when a control break occurs and at the
              time that the lower level CONTROL FOOTING report group is
              processed.

          c.  When the addend is not a sum counter the accumulation into
              a sum counter of such an addend is called subtotalling.  If
              the SUM clause contains the UPON phrase, the addends are
              subtotalled when a GENERATE statement for the designated
              DETAIL report group is executed.  If the SUM clause does
              not contain the UPON phrase, the addends which are not sum
              counters are subtotalled when any GENERATE data-name
              statement is executed for the report in which the SUM
              clause appears.

  10.  If two or more of the identifiers specify the same addend, then
       the addend is added into the sum counter as many times as the
       addend is referenced in the SUM clause.  It is permissible for two
       or more of the data-names to specify the same DETAIL report group.
       When a GENERATE data-name statement for such a DETAIL report group
       is given, the incrementing occurs repeatedly, as many times as
       data-name appears in the UPON phrase.

  11.  The subtotalling that occurs when a GENERATE report-name statement
       is executed is discussed in the appropriate paragraph.  (See the
       section "The GENERATE Statement"  later in this chapter.)

  12.  In the absence of an explicit RESET phrase, the report writer
       control system will set a sum counter to zero at the time that the
       report writer control system is processing the CONTROL FOOTING
       report group within which the sum counter is defined.  If an
       explicit RESET phrase is specified, then the report writercontrol
       system will set the sum counter to zero at the time that the
       report writer control system is processing the designated level of
       the control hierarchy.  (See the section "The TYPE Clause"  
       later in this chapter.)

       Sum counters are initially set to zero by the report writer
       control system during the execution of the INITIATE statement for
       the report containing the sum counter.

The TYPE Clause 

Function 

The TYPE clause specifies the particular type of report group that is
described by this entry and indicates the time at which the report group
is to be processed by the RWCS.

General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  RH is an abbreviation for REPORT HEADING.
       PH is an abbreviation for PAGE HEADING.
       CH is an abbreviation for CONTROL HEADING.
       DE is an abbreviation for DETAIL.
       CF is an abbreviation for CONTROL FOOTING.
       PF is an abbreviation for PAGE FOOTING.
       RF is an abbreviation for REPORT FOOTING.

   2.  REPORT HEADING, PAGE HEADING, CONTROL 
       HEADING FINAL, CONTROL FOOTING FINAL, PAGE 
       FOOTING, and REPORT FOOTING report groups can each appear no more
       than once in the description of a report.

   3.  PAGE HEADING and PAGE FOOTING report groups can be specified only
       if a PAGE clause is specified in the corresponding report
       description entry.

   4.  Data-name-1, data-name-2, and FINAL, if present, must be specified
       in the CONTROL clause of the corresponding report 
       description entry.
________________________________________________________________________
|This rule is not enforced with regard to FINAL. (OSVS)                |
________________________________________________________________________

            

       At most, one CONTROL HEADING report group and one CONTROL FOOTING
       report group can be specified for each data-name or FINAL in the
       CONTROL clause of the report description entry.  However, neither
       a CONTROL HEADING report group nor a CONTROL FOOTING report group
       is required for a data-name or FINAL specified in the CONTROL
       clause of the report description entry.

   5.  In CONTROL FOOTING, PAGE HEADING, PAGE FOOTING, AND REPORT FOOTING
       report groups, SOURCE clauses and USE statements must not
       reference any of the following:

          a.  Group data items containing a control data item.

          b.  Data items subordinate to a control data item.

          c.  A redefinition or renaming of any part of a control data
              item.

       In PAGE HEADING and PAGE FOOTING report groups, SOURCE clauses and
       USE statements must not reference control data-names.

   6.  When a GENERATE report-name statement is specified in the
       Procedure Division, the corresponding report description entry
       must include no more than one DETAIL report group.  If no GENERATE
       data-name statements are specified for such a report, a DETAIL
       report group is not required.

   7.  The description of a report must include at least one body group.

General Rules 

   1.  DETAIL report groups are processed by 
       the RWCS as a direct result of GENERATE statements.  If a report
       group is other than TYPE DETAIL its processing is an automatic
       RWCS function.

   2.  The REPORT HEADING phrase specifies 
       a report group that is processed by the RWCS only once, per
       report, as the first report group of that report.  The REPORT
       HEADING report group is processed during the execution of the
       chronologically first GENERATE statement for that report.

   3.  The PAGE HEADING phrase specifies a report group that is processed
       by the RWCS as the first report group on each page of that report
       except under the following conditions:

          a.  A PAGE HEADING report group is not processed 
              on a page that is to contain only a REPORT HEADING report
              group or only a REPORT FOOTING report group.

          b.  A PAGE HEADING report group is processed as the second
              report group on a page when it is preceded by a REPORT
              HEADING report group that is not to be presented on a page
              by itself.

       (See the section "Presentation Rules Tables"  earlier in this
       chapter.)

   4.  The CONTROL HEADING phrase specifies a report group that is
       processed by the RWCS at the beginning of a control group for a
       designated control data-name or, in the case of FINAL, is
       processed during the execution of the chronologically first
       GENERATE statement for that report.  During the execution of any
       GENERATE statement at which the RWCS detects a control break, any
       CONTROL HEADING report groups associated with the highest control
       level of the break and lower levels are processed.

   5.  The DETAIL phrase specifies a report group 
       that is processed by the RWCS when a corresponding GENERATE
       statement is executed.

   6.  The CONTROL FOOTING phrase specifies a report group that is
       processed by the RWCS at the end of a control group for a
       designated control data-name.

       In the case of FINAL, the CONTROL FOOTING report group is
       processed only once per report as the last body group of that
       report.  During the execution of any GENERATE statement in which
       the RWCS detects a control break, any CONTROL FOOTING report group
       associated with the highest level of the control break or more
       minor levels is presented.  All CONTROL FOOTING report groups are
       presented during the execution of the TERMINATE statement if there
       has been at least one GENERATE statement executed for the report.
       (See the section "The TERMINATE Statement"  later in this
       chapter.)

   7.  The PAGE FOOTING phrase specifies a 
       report group that is processed by the RWCS as the last report
       group on each page except under the following conditions:

          a.  A PAGE FOOTING report group is not processed on a page that
              is to contain only a REPORT HEADING report group or only a
              REPORT FOOTING report group.

          b.  A PAGE FOOTING report group is processed as the second to
              last report group on a page when it is followed by a REPORT
              FOOTING report group that is not to be processed on a page
              by itself.

       (See the section "Presentation Rules Tables"  earlier in this
       chapter.)

   8.  The REPORT FOOTING phrase specifies a report group that is
       processed by the RWCS only once per report and as the last report
       group of that report.  The REPORT FOOTING report group is
       processed during the execution of a corresponding TERMINATE
       statement, if there has been at least one GENERATE statement
       executed for the report.  (See the section "The TERMINATE
       Statement"  later in this chapter.)

   9.  The sequence of steps that the RWCS executes when it processes a
       REPORT HEADING, PAGE HEADING, CONTROL HEADING, PAGE FOOTING, or
       REPORT FOOTING report group is described below.

          a.  If there is a USE BEFORE REPORTING procedure that
              references the data-name of the report group, the USE
              procedure is executed.

          b.  If a SUPPRESS statement has been executed 
              or if the report group is not printable, there is no
              further processing to be done for the report group.

          c.  If a SUPPRESS statement has not been executed and the
              report group is printable, the RWCS formats the print lines
              and presents the report group according to the presentation
              rules for that type of report group.  (See the section
              "Presentation Rules Tables"  earlier in this chapter.)

  10.  The sequence of steps that the RWCS executes when it processes a
       CONTROL FOOTING report group is described below.

       The GENERATE rules specify that when a control break occurs, the
       RWCS produces the CONTROL FOOTING report groups beginning at the
       minor level, and proceeding upwards, through the level at which
       the highest control break was sensed.  In this regard, it should
       be noted that even though no CONTROL FOOTING report group has been
       defined for a given control data-name, the RWCS will still have to
       execute the step described in rule 10f.  below if a RESET phrase
       within the report description specifies that control data-name.

          a.  Sum counters are crossfooted; that is, all sum counters
              defined in this report group that are operands of SUM
              clauses in the same report group are added to their sum
              counters.  (See the section "The SUM Clause"  earlier in
              this chapter.)

          b.  Sum counters are rolled forward; that is, all 
              sum counters defined in the report group that are operands
              of SUM clauses in higher level CONTROL FOOTING report
              groups are added to the higher level sum counters.  (See
              the section "The SUM Clause"  earlier in this chapter.)

          c.  If there is a USE BEFORE REPORTING procedure that
              references the data-name of the report group the USE
              procedure is executed.

          d.  If a SUPPRESS statement has been executed or if the report
              group is not printable, the RWCS next executes the step
              described in rule 10e.  below.

          e.  If a SUPPRESS statement has not been executed and the
              report group is printable, the RWCS formats the print lines
              and presents the report group according to the presentation
              rules of CONTROL FOOTING report groups.

          f.  Then the RWCS resets those sum counters that are to be
              reset when the RWCS processes this level in the control
              hierarchy.  (See the section "The SUM Clause"  earlier
              in this chapter.)

  11.  The DETAIL report group processing that 
       the RWCS system executes in response to a GENERATE data-name
       statement is described in rules 11a.  through 11e.  below.

       When the description of a report includes exactly one DETAIL
       report group, the detail-related processing that the RWCS executes
       in response to a GENERATE report-name statement is described in
       rules 11a.  through 11e.  below.  These steps are performed as
       though a GENERATE data-name statement were being executed.

       When the description of a report includes no DETAIL report groups,
       the detail-related processing that the RWCS executes in response
       to a GENERATE report-name statement is described in rule 11a.
       below.  This step is performed as though the description of the
       report included exactly one DETAIL report group, and a GENERATE
       data-name statement were being executed.

          a.  The RWCS performs any subtotalling that has been designated
              for the DETAIL report group.  (See the section 
              "The SUM Clause"  earlier in this chapter.)

          b.  If there is a USE BEFORE REPORTING procedure that refers to
              the data-name of the report group, the USE procedure is
              executed.

          c.  If a SUPPRESS statement has been executed or if the report
              group is not printable there is no further processing done
              for the report group.

          d.  If the DETAIL report group is being processed as a
              consequence of a GENERATE report-name statement, there is
              no further processing done for the report group.

          e.  If neither 11c.  nor 11d.  above applies, the RWCS formats
              the print lines and presents the report group according to
              the presentation rules for DETAIL report groups.  (See the
              section "Presentation Rules Tables"  earlier in this
              chapter.)

  12.  When the RWCS is processing a CONTROL HEADING, CONTROL FOOTING, or
       DETAIL report group, as described in General Rules 9, 10, and 11,
       the RWCS can have to interrupt the processing of that body group
       after determining that the body group is to be presented, and
       execute a page advance ( and process PAGE FOOTING and PAGE HEADING
       report groups) before actually presenting the body group.

  13.  During control break processing, the values of control data items
       that the RWCS used to detect a given control break are referred to
       as prior values. 

          a.  During control break processing of a CONTROL FOOTING report
              group, any references to control data items in a USE
              procedure or SOURCE clause associated with that CONTROL
              FOOTING report group are supplied with prior values.

          b.  When a TERMINATE statement is executed, the RWCS makes the
              prior control data item values available to SOURCE clause
              or USE procedure references in CONTROL FOOTING and REPORT
              FOOTING report groups as though a control break had been
              detected in the highest control data-name.

          c.  All other data item references within report groups and
              their USE procedures access the current values that are
              contained within the data items at the time the report
              group is processed.

The USAGE Clause 

Function 

The USAGE clause specifies the format of a data item in the computer
storage.

General Format 

	       Click here to view figure.
            

Syntax Rules 

   1.  The USAGE clause can be written in any data description entry.

   2.  If the USAGE clause is written in the data description entry for a
       group item, it can also be written in the data description entry
       for a subordinate elementary item or group item.

   3.  The USAGE clause for a report group item can specify only USAGE IS
       DISPLAY.

General Rules 

   1.  If the USAGE clause is written at a group level, it applies to
       each elementary item in the group.

   2.  The USAGE clause specifies the manner in which a data item is
       represented in the storage of a computer.  It does not affect the
       use of the data item, although the specifications for some
       statements in the procedure division can restrict the USAGE clause
       of the operands referred to.  The USAGE clause can affect the
       radix or type of character representation of the item.

   3.  The USAGE IS DISPLAY clause indicates that the format of the data
       is a standard data format.

   4.  If the USAGE clause is not specified for an elementary item, or
       for any group to which the item belongs, the usage is implicitly
       DISPLAY.

The VALUE Clause 

Function 

The VALUE clause defines the value of Report Section printable items.

General Format 

     VALUE IS literal-1

Syntax Rules 

   1.  A signed numeric literal must have associated with it a signed
       numeric PICTURE character-string.

   2.  A numeric literal in a VALUE clause of an item must have a value
       which is within the range of values indicated by the PICTURE
       clause, and must not have a value which would require truncation
       of nonzero digits.  A nonnumeric literal in a VALUE clause of an
       item must not exceed the size indicated by the PICTURE clause.

General Rules 

   1.  The VALUE clause must not conflict with other clauses in the data
       description of the item or in the data description within the
       hierarchy of the item.  The following rules apply:

          a.  If the category of the item is numeric, literal-1 in the
              VALUE clause must be numeric.

          b.  If the category of the item is alphabetic, alphanumeric,
              alphanumeric edited, or numeric edited, literal-1 in the
              VALUE clause must be a nonnumeric literal.  The literal is
              aligned in the data item as if the data item had been
              described as alphanumeric (See the section Standard 
              Alignment Rules in the chapter COBOL Concepts).  Editing
              characters in the PICTURE clause are included in
              determining the size of the data item but have no effect on
              initialization of the data item (see the section The 
              PICTURE Clause in the chapter The Nucleus).  Therefore, the
              value for an edited item must be specified in an edited
              form.

          c.  Initialization is not affected by any BLANK WHEN ZERO or
              JUSTIFIED clause that can be specified.

   2.  In the report section, if the elementary report entry containing
       the VALUE clause does not contain a GROUP INDICATE clause, then
       the printable item will assume the specified value each time its
       report group is printed.  However, when the GROUP INDICATE clause
       is also present, the specified value will be presented only when
       certain object item conditions exist (see the section The GROUP 
       INDICATE Clause in the chapter Segmentation).



MPE/iX 5.0 Documentation