Contents
REPORT statements define the characteristics of reports such as the number of lines per page, line length, and so on. For basic reporting you may code a REPORT statement yourself, but usually you’ll let the Jazz assume or create one. REPORT … DISPLAY defines output for DISPLAY statements.
REPORT statements have this general format: -
REPORT [(nbr)] [Option]…
If present,
a REPORT
statement must precede the first PRINT statement for the report. REPORT
statements may be omitted, in which case Jazz will assume characteristics as if
a REPORT
statement with PAGESIZE(60) WIDTH(132) is present.
REPORT
used with DISPLAY
statements has a special form, and is created for you during Easytrieve
conversion.
This applies to REPORT used with PRINT statements.
(nbr) This allows one program to print several separate reports, and corresponds to the REPORT(nbr) option on PRINT statements. For example,
PROGRAM Repts BATCH;
DEFINE R1 … DATA(
…);
REPORT(1) PAGE(50) WIDTH(120);
REPORT(2) PAGE(60) WIDTH(132);
PROCESS R1;
PRINT (R1.A, …) REPORT(1);
IF condition THEN
PRINT (…) REPORT(2);
END IF;
END PROCESS R1;
Although it is quite easy to create a Jazz program that produces several reports, since the sequence of lines in the report is controlled by the overall program logic, particularly the sequence of records read by PROCESS statements, mostly you’ll write programs producing only one report.
If (nbr) is omitted then (1) is assumed. Thus
REPORT PAGE(50)
WIDTH(120);
is equivalent to
REPORT(1)
PAGE(50) WIDTH(120);
and
PRINT
(R1.A, …);
is equivalent to
PRINT
(R1.A, …) REPORT(1);
Nbr must be from 1 to 99.
PAGE(nbr). The number of lines per page.
WIDTH(nbr). The number of printed characters per line. This excludes any control characters that may be placed ahead of the printed line to control spacing.
HEADING (string[,string]…). The report heading. If omitted the report heading is “REPORTn” where “n” is the report number.
Several lines of heading may be specified. For example
HEADING ('ARREARS REPORT', PAYMENTS DUE FOR MORE THAN 1 MONTH')
By default, each heading is positioned in the centre of the report’s “Effective Width”, which is the number, up to WIDTH, required to print the report. Effective Width is less than WIDTH is all print lines require fewer characters.
Each heading string may be positioned with COL, e.g. HEADING ('CUSTOMER REPORT' COL(35)). For the first report line, the minimum COL value is 31, for other lines it is 1. The maximum value is WIDTH less the length of the heading.
Except for the first heading, SPACE may be used to space out headings. If omitted or if SPACE(1) is specified, the heading is printed on the next available line. SPACE(2) is double spacing, leaving one blank line, SPACE(3) is triple spacing (2 blank lines), while higher values print as many blank spacer lines as necessary to achieve the specified spacing.
SEPARATOR string. This defines the characters that appear between two fields printed by a PRINT statement. These separator characters do not appear between a field and a constant. If SEPARATOR is omitted, a single blank between fields is used.
· Write SEPARATOR ‘’ if you want no inserted space between fields
· Write something like SEPARATOR '|' if you want a visible separator. Of course you can insert several spacing characters if you want, with something like SEPARATOR '| |'
· If you also want these separator characters to appear around constants simply add them into the value of the string.
· The separator characters do not appear at the beginning or end of lines, even when a second line is caused by a line overflow.
GAP (nbr). This is provided for Easytrieve conversion. If the EZT REPORT statement has option SPACE nbr, then this will be converted to GAP(nbr) and define the number of blanks that are inserted between adjacent items provided neither item has a COL (or RCOL) option. If GAP is not specified, then its default value is 3 in a program converted from EZT (the program statement will have option EZT), and 0 for other programs. If GAP has value 0, then normal Jazz rules apply about spacing between fields and strings.
NB: Jazz uses SPACE for line spacing. See below.
NAME string. For example
REPORT NAME 'HOREPORT';
Report names must be valid for JCL (starts with a letter, only letters and numbers, maximum length 8 characters). Jazz will attempt to correct “invalid” names by removing special characters, and truncating the string to a maximum of 8 characters.
When a report is named and you chose option “Use a Routine” (see https://www.jazzsoftware.co.nz/Docs/JazzUGEZTLogic.htm#Reports), there will be ROUTINE named HOREPORT containing one or several PRINT statements and Easytrieve PRINT statements will invoke this routine. If you chose option “In Line Printing”, then the data is printed directly, and the report name must be valid for JCL as the generated JCL will use //HOREPORT DD SYSOUT=*.
If a name is given, then it will be used as the DDName. For example
REPORT NAME 'RPt1';
will print the report to
//RPT1 DD SYSOUT=*
instead of defaulting to
//REPNBR1 DD SYSOUT=*
However within the Jazz program you continue to distinguish this
from other reports by number, not by name: write
PRINT … REPORT (1);
not
PRINT … REPORT ('RPt1');
This option has been added to support Easytrieve to Jazz conversion: in Easytrieve PRINT prints a report, whereas in Jazz PRINT prints some data. You are free to write programs in the style of the following program converted from Easytrieve.
Example: an Easytrieve program contain several occurrences of statements like this: -
PUT OUTPUT
PRINT HO-REPORT
and defined the report like this
REPORT HO-REPORT PRINTER REPORT1 DTLCTL EVERY SUMCTL NONE
NOADJUST
TITLE 1 'SCHEDULE OF INPUT FOR MSA GENERAL LEDGER - MSAB910.'
LINE 1 O-RECORD-PRT
END
MANASYS Jazz converted this (see https://www.jazzsoftware.co.nz/Docs/JazzUGEasytrieve.htm) as follows: -
1. OUTPUT is a COBOL reserved word, so PUT OUTPUT becomes
WRITE OUTPUT1;
2. PRINT HO-REPORT becomes
PERFORM HOREPORT;
3. The EZT REPORT and TITLE statements are combined to become
REPORT NAME 'HOREPORT' HEADING 'SCHEDULE OF INPUT FOR MSA GENERAL LEDGER - MSAB910.';
4. A ROUTINE is created containing the LINE statements, which become Jazz PRINT statements: -
ROUTINE HOREPORT;
COPY JZSMth;
PRINT(OUTPUT1.O-RECORD-PRT);
END ROUTINE HOREPORT;
NEWPAGE. With REPORT… NEWPAGE, executing a PRINT …. LINE(1); statement has the same effect as PRINT … PAGE; Without this option, LINE(1) is just the first print line of many within a print routine.
NOHEADING. If this option is
used, then PRINT statements do not produce column
headings.
SPACE(1 | 2).
SPACE(2) means that printing is double spaced.
If you use Labels options then your printed page becomes a table that is printed when the table is full, or when a new page is required. Label options are LABEL, ACROSS, DOWN, SIZE, NEWPAGE and SPACE. For example,
REPORT(1)
PAGE(50) WIDTH(120) LABEL ACROSS(3) DOWN(10)
SIZE(40);
If
any Label option is present then data is printed as labels, without
headings.
Default
values are ACROSS(4),
DOWN(6),
SIZE(30). These defaults are set when the first label
option is encountered. Minimum values
are ACROSS(2),
DOWN(4),
SIZE(20).
LABEL
is automatically created in Easytrieve conversion, but it is currently
unnecessary as it implied by ACROSS,
DOWN,
and SIZE. However, a future development may allow
standard printing in columns, using report headings and supporting control
breaks and subtotals, so we recommend that you write LABEL to
fix current behaviour in case the meaning of your Jazz program changes with
future development.
PAGE and WIDTH apply
to the whole page, which may contain many rows of labels.
WIDTH
defaults to 132. WIDTH
must be >= SIZE
* ACROSS,
it will be increased if necessary.
PAGE defaults to 60, and must
be >= DOWN. It will be increased if necessary.
With
label printing, PRINT puts data into the label
array, “printing” first Label 1,1, then Label 1,2 then Label 1,3. There is only one row of labels in the label
array, so on attempting to “print” the first line of Label 2,1, the label array
is physically printed and cleared.
With
label printing, each label is considered a page, so that if a control break
causes a new page or PRINT uses a PAGE or LINE(1) option then this starts
“printing” in the next label.
If
NEWPAGE is specified, then the page size is set to DOWN so
that the first line of every label has control character “1” to start a new
page. Without NEWPAGE,
control character 1 is only used for the first label line when there is
insufficient room on the page to support another row of labels. For example with a report defined
REPORT ACROSS(2) DOWN(15)
NEWPAGE SPACE(1);
and
the default page size of 60 lines, every 4th set of labels will use
control character 1.
SPACE may have value 1, 2, or
3, defining single, double, or triple spacing.
SPACE only applies to label
reports, it is not used with standard reports.
This is a special form of the REPORT statement which will be generated during Easytrieve conversion to define the output for DISPLAY statements. An EZT DISPLAY statement like this: -
DISPLAY SYS012 E1-SATZ 'F2: DB-Fehler, Abbruch' V05-STC
names SYS012 as the output destination of the displayed data, and a basic conversion of this would produce
DISPLAY (SYS031.E1-SATZ, 'F2: DB-Fehler,
Abbruch' V05.V05-STC) UPON SYS012;
#782 E SYS012 is not a special name
If there is no UPON option DISPLAY will use SYSOUT. If present, UPON must use one of the COBOL special names CONSOLE, SYSLIST, SYSLST, SYSPUNCH, SYSPCH, SYSIN, SYSIPT. The first time that DISPLAY SYS012 is encountered in a conversion, MANASYS will pick one of the unused COBOL special names, use this in the UPON clause, and generate a REPORT statement like this
REPORT NAME 'SYSLST' DISPLAY EZTNAME 'SYS012';
to reserve the name for further DISPLAY SYS012 statements.
A REPORT statement with DISPLAY should use only the NAME and EZTNAME options.