You are on page 1of 14

Overview

The Report Generator utility provides a mechanism for defining and producing ad hoc
reports, which can be run on-line or within the COB batch process.
The utility consists of four stages:

Four stages of the Report Generator Utility


Initially when a new report is created or an existing report is being amended, stages 1, 2, 3
and 4 must be executed in sequence. However, once the report has been defined and tested
only stages 3 and 4 need to be executed.
 Setup
 Deal - Transaction Processing
 Close of Business Services

Setup
Creating a Report - REPGEN.CREATE
The REPGEN.CREATE application is the basic table that allows the user to modify or define
the layout and contents of a report.
The details defined here control features such as which data files are used for selection, the
sort sequence of the records, column positions and totals and so on (as shown in the below
screen shot).
The following sections briefly describe some of the main features and parameters that are
used in creating a report. More detailed explanation of the parameters and other advanced
features can be found in the HELPTEXT documentation.
Creating a Report

Data file Selection and Output


The screenshot below shows a report definition on the ACCOUNT file that displays the
Account number and Customer number.
Report definition on Account file
The parameter fields used:
 READ.FILE - Defines the file to be selected; for example ACCOUNT. This field is multi-valued
to allow data to be extracted and combined from multiple data files.
 FL.FIELD.NO to FL.REL.NEXT - This associated set of fields defines the selection criteria to be
used for the selection of data records from the file. In the example, only those ACCOUNT
records, which have a CUSTOMER number are selected; that is Customer accounts.
 DEFINE.MNEMONIC to TEXT - This set of fields defines the data to be extracted and
displayed. DEFINE.MNEMONIC associates an alias or mnemonic name to the actual data
record field number specified in MNEMON.FIELD field. This name can then be used to refer
to the relevant field elsewhere in the definition; that is when defining decisions, calculations
and so on.
 The DISPLAY.TYPE field controls how the field is to be displayed, that is every line, header,
footer and so on.
 The example shown uses the value 2 to specify every line. If this field is blank, the data is not
displayed.
 The COLUMN field is left blank, so that the report generator automatically spaces the
columns; that is the length of previous field plus one space character. If a column number is
specified here then manual calculations must be done to determine the exact column
positions for the display of data.
 SORT.FILE.TYPE and SORT.FILE.MODULO - These fields define the type and size of the work
file initially created when the REPGEN.SORT application is run. SORT.FILE.TYPE specifies the
type of keys, which are stored in the file and SORT.FILE.MODULO, specifies the size in 2k
groups.

In the example the file is type 2 (numeric keys) and modulo 11 (11 * 2k=22k approx. size).
An approximate modulo can be calculated as:

Modulo calculation
From the result of this calculation, determine the next nearest Prime Number and use this
as the modulo.

Sort order and Data output format


The below screen shot illustrates how the contents of the report can be sorted according to
a particular data field. The example sorts the report in Customer Number order (right
justified).
Sort order and Data output format
The parameter fields used:
 KEY.TYPE - This field defines the output sequence of the data field specified
in MNEMON.FIELD including control of totals and page breaks.

In the example a value of 1 specifies that this field will be used as part of the sort
sequence.
If this is the only mnemonic in the whole report definition, which has a 'key.type' of
1, then it becomes the primary sort key. A secondary sort key can be established by
setting the 'key.type' to '1' on another mnemonic definition. Then the sort order is in
the order in which the mnemonics are defined.
Note: A mnemonic that is used for sorting does not necessarily have to be
displayed.

 SPECIAL.MASK - Defines the output format for the data field, that is left, right justification,
special masks, date formatting and so on.

The example R###### shows that the customer number is to be right justified in a
field width of six characters.
A special feature of this field is that; if the name of a mnemonic, which is referencing
a currency field, is entered here, the report generator formats the data according to
the number of decimals in the currency table.

Replace data from another file


The below screen shot illustrates how a data field from the current file can be replaced with
data extracted from another file. The example replaces the Customer number extracted
from the ACCOUNT file (READ.FILE) with the SHORT.NAME from the CUSTOMER file.

Replace data from another file


The parameter fields used:
 MODIFICATION - Defines special functions to be performed on the data.
The REPLACE function used in the example allows the retrieval of a data field from another
file. The data field specified in MNEMON.FIELD must be the record key to the other file.
 MODIF.FILE - Specifies the name of the other data file from which the information is to be
extracted from. In the example this is the CUSTOMER file.
 MODIF.FIELD - Defines which data field (number) is to be returned from the record extracted
from the other file. In the example this is field 2 (SHORT.NAME) from the CUSTOMER record.

Fixed headers
The below screen shot illustrates how column headers can be defined for the report. Up to
four lines of heading can be defined.

Define fixed column headers


 The header definition fields are divided into 40 character blocks; for example HDR.1.001.040
represents line header 1 character positions 1 to 40
 The SPECIAL.HEADING field controls whether the standard three lines of T24 headings are
printed on the top of each report page.
 Setting this field to STANDARD specifies the printing of the standard header. If it is left blank
then it suppresses the printing of headings and end of group/report messages.

Totals
The below screen shot illustrates how totals can be defined in the report. The example
totals the working balance for all accounts and displays the total per currency.

Define totals in the report


The parameter fields used:
 DISPLAY.TYPE - Set to value '3' (line+total) for WBAL (working balance) mnemonic to display
the data field on every line and to keep running total.

If this is set to value '4', then the data field is not displayed but only totalled. The
total is displayed in the total line.
In the example, it is set to '3' to print and total the working balance.
 KEY.TYPE - Set to value '2' (total by change) or '4' (total and paging by change) to produce a
sub-total; whenever the value of the field changes.

In the example for CURR mnemonic it is set to '2' to produce a sub-total whenever
the currency changes. The sub-total is reset after display. A value of '4' has the same
function except that it performs a page break.

