UNIBASE

ubreport: The report generator and data processor

NAME

ubreport – report generator and data processor

SYNOPSIS

ubreport -[0 A B* D H* M L N# P* Q S T W* X Y* a* b d f* i l* m* n o ps p* s t* w*] <report>

DESCRIPTION

Ubreport is the UNIBASE report generator and data processor. It works by reading a report format file which specifies a table to report from and a layout to use.

Layouts can be very complex and include text and table attributes from the current table and any other table in the database. Other tables can be access by reference to attributes in the other tables or by explicitly including records from a table using a set of format specifications for the other table.

Normally ubreport accesses data from a stored UNIBASE table, however you can also use it as a UN*X filter accepting records from stdin in a variety of formats and optionally integrating them with a stored database before putting the requested report on stdout. The command line argument -S tells ubreport to read table records from stdin.

Although ubreport can produce complex commercial data processing style reports, it is not well suited to the arbitrary formats required for word processing or more complex document formats such as catalogs. To do these more complex tasks ubreport allows the user these facilities:

Display attributes. This is a format specification based on the UNIPL*X word processor. In this format each line ends with ‘@@’ and the following line has an attribute character for each character. A SPACE means no special attributes. Any other character can mean a single or combination attribute or a character translation to another character set. Ubreport doesn’t count attribute lines when working out how many lines have been printed on a page.

To interpret the attributes, you have to pass the ubreport output to another filter that understands this encoding. Ubprint (1) is one such filter and comes with UNIBASE.

Dot commands.

troff/groff users will be familiar with this format. Dot commands are lines that start with a period (‘.’). Ubreport has a limited facility to deal with these. It ignores lines starting with a period when counting lines for page lengths.

Except for simple functions such as changing fonts, or centreing lines this will not be sufficient to get the expected formats. In this case it is better to set the page length to 1 or 0 (turn pagination off) and assume that an external filter such as groff will do the remaining formatting correctly.

Other filters.

For all other formats, you should turn off pagination and embed format commands in the output by putting them in the report format. This method produces HTML format reports. Ubreport assumes an external filter handles the final display.

Ubreport format file names end in ‘.rep’, but you do not give this when calling the program.

FLAGS

FLAGARGUMENTTYPEDESCRIPTION
-A

Use attribute/value format for records read from stdin. This flag is only valid when used in conjunction with -S.
-D

This option allows for the alternative date format YYMMDD. Normally, all dates are expected to be in the format DD.MM.YY (or DD/MM/YY). Using this option reads dates in the alternate format. Useful only with the -S option.
-L

Suppress display of the status line when using full screen user input for report variables.
-M

Read match values for report from stdin.
Contrast with -m (one value) and -m start -l end for a range of values.Example: echo 1234567890 | ubreport -M stock
-NvaluenumberThe term nice(2) refers to the nice system call in Unix-like operating systems. It’s used to influence the priority of a process. A higher “nice” value means a lower priority, making the process “nicer” to other processes by yielding CPU time to them. Conversely, a lower “nice” value (closer to zero or even negative for root users) gives the process a higher priority.
-PpipetextThe nice(2) value (controlled by the -N option in the example ubreport -N 0 discount) affects the scheduling priority of the ubreport process. It determines how much CPU time the process gets relative to other processes running on the system. A lower nice value (higher priority) means it gets more CPU time, potentially running faster but impacting other processes more.
-Q

Turn off QUIT signal processing. This flag makes it impossible for the user to stop a report with the keyboard QUIT key. The QUIT key is determined by stty(1).
-S

Standard Input (standard in or stdin): This is a fundamental concept in Unix-like operating systems. It’s the default input channel for a program. Normally, a program reads from stdin, which is typically connected to your keyboard. However, you can redirect stdin to come from a file (using < filename) or, as shown in the example, from the output of another command using a pipe (|). When ubreport reads from standard input, it’s getting its data from whatever is “piped” into it or redirected to it, rather than reading from a specific file it opens itself.
-T

Trace all calculations for all fields
-YdictionarytextUse a different data dictionary
-acharactertextThis changes the default alignment character. The alignment character (default ‘#’) is used to split a line in left, centre, and right sections. This option changes the alignment character to another character.
For example: ubreport -a! stock
-b

This option allows ubreport to read UDF (Universal Dump Format) See ubbatch(1) for details. Useful only with the -S option.
-d

When ubreport runs, it uses the information in the Data Dictionary along with the specific “report format” you’ve defined. The report format tells ubreport what data to include and how to present it, while the Data Dictionary tells ubreport what the data actually is and its properties, allowing ubreport to correctly interpret and process the raw data records.
-fseparatortextUsed in conjunction with the ‘-S’ option this tells ubreport to use ‘separator’ as the field separator for input records. Instead of fixed length input records, each field is separated by a field separator.
For example, to use ubreport to read records where fields are separated by commas(,):ubreport -S -f, newstockUse only with the -S option.
-i

Indicates that ubreport is not interactive, ie. it is in batch mode, probably as part of a shell script or command file. In this mode the input screen (for the ‘I’ section) is ignored (although it must be present) and report variables are read, one per line, from the standard input in ‘attribute’ format. i.e. attribute>,value> pairs.
e.g. ubreport -i customers <
-lvaluetextLast value to use in a matched value report. Normally the -m flag only reports records whose index matches value. When the -l flag is used the -m flag becomes the beginning of a range and the -l flag is the end of the range.
Example: ubreport -m A -l B nameswould run the report names starting with names beginning with ‘A’ and finishing at the end of the ‘B’s.
-mvaluetextThis restricts the report to those key values that are the same (match) as value. If a report is required of only a section of a large file this option can be considerably reduce the report time.
-n

Print table network used for this report. This shows the paths used by ubreport to reach each table from the master table.
-o

Only print subtotals. This is used to allow a single report format to be used to print reports with and without full record details. Any ‘R’ sections are ignored.
-poutputtextubreport sends its output via a pipe to ‘output’ which whould be a unix command. The command is executed by sh(1) so it can be a pipeline or contain ‘;’ separated commands on anything else that the shell understands. This is done asynchronously so ubreport will work in the background. ubreport doesn’t work until after any operator input has been collected.
Example: ubreport -p ‘lp -s’ stock
-s
Redirects the output to ‘pg’ for screen output. The default program (pg) may be changed with the environment variable ‘UBPG’.
-tfieldtextTrace all calculations for ‘field’.
-w

Tells ubreport that this format contains html tags. Html tags begin with ‘<‘ which conflicts with the include table directive. When ubreport encounters a ‘<‘ it first looks for a table to include (normal operation). If that fails it assumes an html tag and looks for the terminating ‘>’. An error is still reported if the terminating ‘>’ is not found or a ‘<‘ is found in the html tag.

ERRORS

EXAMPLE

SEE ALSO

Verified by MonsterInsights