  | 
		
HP COBOL Reference Manual
 
 
 
  
    
       
      
01 ITEMA.
   03  ITEMB OCCURS 8 TIMES.
       05  ITEMC OCCURS 10 TIMES.
           07  ITEMD PIC X.
           07  ITEME PIC XXX.
 |   
     ITEMB (1) refers to a 40-character data item, the first 10
    occurrences of ITEMC. Similarly, ITEMB (5) refers to the fifth group of
    10 occurrences of ITEMC.  ITEME (3,4) refers to ITEME in the fourth
    occurrence of ITEMC in the third occurrence of ITEMB:
 
 
  Variable occurrence data item:  When ITEMA is a receiving item,
  its size is 2128 characters. When it is a sending item, its size can
  vary from 70 to 2128 characters, depending on the value in ITEMC.
   Each ITEME is 42 characters long. Its size cannot change. The only
  effect of the value of ITEMC is to determine the number of ITEME
  occurrences.  There are 10 occurrences of ITEMH and ITEMI in each
  occurrence of ITEME.
 
  
    
       
      
01  ITEMA.
    03  ITEMB  PIC X(6).
    03  ITEMC  PIC 99.
    03  ITEMD  PIC X(20).
    03  ITEME OCCURS 1 TO 50 TIMES DEPENDING ON ITEMC.
        05 ITEMF PIC XX.
        05 ITEMG OCCURS 10 TIMES.
           07  ITEMH PIC X.
           07  ITEMI PIC XXX.
 |   
5.3.36 PAGE
Function
 
 
The PAGE clause defines the length of a logical page and the vertical
subdivisions within which report groups are presented.
  
 
page-size
is a 1- to 3-digit integer. It defines the number of lines available on
a logical page.
heading-line
is a 1- to 3-digit integer. It defines the first line number for a
REPORT HEADING or PAGE HEADING report group on the logical page.
first-detail-line
is a 1- to 3-digit integer. It defines the first line number for a
CONTROL HEADING, DETAIL, and CONTROL FOOTING report group on the
logical page.
last-detail-line
is a 1- to 3-digit integer. It defines the last line number for a
CONTROL HEADING or DETAIL report group on the logical page.
footing-line
is a 1- to 3-digit integer. It defines the last line number for a
CONTROL FOOTING report group and the first line number for the PAGE
FOOTING report group on the logical page.
 
Syntax Rules
 
 
  - The HEADING, FIRST DETAIL, LAST DETAIL, and FOOTING phrases may be
  written in any order.
  
 - page-size must not exceed three significant digits and
  must be greater than or equal to footing-line.
  
 - heading-line must be greater than or equal to one.
  
 - first-detail-line must be greater than or equal to
  heading-line.
  
 - last-detail-line must be greater than or equal to
  first-detail-line.
  
 - footing-line must be greater than or equal to
  last-detail-line.
  
 - The rules in Table 5-6 summarize the rules presented in
  Appendix D, Report Writer Presentation Rules and Tables. They indicate the vertical subdivision of the page in
  which each type of report group may appear when the PAGE clause is
  specified.
  
    - To present a REPORT HEADING report group on a page by itself (NEXT
    GROUP NEXT PAGE), define the REPORT HEADING clause to be in the
    vertical subdivision of the page extending from heading-line
    to page-size, inclusive. 
 To present a REPORT HEADING
    report group on a page with other report groups, define the REPORT
    HEADING clause to be in the vertical subdivision of the page extending
    from heading-line to first-detail-line minus one,
    inclusive.
     - A PAGE HEADING clause must be defined in the vertical subdivision
    of the page extending from heading-line to
    first-detail-line minus one, inclusive.
    
 - A CONTROL HEADING or DETAIL clause must be defined in the vertical
    subdivision of the page extending from first-detail-line to
    last-detail-line, inclusive.
    
 - A CONTROL FOOTING clause must be defined in the vertical
    subdivision of the page extending from first-detail-line to
    footing-line, inclusive.
    
 - A PAGE FOOTING clause must be defined in the vertical subdivision
    of the page extending from footing-line plus one to
    page-size, inclusive.
    
 - To present a REPORT FOOTING report group on a page by itself,
    define the REPORT FOOTING clause in the vertical subdivision of the
    page extending from heading-line to page-size,
    inclusive. 
 To present a REPORT FOOTING report group on a page with
    other report groups, define the REPORT FOOTING clause in the vertical
    subdivision of the page extending from footing-line plus one
    to page-size.
    
   - All report groups must be defined such that they can be presented
  on one logical page. The Report Writer Control System (RWCS) never
  splits a multiline report group across logical page boundaries.
  
