You are on page 1of 3

REPORT WRITING

Report plays a vital role in commercial data processing. The reports are finished products of data processing department and ate meant for use by the management at various levels using the feature of report writer, it is possible to generate report from a sorted file very easily. The use of report writer feature reduces the effort need to code the PROCEDURE DIVISION. The relevant software that supports the report writer feature can handle the printing of the report heading, page heading, skipping to a new page, end of the page, summation of fields, INTIATE, GENERATE and TERMINATE available to programmer to specify opening, generation and closing of the report. GENERAL FORMAT OF REPORT: The programmer has to define a logical page for report writer feature. A logical page consists of fixed number of printable lines, each logical page should be of same size as that of physical page and the programmer has the liberty to define a logical page of any size. A report consists of report groups. A group in this context means one or more lines printed together on a report. Some of the report groups are: 1. Report heading: presents title of the report and printed only once in the befinning. 2. Report footing: printed at the end of the report only once and usually includes a collection of tools. 3. Page heading: printed on top of each page. It includes page number, column heading and totals from previous page. 4. Page footing: printed at bottom of every page. 5. Control footing: It takes care of control breaks in the input file from which report is being generated. 6. Control heading: It is also printed on a control break, but only before next detail group is printed. 7. Detail: This group constitutes the main body of the report. Records of input file are listed in this group. A record may be printed in one or more lines.

FILE SECTION – REPORT clause
Whenever report – writer facility is used, a line – printer file is to be specified in the file section. This file holds the report.

F.D

File – name

REPORT IS REPORTS ARE REPORT NAME-1 [,

REPORT NAME-2]

No record description should follow this entry. Report names specified must be defined in the report section with record description (R.D) entry.

REPORT SECTION:
It is another section of DATA DIVISION which should appear last in the division. Each report in the report section should be defined by means of R.D entry. The R.D entry describes the following : 1) Data items on which control takes place. 2) Size of the logical page. 3) Positions where report groups are to appear on page. RD report name.

;

CODE

literal-1

data name-2 ;

CONTROL IS … CONTROLS ARE

FINAL data name-1

; PAGE

LIMIT IS LIMITS ARE

integer-1

LINE LINES

;

HEADING

integer-2

; FIRST

DETAIL

integer-3

; LAST

DETAIL

integer-4

; FOOTING

integer-5

Code: This clause is optional and required to identify a particular report when more than one report is specified to the same printer file. CONTROL: This clause specifies names of the control date items. Order in which control data items appear in this clause determines their hierarchy. Page: This clause specifies the size of the logical page. If omitted then heading, first, last, footing clauses must also be omitted. Heading, first detail, last detail and footing: Integers in these clauses divide the logical page into different regions.