Specifies the report footing.
Syntax
REPORT FOOTING [TEMPLATE name] reportitem [:format:]
Parameters
| TEMPLATE name | For graphical reports, the name of an optional template to define the layout of the report. |
| reportitem | Any valid expression. Complex expressions must be enclosed in parentheses. When you specify more than one expression, each must be separated from the next by at least one space. |
| format | A set of instructions defining the format for the associated reportitem. Format is enclosed in : (colons) and can consist of any valid combination of format options. |
Comments
Generates a line-oriented footing at the very end of the report, regardless of whether the report itself is line-oriented or column-oriented. To generate column-oriented footings, use the BREAK (Reports) command with a constant expression.
The footing can include individual data values only from the last member of the REPORT FROM set. However, summary data computed over all records in the set (using aggregate functions) can appear in the footing.
See Also
How to Use The Report Generator
PAGE FOOTING
REPORT HEADING
Report Item Format Options
Compiles an application program.
Syntax
COMPILE progdocname
Parameters
| progdocname | The name of the application document that contains the application program to be compiled. |
Comments
The COMPILE command reads the program compiles it, and stores the compiled version in a separate disk file. The source program is then marked as being compiled. Thereafter, the compiled version of the program is used when that program is called.
As the Compiler processes an application program, it reports any errors that it finds in the command statements. The syntactic and semantic checks performed during compilation are identical to those performed when the program is parsed using the PARSE command or when the source program is run interpretively.
If no fatal errors are detected, the Compiler completes the compilation. If a fatal error is detected, the compilation terminates.
The PARSE command should be used before compiling a program to ensure the program is syntactically correct.
The application program is identified as compiled even if errors are encountered during compilation.
The UNCOMPILE command can be used to mark a compile program as “not compiled”. The SET RUNTIME OFF command forces the software to execute all application programs interpretively.
Example
compile MyProg
See Also
$COMPILESTATUS
GENERATE
PARSE
SET COMPILEMODE
SET RUNTIME
SET SQLCOMPILE
Returns the maximum value of a set of values.
Syntax
$max(expression)
Parameters
Return Value
The value of the selected instance of expression.
Comments
Use $max to find the largest value among members of a set. Instances of expression that are $Null are ignored.
Expression is often a WHERE expression that includes only selected values in the operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the operation; otherwise, expression is considered $Null and is ignored.
Example
compute Employees where DeptName = "Sales"
evaluate (let MaxSal = $max(Salary))
(let MinSal = $min(Salary))
(let MaxSalF = $max(Salary where Sex = "F"))
(let MinSalF = $min(Salary where Sex = "F"))
At the end of this operation, MaxSal contains the highest salary paid to any employee in Sales; MinSal contains the lowest salary paid to any employee in Sales; MaxSalF contains the highest salary paid to any female employee in Sales; and, MinSalF contains the lowest salary paid to any female employee in Sales.
See Also
$average
$count
$min
$total
About Functional Expressions
WHERE
Returns the average value of a set of values, excluding $Null values.
Syntax
$average(expression)
Parameters
Return Value
Number, with the number of decimal places implied by expression.
Comments
The function calculates the average of a set of values, excluding $Null values.
Expression is often a WHERE expression that includes only selected values in the averaging operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the averaging operation; otherwise, expression is considered $Null and is not included in the averaging operation.
Example
compute Employees where DeptName="Sales"
evaluate (let AvgAge = $average($year($date)-$year(BirthDate)))
(let AvgSal = $average(Salary where Sex = "F"))
Finds the average age of all employees, and the average salary of all female employees, in the sales department.
report footing
$average(Salary)
($total(Salary*Salary) / $count(Salary) - $average(Salary) * $average(Salary))
Reports average salary and salary variance.
See Also
$count
$max
$min
$total
How to Use The Report Generator
WHERE
Builds a single character string out of separate strings, inserting a separator string.
Syntax
$squeeze(separator «,string»)
Parameters
| separator | A character string, or an expression that evaluates to a character string. Separator is placed between each instance of string. |
| string | A character string, or an expression that evaluates to a character string. Leading and trailing blanks are trimmed from string. Each string must be separated from the next by a comma. |
Return Value
Character string.
Comments
$squeeze combines specified strings into a single string, with separator placed between each string. In the function call, each string must be separated from the next by a comma. Leading and trailing blanks are trimmed from each string.
Example
$squeeze (",",LastName,FirstName,Salutation)Evaluates to “Smith,John,Mr.” when FirstName is “John “, LastName is “Smith “, and Salutation is “Mr. “.
list all Ents format $squeeze ("",EntName,EntType,AvgSize,DirName)Compresses the LIST output as much as possible.
Related Information
$concat
UNION
Combines the members of two or more result sets into a single set.
Syntax
set1 UNION set2
Parameters
| set1 | The name of a result set that resulted from the execution of a set-producing command. Set1 and set2 must have the same component structure. |
| set2 | The name of a result set that resulted from the execution of a set-producing command. Set1 and set2 must have the same component structure. |
Comments
When used within a FIND command, the set that results from the application of UNION contains all of the records from the specified sets, with duplicates being eliminated.
The sets must have the same component structure.
Example
find Employees (unrelated) WorkFor Managers keep Employees
find current (Employees -> Managers) -> MgrSet
% top level managers
find Employees WorkFor MgrSet keep Employees -> EmpSet
while
find Employees WorkFor EmpSet (Employees -> Managers) -> EmpMgrSet
if $setcount = 0
break
endif
find EmpMgrSet keep Managers -> NewMgrSet
find MgrSet union NewMgrSet -> MgrSet
endwhile
While the preceding program demonstrates the use of UNION, the program can be replaced with the single command shown below.
find Employees WorkFor Managers keep Managers -> MgrSet
See Also
INTERSECT
MINUS
Calculates a date value by adding weeks to (or subtracting weeks from) a specified date value.
Syntax
$addweeks(date,number)
Parameters
| date | a date, or an expression that evaluates to a DATE data type |
| number | a number, or an expression that evaluates to a number |
Return Value
Number, representing a DATE value.
Comments
Use $addweeks to perform arithmetic with date values. The $addweeks function calculates a date value by adding a number representing weeks to a date value. If number is negative, the effect is to subtract the weeks from the date.
The + (add) and – (subtract) operators can be used to achieve the same results.
If date or the result of the $addweeks expression is an invalid date (e.g., 19930231), it is adjusted to produce a valid date (e.g., 19930228).
Example
If $Date has the value 19981225, then
$addweeks($date,1)
Evaluates to 19990101.
$addweeks($date,-2)
Evaluates to 1998.501.
$addweeks(19980201,4)
Evaluates to 19980301.
See Also
$adddays
$addmonths
$addyears
$todate
$weekday
+ (Add/Positive)
– (Subtract/Negative)
About Functional Expressions
Arithmetic with Dates
Generates the “sounds-like” value of a string.
Syntax
$soundex(source)
Parameters
| source | a character string, or an expression that evaluates to a character string |
Return Value
Character string (alpha).
Comments
$soundex yields a “sounds-like” value for source. The value is created using an heuristic algorithm and is based on English pronunciation.
When $soundex is applied to two separate strings and they generate the same “sounds-like” value, then the two original strings can be assumed to sound the same. $soundex can be used to compare and find strings that sound the same but are spelled differently.
The result of $soundex is of data type ALPHA, therefore comparisons involving soundex values are case-insensitive.
Example
find all Customers where $soundex(LastName) = $soundex("Burton")The above command returns customer records for names like Burton, Berton, Bertyn, Bertin, BURTON, BERTIN, and so on.
find all Customers where sLastName = $soundex("Burton")The preceding command takes advantage of indexed searching by setting up sLastName as an indexed virtual field that contains the soundex values of LastName in the Customers EntitySet.
let SoundsLike = $soundex("Smith")
find all Customers where sLastName = SoundsLike?The preceding code fragment uses prefix searching (? wildcard) with soundex values.
See Also
? (Wildcard)
About Character Literals
About Functional Expressions
Outputs the results of one or more expressions.
Syntax
OUTPUT [expression] [;]
Parameters
| expression | Any valid expression. Complex expressions must be enclosed in parentheses. When you specify more than one expression, each must be separated from the next by at least one space. |
Comments
OUTPUT evaluates expression and sends the result to the current output device. If expression uses fields from the current set, the values are taken from the current member in that set.
OUTPUT sends one line of characters to the current output destination (application document). The software automatically terminates the output line with a carriage return/line feed combination. You can suppress the carriage return/line feed combination by placing a semicolon (;) at the end of the OUTPUT command.
You can redirect output from the terminal using a SET OUTPUT command.
To specify the number of spaces to appear between output values, use a SET COLUMNSPACING command.
Example
To send the values of the variable TestVar and the form field fEmpform.
output TestVar fEmpform.LastName
To send the values from two OUTPUT commands to one line of the application documents MyDoc, enter
set output MyDoc
output TestVar;
output fEmpform.LastName
The following commands cause the character string following OUTPUT to display on the current output device:
output “Please enter your first and last names: “;
input FirstName LastName
Important
If it is needed the issue the INPUT command in the same line as its corresponding text, the colon “:” must be present at the end of the text, just like the example above.
See Also
INPUT
SET COMPILEMODE
Controls the behavior of the Compiler.
Syntax
SET COMPILEMODE SQLMODE | ZIMMODE | SERVERMODE
Comments
The COMPILEMODE option is set to SQLMODE by default. The compiler generates SQL database code—that is, code bound to a particular SQL database type.
In ZIMMODE, EntType, RelType, and so on, are ignored. The compiler generates standard Zim code.
In SERVERMODE the compiler generates Zim Server code when the objects are defined as “zimserv” (or an alias of it). SERVERMODE is the preferred setting since ZIM execution is most often more efficient. Also, Zim Server requests if all entity sets and relationships in the command are for the same Zim server.
When COMPILEMODE is SQLMODE, Zim generates code that is bound to a particular SQL database type. By setting COMPILEMODE to ZIMMODE, Zim generates standard Zim code.
If a program has been compiled with SERVERMODE or SQLMODE on, the program is flagged as compiled for a server and can only be executed in SERVERMODE or SQLMODE. In ZIMMODE, these types are ignored and all entity sets and relationships are assumed to be part of the local Zim database. During compilation in ZIMMODE, no server requests are stored in the compiled code and the program is flagged as compiled for Zim. Executing such a program never results in server access.
Example
To compile a Zim Client-server application to run as a standard Zim application, enter
> set compilemode zimmode
See Also
COMPILE
SET EXECUTEMODE
SET SQLCOMPILE
UPDATE