Data fields in headers


The below screen shot illustrates how a field can be displayed as a header line whenever the
value changes. In the example the currency is displayed once as a header instead of every
line.

Define fields to be displayed as header line when value changes

Note: It is important to sort the output according to the field being displayed in the
header.

The parameter fields used:


 KEY.TYPE - Set to value '1' (sequence control) to sort output according to this field; for
example, currency.
 DISPLAY.TYPE - Set to value '1' (header) instead of '2' (line) to display the currency as part of
a header line.
Footer text
The below screen shot illustrates how the text can be displayed as part of total lines. In the
example the text 'TOTAL FOR' and the relevant currency is displayed as part of the sub-total
for each currency.
For example, TOTAL FOR DEM - 1,545,000.00

Footer Text
The parameter fields used:
 DISPLAY.TYPE - Value set to '6' (Footer) for CURR.FTR mnemonic to display the data field
defined in MNEMON.FIELD in a total line only.
 TEXT - Contains the fixed text that is to appear as part of the total line. In the above screen
shot this is set as 'TOTAL FOR'.

Note: The DISPLAY.TYPE on the WBAL mnemonic (working balance) is set to value
'4' (total only), that is, this field is not displayed but only totalled. This has been
used instead of display type '3' (line and total) to prevent the footer text from being
printed on the next line after the sub-total. Another mnemonic is defined to print
the working balance on every line.

Blank lines
Blank lines can be inserted in the report for headers, totals and detail lines by setting the
following fields to the appropriate values.
 ADD.BLANK.LINE
 ADD.TOT.BLANK.LINE
 EMPTY.LINE.WANTED

Refer to the HELPTEXT documentation for further details.


Decisions
The below screen shot illustrates how decisions can be defined and used to control the
conditional printing of data. In the example the text 'YES' is printed beside any working
balance field, which has a posting restriction defined on the ACCOUNT record; that is
the POSTING.RESTRICT field on the ACCOUNT record contains a numeric code.

Defining ‘Decision’ fields


The parameter fields used:
 DECISION.NAME to REL.NEXT.FD - This set of fields associates a name to the decision and
defines the actual conditions, which evaluates to true or false.

In the example the name of the decision is POSTING.RESTRICTION and it compares


the value of the data field mnemonic POSTR to null (“”). That is; the decision is true,
if POSTR is not equal to null. More complicated decisions can be specified by
expanding the sub-values and using the logical operators AND/OR
(in REL.NEXT.FD field) to group the conditions.
To print the text 'YES' for only those Accounts, which have a posting restriction, the
decision defined above is linked to the mnemonic (DISP.YES), which prints the text
through the following parameter fields.
 MNEMON.FIELD to MODIF.FIELD - This is set to value FIELD.DECISION, to indicate that this
mnemonic (DISP.YES) has the value defined in MNEMOM.FIELD field (YES); if the associated
decision specified in MODIF.FIELD field (POSTING.RESTRICTION) is true.

Groups
The Group facility within the Report Generator allows a single report definition to be sub-
divided into sections. The sub-division is performed according to decisions linked to each
group (section). In the example shown below, the report on the ACCOUNT file is divided into
two sections, Customer Accounts and Internal Accounts.
Grouping Facility
The parameter fields used:
 GROUP - The number identifying the Group is set-up in
fields GROUP.TITLE to MNEMON.SEQU. In the example groups 1 and 2 are defined.
 GROUP.TITLE - Title to be printed at the beginning of the group.
 GH1.001..040 to GH4.121..132 - Header text for each group; up to four lines of heading can
be defined.
 GROUP.DEC.NAME - Name of the decision that is to be used to control the selection of
records, which appears in the group. In the example the first group is linked to the
decision CUSTOMER.ACCT and the second group is linked to INTERNAL.ACCT.
 NEW.PAGE.FOR.GROUP - This field can be used to force a page break when a new group
starts. And the RESET.PAGE.NO field allows the page numbering to be reset to one for the
start of each group.

Deal - Transaction Processing


Building the Executable - REPGEN.SOURCE
The REPGEN.SOURCE application generates and compiles the BASIC source code from the
report parameters defined in application REPGEN.CREATE. Two source code programs are
created with names 'RGS. {reportname}' and 'RGP.{reportname} '.
The source code generated is executed by applications REPGEN.SORT and REPGEN.OUTPUT
To create the source code, invoke the application REPGEN.SOURCE. This prompts the name
of the report and displays the time of the last compile with a prompt to continue or not.

Note: If the report definition (REPGEN.CREATE) has been modified after


the REPGEN.SORT and REPGEN.OUTPUT stages have already been run, then to pick
up the new changes you must logout and log back in to T24 before running
the REPGEN.SOURCE application. Otherwise, the old version of the report will be
executed.

Producing the Sort file - REPGEN.SORT


The REPGEN.SORT application executes the sort/select program (generated
in REPGEN.SOURCE, name like RGS...) to create a work file and to populate it with the data
records matching the selection criteria defined in the REPGEN.CREATE application.
The work file is only created on the first execution of the report, subsequent executions
clears the work file prior to populating it with data records.
The application must be run in Verify mode, refer the below example of input screen.
RepGen Sort Application

Producing the Report - REPGEN.OUTPUT


The REPGEN.OUTPUT application executes the print program (generated
in REPGEN.SOURCE, name like RGP...) to display the report on the screen or send it to the
printer. The program uses the work file created and populated by
application REPGEN.SORT.
The application must be run in ‘V’erify mode, refer the below screen shot for an example of
an input screen.
Repgen Output executes the print program
The resultant report is shown in the below screen shot.

Output of report for RG.ACCOUNT.LIST

You might also like