home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l360 / 3.ddi / REPORT.@BL / REPORT.CBL
Encoding:
Text File  |  1991-04-08  |  2.5 KB  |  64 lines

  1.       $set ans85 noosvs mf
  2.       ************************************************************
  3.       *                                                          *
  4.       *              (C) Micro Focus Ltd. 1989                   *
  5.       *                                                          *
  6.       *                     REPORT.CBL                           *
  7.       *                                                          *
  8.       *    This is a REPORT WRITER sample.                       *
  9.       *                                                          *
  10.       ************************************************************
  11.        environment division.
  12.        input-output section.
  13.        file-control.
  14.            select datafile assign to "data1.dat"
  15.            organization is line sequential.
  16.            select print-file assign to "idw.dat".
  17.        data division.
  18.        file section.
  19.        fd  datafile.
  20.            01  filler  pic x(80).
  21.        fd  print-file
  22.            record contains 80 characters
  23.            report is control-break.
  24.            01  out-buffer      pic x(80).
  25.        working-storage section.
  26.        01  temp-buffer.
  27.            05  data1   pic x(15).
  28.            05  filler  pic x(65).
  29.        01  flags.
  30.            05  eof-flag        pic xxx value "no ".
  31.                88  end-of-file         value "yes".
  32.        report section.
  33.        rd  control-break
  34.            controls are final data1
  35.            page limit is 63 lines
  36.            heading 1
  37.            first detail 5
  38.            last detail 10.
  39.        01  type is page heading.
  40.            05  line number 1.
  41.                10  column number 50    pic xxxx value "page".
  42.                10  column number 55    pic zzzz9 source page-counter.
  43.        01  detail-line type is detail.
  44.            05  line number plus 1.
  45.                10  column number 5 pic x(15) source data1.
  46.        01  type is control footing final.
  47.            05  line number plus 5.
  48.                10  column number 24    pic x(13) value "this is final".
  49.        procedure division.
  50.            open input datafile.
  51.            open output print-file.
  52.            initiate control-break.
  53.            read datafile into temp-buffer
  54.                at end move "yes" to eof-flag.
  55.            perform 010-read-and-print until end-of-file.
  56.            terminate control-break.
  57.            close datafile print-file.
  58.            stop run.
  59.  
  60.        010-read-and-print.
  61.            generate detail-line.
  62.            read datafile into temp-buffer
  63.            at end move "yes" to eof-flag.
  64.