1. Report Stream Processing Phases
| Phase Key | Trigger Mapping | Core Pipeline Operation & Memory Scope |
|---|---|---|
| INIT | Pre-scan loop block | Registers virtual memory fields; flags global system variables; opens table index pointers. |
| SELECT | Conditional row filter | Evaluates boolean filter arrays (e.g. [status]="A") to drop or include blocks. |
| SORT | Multi-key index pass | Arranges structural tokens via major/minor keys before executing subtotal breaks. |
| PROCESS | Active record iteration | Commits native field transformations; fires internal math expressions; increments active matrix counters. |
| FINAL | Post-scan terminal flush | Pushes global mathematical matrices; draws summary rows; terminates system stream threads. |
2. Control Breaks & Accumulators
| Control Syntax | Evaluation Thresholds & Buffer Behavior Matrix |
|---|---|
BREAK ON [field] | Monitors scalar value changes. Fires a context break instantly when an attribute delta is identified. |
SUBTOTALS | Flushes active Type A accumulator field balances down to the view deck, resetting targets to 0. |
GRANDTOTALS | Holds global master buffers outside individual subtotal reset boundaries until the final terminal loop. |
ROLL [field] | Forces a vector value to bubble up safely to higher sorting tiers without dropping precision weights. |
Z-Modifier | Suppresses empty balance strings across summary spaces, writing clean blank slots instead of raw 0 tags. |
3. Flat-File Spec Compiler Architecture (.rep)
Native source configurations assemble variables, conditional limits, and physical boundaries directly into operational memory targets:
SORT_KEYS: [region] ASCENDING, [sales_rep] ASCENDING | OPTIONS: PAGE_BREAK_ON_MAJOR
CRITERIA: ([amount] >= 5000) & ([status] != “VOID”) // Stream level short-circuit evaluation filter
ACCUMULATE: [amount] INTO [sub_tot_reg] ON_BREAK [region] RESET
ACCUMULATE: [amount] INTO [grand_tot_corp] ON_BREAK TERMINAL
4. Block Layout & Header Sections
| Block Code | Syntax Definition Map | Functional Layout Execution & Page Context |
|---|---|---|
| HDR | HDR <text> [var] > | Master Page Header: Outputs strings, titles, and system tracking limits at top margin bounds. |
| BKH | BKH [field] > | Break Header: Renders context labels ahead of unique record arrays (e.g., printing Region Name). |
| DET | DET [f1] [f2] > | Detail Rows: Direct iterative channel printing individual field data rows sequentially down the page coordinates. |
| BKF | BKF [field] > | Break Footer: Closes variable clusters; draws partition lines; displays accumulated sub-balances. |
| FTR | FTR <text> > | Master Page Footer: Sets layout pins at the low bottom margin boundary for global counters or signatures. |
5. Stream Formatting Mask Directives
Explicit format parameters adjust typography strings on data table sheets at run-time:
| Specifier Tag | Structural Targets | Mask Processing Mechanics & Output Scope |
|---|---|---|
%<width>s | String characters | Enforces column width boundaries. Aligns string blocks to the right side automatically. |
%-<width>s | String characters | Enforces column width boundaries. Left-justifies character sets for clear ledger reading. |
%<w>.<d>f | Floating decimals | Locks absolute character width bounds while rounding floating fractions to explicit dot dimensions. |
%d | Integer variables | Prints scalar digits cleanly. Bypasses character formatting loops to save server overhead. |
%<mask>Date | Internal date tokens | Transforms stored YYMMDD bits into custom system layouts like DD/MM/CCYY. |
Native Print Engine Core Layout Attributes Index
line_spacing | Sets points or vertical spacing jumps between active block rows. | suppress_dup | Hides matching scalar field blocks to eliminate redundant layout rows. |
page_length | Declares hard terminal row margins or absolute physical document sheets bounds. | overflow_target | Intercepts excessive block elements, redirecting data to clear appendix pages. |
col_truncate | Slices strings instantly if field width boundaries breach limits. | font_bold_on | Sends raw escape sequences to render highlighted typography structures. |
margin_left | Offsets the zero-coordinate baseline tracking index to accommodate binders. | csv_export_mode | Strips out graphic rules and headers to output raw database fields cleanly. |
NAME
report – report definition file
DESCRIPTION
Files whose names end with `.rep’ are taken as report definition files, which are used by the report generator program ubreport. Report definitions are text files and can be created and maintained by any text editor such as vi, or edit.
A report definition file consists of a standard filename declaration and report command options.
The filename declaration is a line that starts with a `:’, a space and is followed by a table name. The report command options are lines starting with a capital letter followed by a picture or special instruction to the report generator.
Lines in report pictures can be any combination of text and fields.
A picture line can also be divided into three parts left, centre, and right by using `#’ as a separator. e.g. left#centre#right. Any section can be empty and only as many `#’ as are necessary need be given. Lines are left justified by default. To centre a string use `#string’; to right align a string use `##string’ etc.
Records from an associated table can be included in a report by starting a line with `<table’. In this case all the format options for table will be used. i.e. N table, R table, S table, T table, U table, D table, C table. Note that C table will be applied to all access to table, not just format sections.
REPORT COMMAND OPTIONS
{<table>} Means apply option to table instead of the master table.
{=} Means an optional condition may be given. See CONDITIONAL FORMATS below.
| OPTION | TITLE | DESCRIPTION | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | Attributes | SYNTAX
A
{<field>} <attribute> {<condition>}
...
>
DESCRIPTION <condition> is an expression. If it is true (or missing) the <attribute> is applied to <field>. If <field> is [record], <attribute> is applied to the entire record. If <field> is missing, <attribute> is applied to the entire picture. There may be several <attribute>/<condition> pairs for any <field>. The first true condition is used to select the attribute. |
||||||||||
| B | Page Break | SYNTAX
B{P} <field>
DESCRIPTION |
||||||||||
| C | Conditions | SYNTAX
C {<table>}
<expression>
...
>
DESCRIPTION |
||||||||||
| D | Deletions | SYNTAX
D {<table>}
DESCRIPTION If table is given and there is an “R <table>” section, the records will be deleted from the table as they are printed. |
||||||||||
| F | Page Footer | SYNTAX
F{L|T} {=}
<picture>
>
DESCRIPTION |
||||||||||
| H | Page Header | SYNTAX
H{1|T}{0} {=}
<picture>
>
DESCRIPTION |
||||||||||
| I | Variable Input | SYNTAX
I {<title>}
<field def>
...
>
DESCRIPTION <field def> is a list of field definitions using the same format as the dictionary format (see dictionary (4)). The fields defined by field def are accessible in the table `?’. Values for the fields are read from stdin in “A” format. EXAMPLE I date, 6 D > C [date entered] <=[?.date] > |
||||||||||
| K | Report Key/Index | SYNTAX
K <key> DESCRIPTION |
||||||||||
| L | Lines Printed on Page | SYNTAX
L <n> DESCRIPTION |
||||||||||
| M | Move Records | SYNTAX
M <table> DESCRIPTION |
||||||||||
| N | New Section | SYNTAX
N {<table>} <field> {=}
<picture>
>
DESCRIPTION |
||||||||||
| O | Match Index | SYNTAX
O{L} <list>
DESCRIPTION EXAMPLE O "Y" [order no] |
||||||||||
| P | Page Length | SYNTAX
P <n> DESCRIPTION If n is 0, pagination is disabled. Default value: 0. |
||||||||||
| R | Report Format | SYNTAX
R {<table>} {=}
<picture>
>
DESCRIPTION If the picture has `<‘ in it, the rest of the line is taken as a table name and an optional index (if there is more than one possible association). The associated records in the specified table are printed at that position using the appropriate formats. C,D,N,R,S,T and V can all be used with the included formats. Include files can also be specified as {<…<}. The table name and optional index replace … The advantage of this syntax is that it can be included inline with other parts of the picture. N.B. ‘<‘ sections can be recursive if the table structure supports recursion. e.g. Bill of Materials reporting. If the report has a `!’ in it the remainder of the line is the name of an execute (X) section. The output of the execute section is indented to the current the current position of the ‘!’. Execute sections can also be specified as {!…!}. Again this has the advantage of being inline with other things in the report. If a line in the format starts with “=”, the format up to the next “>” will only be printed if the condition following the “=” is true. Parts of a line can be conditionally included by using the following syntax: {=<condition>{?<true format>{:<optional else format>=}
In line conditions can be nested. EXAMPLE R
...
= [margin] < 30%
*** WARNING: NOT ENOUGH MARGIN ***
>
SOME TEXT {=[value] > 0{?MORE THAN 0{:LESS THAN OR EQUAL TO 0=} AND SOME MORE TEXT
...
<table1 category,description
...
SOMETHING <table2
>
R table1
...
>
R table2
...
>
|
||||||||||
| S | Sub-Totals | SYNTAX
S{<offset>}{F} {<table>} <field> {=}
{<picture>}
>
DESCRIPTION EXAMPLE S [supplier] -> TOTALS FOR THIS SUPPLIER: [cost] [no of recs] -> |
||||||||||
| T | Report Total | SYNTAX
T{B} {<table>} {=}
{<picture>}
>
DESCRIPTION EXAMPLE TB \=> REPORT TOTAL: [cost] [no of recs] \=> > |
||||||||||
| U | Updates | SYNTAX
U {<table>} {=}
<field> <=+-*/> <expression>
...
>
DESCRIPTION
EXAMPLE U [price] *1.1 [on hand] -[qty] [value] -[qty]*[price] [last sales] =[system.date] > |
||||||||||
| W | Page Width | SYNTAX
W <n> DESCRIPTION EXAMPLE W 120 |
||||||||||
| X | Commands to Execute | SYNTAX
X <name> <commands> > DESCRIPTION EXAMPLE X files 1s - 1 > R ... !files ... > |
CONDITIONAL FORMATS
Conditional Formats can be used to print records, subtotals, etc in different formats. An expression is evaluated and if it is true (non-zero) the format is used.
Example:
R [partno] [description] [qty on hand] [reorder] > R = [qty on hand] < [reorder] [part no] [description] [qty on hand] [reorder] BUY MORE > R = [qty on hand] = 0 [part no] [description] OUT OF STOCK >
The syntax is = <expression> and may be used with any command option that has {=} in its syntax.
The format conditions are evaluated from the last to the first. The first true expression becomes the format to use for this record. This means the default format (i.e. no condition) comes first in the report program file.
Conditional formats can also occur inside a format. This happens when a format line starts with “=”. Up to the next terminating “>” the format will only be printed if the expression following the “=” is true.
These conditional formats can be nested.
The third method for conditional formats is embedded in the report line. The structure
{=<condition>{?<true format>{:<optional false format>=}
can occur anywhere within a format line. It cannot extend across multiple input lines.
You can nest an embedded condition inside the true and false formats for more complex requirements.
If the false format is not needed then the ‘{:’ operator is also left out.
Example:
R
[partno] [description] {=[qty on hand] > 0{?[qty on hand]{:{=[qty on hand] = 0{?OUT OF STOCK{:OVERSOLD=}=}\
{=[qty on hand] <= 0 {?[reorder]=}
>