Skip to content

Introduction and Tutorial

This first part is a short introduction to the principles of COBOL-IT Report Writer. After reading it, you will be able to write or maintain simple report writer code and you will have enough appreciation of the more advanced concepts to be able to locate the information quickly in the main parts.

All the information given here can also be found in the more formal context of Parts 2 to 5.

Welcome to COBOL-IT Report Writer

This product has two separate purposes:

  • To improve programmer productivity in all aspects of printed output in COBOLby encouraging both experienced users and newcomers to make more use ofCOBOL's report writer feature.

  • To help users who have had experience with a version of COBOL-IT Report Writerthat was an integral part of the compiler and want to continue to use thesame facilities.

The Report Writer features are implemented in this product by means of a precompiler, rather than within the compiler itself. The compiler processes the intermediate source which the precompiler automatically passes to it. The precompiler phase is made as far as possible transparent to programmers, so that their attention is not distracted from the original report writer source. The precompiler and the compiler cooperate closely in a single-step operation and a final listing phase combines the output from both to produce a single source listing, enabling you to disregard the fact that two separate processes are involved. A description of this process will be found in Installation and Operation.

What is Report Writer?

Report Writer is COBOL's own built-in non-procedural facility for the production of printed output. It enables you to define and produce all the listings, reports, and displayed summaries that would normally be required from a COBOL application, but in far less time. It allows many more printed outputs, which might have been produced previously using stand-alone non-COBOL report generators, to be done in COBOL, because it reduces greatly the time and effort needed to code and test a COBOL program with printed output.

Report writer appeared in its original form in 1961 and later entered the 1968 ANS Standard. This version provided certain basic features that users of accounting machines were accustomed to, such as simple accumulation, cross-footing, and counter-rolling, as well as automatic page numbering. The implementation of report writer described in this volume contains all the facilities of the standard ANS-68, ANS-74, and ANS-85 report writer, plus IBM extensions, and includes many additional features which were added in various stages since 1974, many of which appear in the proposed ANS-9x standard. It is more suitable for the more varied and complex outputs needed by modern applications. There is no special term for this generalized, extended version of the language, so it is referred to in this manual simply as new Report Writer.

Compatibility With Built-In COBOL-IT Report Writer

Apart from a few insubstantial differences, listed and explained in Part 6, COBOL-IT Report Writer includes the whole of the ANS-68 Report Writer of IBM's OS/VS COBOL and DOS/VS COBOL, so if you will be using sources migrated from either of these, they should work just as they did before. Customizing with the (default) option OSVS set on ensures the highest degree of compatibility with OS/VS and DOS/VS COBOL (see Installation and Operation.) COBOL-IT Report Writer also has many completely new features that are not a part of these standards, as well as enhancements to the original features. Several of them look forward to the next ANS standard. This volume points out which features are unique to new Report Writer in a Compatibility paragraph at the end of each section. A summary list of all the enhancements will be found at the start of parts 2, 3, and 4, and in Appendix A. Those ANS-68 features that were deleted or changed in the ANS-74 and ANS-85 Standards are nevertheless retained in this product; these cases are also listed in Appendix A.

What is a report?

Wherever you see the term report in this publication, it means any human readable output that may be produced by a program. Nowadays, the term report is normally used to mean a special printout or screen produced by a report generator. We use the term in a more general sense. Any readable output, whether long or short, "one-shot" or routine, printed or not, is a report. For instance, any of the following is a report and could be produced by COBOL-IT Report Writer:

  • Pay slips and paychecks printed on a mainframe printer;
  • Invoices printed by a small remote printer;
  • A small summary print produced at the end of a large update program;
  • Sales of golf shoes, summarized by region and area, during the years 1985 to1992 (a one-time, ad hoc report);
  • An extremely complex print of personnel records with many variable-length linesand fields, "printed" on microfiche.

The only requirements for a report are that it should be readable (all fields USAGE DISPLAY only) and should consist of output only.

What does Report Writer Do?

When you write Report Writer code, you do not write a sequence of procedural statements as you would in elementary COBOL. Instead, most of your effort is spent in specifying the appearance of the report. The DATA DIVISION syntax enables you to code the layout of your printout entirely in descriptive data-oriented terms. The only "verbs" used are those that begin (INITIATE) and end (TERMINATE) the report and that GENERATE whole blocks of lines, known as report groups.

Report writer automatically generates your print record descriptions, your intermediate data areas, and all the procedural code needed to produce your outputs, saving you the effort that elementary COBOL would have required. For particularly difficult or challenging layouts, there are more advanced data clauses. By studying these in the later parts of this publication, you will learn to produce all your outputs with COBOL-IT Report Writer.

Although so much is performed automatically, you still retain control at the highest level over all operations, because no report writer action takes place until one of the statements INITIATE, GENERATE, or TERMINATE is executed. However, these statements are sufficiently high-level to require only the simplest logic in your PROCEDURE DIVISION.

Since you may use COBOL-IT Report Writer in any COBOL program, you may use it in any program that has to produce readable output - even if the program performs many other tasks. COBOL-IT Report Writer does not extract the input data itself, unlike a report generator, which means that it may be used in partnership with all types of COBOL input: standard files, databases, and subroutine or module linkage.

More information:

Back to top