General Rules
 
 
  - REPORT HEADING and PAGE HEADING report groups may not be presented
  on or beyond the first-detail-line.
  
 - PAGE FOOTING and REPORT FOOTING report groups must follow the
  footing-line.
  
 - If the PAGE clause is specified, the following implicit default
  values are assumed for any omitted phrases:
  
    - If the HEADING phrase is omitted, heading-line equals one.
    
 - If the FIRST DETAIL phrase is omitted, first-detail-line
    equals heading-line.
    
 - If the LAST DETAIL and FOOTING phrases are both omitted,
    last-detail-line and footing-line equal
    page-size.
    
 - If the FOOTING phrase is specified and the LAST DETAIL phrase is
    omitted, last-detail-line equals footing-line.
    
 - If the LAST DETAIL phrase is specified and the FOOTING phrase is
    omitted, footing-line equals last-detail-line.
  
  
   - If the PAGE clause is omitted, the report consists of a single page
  of infinite length with relative line numbering.
  
 - If a REPORT HEADER report group is to appear on a page with other
  report groups, the first line following the heading report groups
  (REPORT HEADER and PAGE HEADER) must be blank.
  
 - If a REPORT FOOTING report group is to appear on a page with other
  report groups, the first line preceding the footing report groups (PAGE
  FOOTING and REPORT FOOTING) must be blank.
  
Additional References
 
 
Table 5-6 shows the page regions established by the PAGE clause.
 
 
 
  Table 5-6 Page Regions Established by the PAGE Clause
  
    |   | 
    Region Boundaries  | 
   
  
    | Report Groups that Can Be Presented in a Region  | 
    First Line Number of the Region  | 
    Last Line Number of the Region  | 
    Line Positioning for the First Report Group Within the Region  | 
   
  
    
  Report Heading Described with NEXT GROUP NEXT PAGE
 
  Report Footing Described with LINE
      line-num NEXT PAGE
     | 
    
 
      heading-line
     | 
    
 
      page-size
     | 
    
  LINE-NUMBER
  plus
 
      heading-line minus 1
     | 
   
  
    | 
       
     | 
   
  
    | 
      Page Heading
     | 
    
       
     | 
    
       
     | 
    
       
     | 
   
  
    
        Report Heading Not Described with NEXT GROUP NEXT PAGE
     | 
    
 
      heading-line
     | 
    
 
first-detail-line
        minus 1
     | 
    
  LINE-NUMBER
  plus
 
      heading-line minus 1
     | 
   
  
    | 
       
     | 
   
  
    | 
      Control Heading
     | 
    
      first-detail-line
     | 
    
      last-detail-line
     | 
    
 If LINE-COUNTER is greater than or equal to
      first-detail-line, position on LINE-COUNTER plus 1
     | 
   
  
    | 
      Detail
     | 
    
       
     | 
    
       
     | 
    
If LINE-COUNTER is less than
first-detail-line, position on
      first-detail-line
     | 
   
  
    | 
       
     | 
   
  
    | 
      Control Footing
     | 
    
      first-detail-line
     | 
    
      footing-line
     | 
    
      Same as preceding
     | 
   
  
    | 
       
     | 
   
  
    | 
      Page Footing
     | 
    
      footing line
     | 
    
      page-size
     | 
    
       
     | 
   
  
    | 
Report Footing Not Described with LINE
      line-num NEXT PAGE
     | 
    
      plus 1
     | 
    
       
     | 
    
LINE-NUMBER
  plus
      footing-line
     | 
   
 
  
  
		 |