Entry-Section
The ENTRY-SECTION allows you to specify Data Names and commands for executing initialization and termination routines. The defined Data Names are those that are used locally in the report and are not established in a Dictionary-IV format. The initialization and termination capabilities utilize various Report-IV commands and 3GL syntax which allow you to set printer characteristics, set report parameters such as length, assign values to Data Names, execute programs, process messages, etc.
Line Types
Section titled “Line Types”The following line types are used in the ENTRY-SECTION:
- DN
- Data Name Declaration
- FN
- Format Name Declaration
- I1nn
- Initialization logic
- T9nn
- Termination logic
Conventions
Section titled “Conventions”This section provides information on specifications that can be entered in the ENTRY-SECTION of a report definition. The commands and variables are arranged alphabetically, and the information for each entry is organized in the following way:
FUNCTION
A brief description of the action or purpose of each command or variable.
SYNTAX
An outline of command or variable structure, including syntax and readability options. Parameter choices are detailed directly following the command.
NOTES
Remarks and important information on command or variable syntax and the function of a command or variable in the ENTRY-SECTION.
EXAMPLES
Typical examples of command and variable usage.
Where there is more than one Format for a command, the beginning of each command is shown in boldface letters and the choices are separated by a blank line.
As long as the elements within a command are separated by spaces and fall within the command area of a report, no indentation is required. For readability, the syntax is represented with standard indentation to highlight clauses and options under each command.
Note: For more examples of Report-IV commands, declarations, and variables, see the Sample Reports section later in this document.
Define Data Name
Section titled “Define Data Name”FUNCTION
This line type allows you to define local Data Names to be used in the report.
SYNTAX
DN Data Name(n [ .p ] [ * x ] | DATE) [Data Name ...]- Data Name
- is an alphanumeric Data Name.
- n
- is the field length.
- p
- is the numeric precision to be used (only if the Data Name is numeric).
- x
- is the number of occurrences.
- DATE
- is a keyword.
NOTES
-
Press the F1 key each time the local Data Name is added or changed. This updates the report workspace.
-
Data Names defined in this line type are referred to as local Data Names. They should not conflict with Data Names used in the report.
-
Local Data Names should not conflict with other Data Names established in the Link(s) defined or with any Thoroughbred Basic directive, variable, function names or Report-IV syntax.
-
Local Data Names are most commonly used for special values, operator input, registers, totals, header/footer contents, and so on.
-
The DATE option defines a 6-character Data Name
-
This command establishes only the Data Name. Assignment of values is done using other commands.
-
Data Names must not start closer to the left than the “L” in the ruler line.
-
The rules for defining the field length for a Data Name within a Format apply to local Data Name fields.
-
The Data Name must be 3 through 20 characters long.
-
Data Names are alphanumeric characters. Valid characters for the Data Names are:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz 0123456789 -
Hyphens and underscore characters are allowed.
-
If multiple Data Names are specified on a DN line, each Data Name must be separated by a space or comma.
EXAMPLES
DN REP-CODE(3) MTD-SALES(10.2) YTD-SALES(10.2)A field length of 10.2 signifies a numeric Data Name (presence of a decimal point in the length), whose total length is 10 characters including the decimal point and any sign, with 2 positions to the right of the decimal place. This field definition can hold values ranging from -999999.99 through +999999.99. Assigning values to these Data Names can be done with Initialization commands or on a command line in the REPORT-SECTION.
Format-Name
Section titled “Format-Name”FUNCTION
FN is a data declaration command that declares a Format from Dictionary-IV to be used in a report.
SYNTAX
FN format-name [,format-name...]- format-name
- is the name of a Format defined in Dictionary-IV.
NOTES
- Press the F1 key each time the local Data Name is added or changed. This updates the report workspace.
- This line type has the same effect as declaring all the Data Names in a Format on a DN line.
- The FN line type allows several local Data Names to be maintained in a Format definition.
- Local Data Names should not conflict with Data Names established in the Link(s) defined or with any Thoroughbred Basic directive, variable, function names, or Report-IV syntax.
- Declaring a Format from Dictionary-IV makes the Data Names accessible to the report.
- Multiple formats can be declared with one FN statement as long as the Format names are separated by spaces or commas.
- Declaring a Format name allows a standard set of Data Names to be defined as a Format in Dictionary-IV and to be used in multiple reports. This Format is not meant to be linked to any specific data file.
EXAMPLES
FN UTCUST, UTOPENARI1nn and T9nn
Section titled “I1nn and T9nn”Initialize and Terminate
Section titled “Initialize and Terminate”FUNCTION
The initialize commands (I1xx) allow you to execute procedures before the report is printed. The terminate (T9xx) commands allow you to execute procedures after the report is printed. Sample initialization routines include setting PRECISION for rounding of decimal values, setting the printer to a designated print mode, setting report parameters, or entering or assigning values to be used in the report. Sample termination routines include setting the printer back to a designated print mode or executing a specific program.
SYNTAX
I1nn [Report-IV command][;Report-IV command...] [;Thoroughbred Basic syntax][;Thoroughbred Basic syntax...]
T9nn [Report-IV command][;Report-IV command...] [;Thoroughbred Basic syntax][;Thoroughbred Basic syntax...]- nn
- is any number from 01 to 99, which represents the line number.
- Report-IV command
- is a Report-IV command.
- Thoroughbred Basic syntax
- is any valid Thoroughbred Basic syntax.
- ;
- separates the Report-IV command from other commands and/or Thoroughbred Basic syntax.
NOTES
-
Initialize commands create actual program lines numbered 101 to 199; terminate commands are numbered from 901 to 999.
-
Subroutines can be specified on Initialization and Termination lines. Use Thoroughbred Basic commands to bypass these subroutines and to resume normal Report-IV processing when necessary.
-
All Reports are CALLed. To run another program from within a Report-IV definition, execute a CALL to a Method, a CALL to a public program, a CALL to “IRPCA0” or another CONNECT REPORT. Doing a RUN program_name from inside a definition is no longer supported. To scan one or more libraries for instances of RUN program_name select the Report RUN Scan option from the OPENworkshop Upgrade Administration menu.
-
Thoroughbred Basic user-defined functions can be established on Initialization and Termination lines.
-
Commands intended to exit a report before normal termination should GOTO Termination lines to exit the report as normal.
-
To print forms or labels, suppress form feed as follows: Set the report length to 0 and delete header lines. For example:
I109 /RL=0If Header lines are present, one form feed is generated and headers will be printed.
EXAMPLES
I101 /PC=CW12 /RL=64I102 PRECISION 4T901 /PC=CW10Before the report is printed, the first initialize command sets the printer to 12-character pitch with a printer command (/PC=CW12), and the report length to 64 lines per page (/RL=64). The second initialize command sets PRECISION (a Thoroughbred Basic directive) to 4 for rounding to the fourth decimal place (default is 2). The terminate command resets the printer back to 10-character pitch when the report is complete.
- Note:
- CW12 and CW10 are defined in the printer table.
DN START(6) MATCH(4) CONVSN(5.2)I101 START = "C1"; MATCH(2,3) = "R45"; CONVSN = 34.45This is an example of Data Name assignment using the Initialize command. Assignments using Data Names must be separated by at least one space. Operators in expressions (= / * - +) must also be surrounded by spaces. Substring position syntax may be used on either side of the equation.
This demonstrates a series of procedures using Report-IV commands and Thoroughbred Basic
commands:
DN START-KEY(6) END-KEY(6)I101 /RL=45 ;PRINT 'CS',I102 INPUT @(10,2),"START WITH CUSTOMER #: ", START-KEY ,: @(10,3),"END WITH CUSTOMER #: ", END-KEY ,I103 IF CTL=1 OR END-KEY > START-KEY THEN GOTO 102: ELSE IF CTL=4 THEN GOTO 901- DN Defines two Data Names,
- START-KEY with a field length of 6 and END-KEY with a field length of 6.
- I101
- Sets the report length to 45 lines per page using a report command and uses a Thoroughbred Basic command to print a message. Note, a space and a semi-colon (;) are used to separate the Report-IV command from the Thoroughbred Basic command.
- I102
- A Thoroughbred Basic command is used to input values to Data Names. It is important that spaces precede and follow Data Names. Numeric Data Names cannot be used for input statements; only alphanumeric Data Names can be used.
- I103
- A Thoroughbred Basic command is used to test the assigned Data Name values. The result of testing uses GOTO to direct processing to appropriate initialize or terminate lines. If the F1 key is pressed, or the value in END-KEY is greater than the value in START-KEY, the processing will go to line I102 and ask for the start and end keys. If the F4 key is pressed, the processing will terminate.
From the Report-IV Reference, version 8.9.1. Open this page in the PDF