Do you have a question about the ENFORM 058057 and is the answer not in the manual?
Questions and answers
Subscribe to Our Youtube Channel
Summary of Contents for Tandem ENFORM 058057
Page 1
Data Management Library ENFORM ™ Reference Manual Abstract This manual provides detailed information about the syntax of the ENFORM language. Part Number 058057 Tandem Computers Incorporated...
Page 2
Document History Edition Part Number Operating System Version Date First Edition 82348 A00 GUARDIAN A04/E05 October 1982 Second Edition 82348 B00 GUARDIAN A05/E06 April 1983 Update 1 82194 GUARDIAN A06/E07 December 1983 Update 2 82205 GUARDIAN B00/E08 March 1985 Third Edition 058057 GUARDIAN B00/E08 July 1991...
Page 3
Document History Edition Part Number Operating System Version Date First Edition 82348 A00 GUARDIAN A04/E05 October 1982 Second Edition 82348 B00 GUARDIAN A05/E06 April 1983 Update 1 82194 GUARDIAN A06/E07 December 1983 Update 2 82205 GUARDIAN B00/E08 March 1985 Third Edition 058057 GUARDIAN B00/E08 July 1991...
Page 4
New and Changed Information This update to the ENFORM Reference Manual describes the following principal changes: The @ CENTER-PAGE Option Variable clause now centers the entire report body on the page. The CENTER clause centers items on the page independently of @ CENTER-PAGE.
Page 5
New and Changed Information (This page left intentionally blank) 058057 Tandem Computers Incorporated...
Page 6
New and Changed Information 058057 Tandem Computers Incorporated...
Contents Preface xv Notation Conventions xvii Section 1 Introduction ENFORM Terminology 1-1 Section 2 Running ENFORM Interactive Mode 2-2 Noninteractive Mode 2-2 The Current Output Listing File 2-3 Pressing the Terminal BREAK Key 2-3 Logical File Assignments 2-5 Passing Parameters to Compiled Query Files 2-6 A Server Query Processor 2-6 The Command Interpreter ASSIGN Command 2-8 The Command Interpreter PARAM Command 2-8...
Page 8
Contents Subscripts 3-9 Aggregates 3-12 Predefined Aggregates 3-14 User Aggregates 3-15 Target Aggregates 3-16 Target Aggregate with OVER ALL Syntax 3-16 Target Aggregate with OVER Syntax 3-17 Qualification Aggregates 3-18 Qualification Aggregate with OVER ALL Syntax 3-18 Qualification Aggregate with OVER Syntax 3-18 Qualification Aggregates and Target Records 3-19 Qualification Aggregate with Embedded WHERE Clause 3-21 Aggregates and Scale 3-21...
Page 9
Contents Section 4 Statements AT END Statement 4-3 Specifying a Field Name in an AT END Statement 4-3 Spacing Considerations 4-3 AT END Information for Current Report or All Reports 4-4 Cancelling Session-Wide AT END Information 4-4 AT START Statement 4-5 Specifying a Field Name in an AT START Statement 4-5 Spacing Considerations 4-5 AT START Information for Current Report or All Reports 4-6...
Page 10
Contents LINK OPTIONAL Statement Considerations 4-27 Rules for Using LINK OPTIONAL Statements 4-27 How ENFORM Handles “Non-Contributing” Record Descriptions 4-28 LIST Statement 4-31 Input Record Description 4-33 Group Definition and Sorting 4-33 How Values Are Displayed in Report Columns 4-33 Request-Qualification 4-35 Conditional Printing 4-35 Summary Reports 4-35...
Page 11
Contents Section 5 Clauses AFTER CHANGE Clause 5-4 Specifying a Field Name within an AFTER CHANGE Clause 5-4 Spacing Considerations 5-4 ASCD and DESC Clauses 5-6 AS Clause 5-7 Repeatable Edit Descriptors 5-9 Alphanumeric Edit Descriptor 5-10 Integer Edit Descriptor 5-10 Fixed Format Edit Descriptor 5-11 Mask Edit Descriptor 5-12 Nonrepeatable Edit Descriptors 5-14...
Page 12
Contents AT START PRINT Clause 5-29 Specifying a Field Name in an AT START PRINT Clause 5-29 Spacing Considerations 5-29 AT START Information for Current Report or All Reports 5-30 Overriding Session-Wide AT START Information 5-30 BEFORE CHANGE Clause 5-31 Specifying a Field Name within a BEFORE CHANGE Clause 5-31 Spacing Considerations 5-32 BY and BY DESC Clauses 5-33...
Page 13
Contents NOPRINT Clause 5-47 Suppress Single Report Items 5-47 Suppress All Report Items 5-47 Option Variable Clauses 5-48 PCT Clause 5-55 Using PCT OVER ALL 5-55 Using PCT OVER By-item 5-55 Combining Percentages and Subtotals 5-56 PCT Clause Used with User Variable 5-56 Restrictions 5-56 SKIP Clause 5-57 SKIP Clause with a LIST Target-item or By-item 5-57...
Page 14
Contents TITLE Clause 5-69 Specifying Field Names in a TITLE Clause 5-69 Spacing Considerations 5-69 Title for Current Report or All Reports 5-70 Overriding Session-Wide Title 5-70 TOTAL Clause 5-71 WHERE Clause 5-72 Using the WHERE Clause to Establish a LINK 5-72 Section 6 Commands ?ASSIGN Command 6-2 ?ATTACH Command 6-5...
Page 15
Contents Appendix B Error Messages ENFORM Initialization Messages B-2 !!! Error and ***Warning Type Messages B-3 *** File Error Type Messages B-19 ENFORM Trap Messages B-23 BUILDMK Messages B-23 Appendix C LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK C-1 Links Initiated by a LINK Statement C-1 Links Initiated by a LINK OPTIONAL Statement C-1 Links Initiated by a WHERE Clause C-2...
Page 16
Contents Figures Figure 1-1. Typical ENFORM Session 1-2 Figure 2-1. Server Query Processor with Several Compiler/Report Writer Processes 2-7 Figure 3-1. ENFORM Language Elements 3-2 Figure 3-2. Records with Duplicate Field Names 3-7 Figure 3-3. Query Outline of Target-Aggregate with OVER ALL Syntax 3-16 Figure 3-4.
Preface This manual is one of three volumes that describe the ENFORM language. It concerns syntax only and should be used as a reference by experienced ENFORM users. For other information about ENFORM and related products, refer to the publications listed below.
Page 18
Preface (This page left intentionally blank) 058057 Tandem Computers Incorporated...
Page 19
Preface xvii 058057 Tandem Computers Incorporated...
Notation Conventions This table describes the characters and symbols used in this manual’s syntax notation. For distinction, syntactical elements appear in a typeface different from that of ordinary text. Notation Meaning UPPERCASE LETTERS All keywords and reserved words appear in capital letters. If a keyword can be abbreviated, the part that can be omitted is enclosed in brackets.
Page 21
Notation Conventions (This page left intentionally blank xviii 058057 Tandem Computers Incorporated...
1 Introduction This publication documents: The syntax of the Command Interpreter ENFORM command needed to call the ENFORM process, the Command Interpreter commands needed to create a server query processor, and the names of generic files that can be assigned using either the Command Interpreter ASSIGN command or the ENFORM ?ASSIGN command.
Page 23
Introduction ENFORM Terminology Figure 1-1. Typical ENFORM Session Begin Session :ENFORM Enter Query Specifications >?DICTIONARY $mkt.sample Command >OPEN employee; Statement >LIST BY empnum, By-item Target- Clause empname,salary, list Statement Target-items Query WHERE salary GT 2000; Clause Request-Qualification Report Compiler/ Report Writer Dictionary Target- Records...
Introduction ENFORM Terminology By-items. Field names modified by the BY or BY DESC clauses described in Section 5. The values of the fields are used to sort and group the query output. Request-qualification. A condition or conditions that a data base element must meet before it is selected to contribute to your query output.
Page 25
Introduction ENFORM Terminology (This page left intentionally blank) 1–4 058057 Tandem Computers Incorporated...
2 Running ENFORM The ENFORM command issued from the Command Interpreter calls the ENFORM subsystem. If no parameters are specified, the ENFORM command appears as: :ENFORM The terminal from which the ENFORM command is entered is called the home terminal. The syntax for the ENFORM command is: ENFORM [ / [ IN input-filename ] [ , [ OUT output-filename ] ] / ] [ dict-subvol-name ] [ , message-table-filename ]...
Running ENFORM Interactive Mode Interactive Mode ENFORM functions in interactive mode when the ENFORM source code is entered from a terminal keyboard. ENFORM prompts for input by printing the right angle bracket (>). When a carriage return is entered, ENFORM issues another prompt. For example: :ENFORM ENFORM - T9102C09 - (02APR82) DATE - TIME: 6/16/81 - 10:14:52 >...
Running ENFORM Pressing the Terminal Break Key The Current Output The current output listing file is the file to which ENFORM directs output. During the Listing File course of an ENFORM session, the current output listing file can change. At the beginning of an ENFORM session, the current output listing file is the default output file.
Page 29
Running ENFORM Pressing the Terminal Break Key The current activity determines the action taken as follows: Pressing the terminal BREAK key when ENFORM is processing a query, producing a report, or producing output from the ?SHOW command, returns the terminal to the ENFORM prompt (>). Query execution and any output (the report or the output produced by the ?SHOW command) terminates.
Running ENFORM Logical File Assignments Logical File ENFORM allows logical file assignments to be made either before or after the Assignments Command Interpreter ENFORM command is entered. When the logical file assignment is made from within the ENFORM subsystem, use the ENFORM ?ASSIGN command described in Section 6.
Running ENFORM Passing Parameters to Compiled Query Files Passing Parameters to ENFORM allows you to pass parameters to a compiled query file. The compiled query Compiled Query Files file must contain a PARAM statement defining the parameter. The PARAM statement is discussed in Section 4.
Running ENFORM Passing Parameters to Compiled Query Files Figure 2-1. Server Query Processor With Several Compiler/Report Writer Processes ENFORM Compiler/ Report Report Writer Process Dictionary A Data Base A ENFORM Compiler/ Report Writer Process Output File ENFORM Server Query Processor Compiled ENFORM Query...
Running ENFORM Passing Parameters to Compiled Query Files For every physical file an ENFORM application accesses, the server query processor The Command Interpreter ASSIGN Command must do open/close operations that add to the processing time. This processing time can be reduced significantly if ENFORM applications that frequently use the same physical files are processed by a common server query processor.
Running ENFORM Passing Parameters to Compiled Query Files COST max-cost sets a strategy cost limit for each ENFORM query using this server query processor. If an ENFORM query exceeds the limit, it is terminated and an error message is displayed. Refer to the @COST-TOLERANCE Option Variable in the Option Variable clauses in Section 5 for an explanation of strategy cost limits.
Running ENFORM Generic Files Sets a limit of 2 on the cost strategy Waits up to three minutes before stopping. :ASSIGN F1, $data.database.parts :ASSIGN F2, $data.database.order :ASSIGN F3, $data.database.odetail :PARAM REQUESTORS 15, COST 2, TIMEOUT 3 :QP / NOWAIT, NAME $qp1 / The server query processor keeps open those files that have been assigned “F”...
Page 36
Running ENFORM Generic Files Table 2-1. ENFORM Generic Files and Their Uses Generic File Name QUERY-COMPILER-LISTING All compilation output produced during an ENFORM session (that is, entering a query either directly or indirectly ); compiler errors and warnings; including output, errors, and warnings from other ENFORM commands (such as ?ASSIGN and ?SHOW).
Running ENFORM Generic Files Table 2-1. ENFORM Generic Files and Their Uses (continued) Generic File Name QUERY-QPSTATISTICS The statistics produced for every FIND or LIST statement that is successfully processed by the query processor during an ENFORM session (regardless of the setting of @STATS). Each set of statistics is identified by a line containing the requestor’s PID and the beginning and ending times of the query execution.
Running ENFORM Generic Files The generic files QUERY-WORK-AREA, QUERY-SORT-AREA, QUERY- Generic Files and the Server Query Processor QPSTATISTICS, and QUERY-QPSTATUS-MESSAGES can be held open for the lifetime of a server query processor if the Command Interpreter ASSIGN command (see A Server Query Processor earlier in this section) is specified at the time the server query processor is created.
Running ENFORM Generic Files Table 2-2. ENFORM Output Files ENFORM Output Output File ENFORM banner and trailer 1) The QUERY-COMPILER-LISTING file if assigned, otherwise Commands 2) to the default output file. Statements Command output (e.g.,?SHOW) Report from a LIST statement 1) The ?OUT file if specified, otherwise 2) QUERY-REPORT-LISTING file if assigned, otherwise 3) to the default output file.
3 ENFORM Language Elements An ENFORM query is built with elements of the ENFORM language. This section contains: An explanation of the ENFORM language elements that are used throughout query specifications. These elements are: reserved words, special characters, and comments. A brief explanation of the functions of the ENFORM statements, clauses, and commands.
ENFORM Language Elements Figure 3-1. ENFORM Language Elements ?DICTIONARY $mkt.sample Command Keyword Special Character DECLARE user-var; Statement Special Character User Variable Keyword AT END PRINT "The End"; Statement Special Character String Literal Keywords OPEN employee; Statement Special Character Record Name Keyword LIST empnum,empname,salary, Field Names...
ENFORM Language Elements Reserved Words Reserved Words Reserved words are words with special meaning to ENFORM. Both in syntax and elsewhere in this publication reserved words are shown in uppercase characters. Reserved words must be spelled exactly as shown. Do not use reserved words to name records, fields, variables, tables, or parameters. Reserved words can be redefined or translated to a language other than English.
ENFORM Language Elements Special Characters Special Characters Table 3-2 shows the ENFORM special characters and describes their functions within a query. Table 3-2. Special Characters Character Name Character Description blank Separates keywords and other language elements. quotation mark ” Serves as delimiter for various language elements, such as alphanumeric literals, and some display formats.
ENFORM Language Elements Commands Statements Statements contain specifications for selecting and formatting elements from your data base. Composed of keywords, clauses, and target-lists, the ENFORM statements LIST and FIND provide the basic specifications for information selection. Additional statements establish the query environment and provide some report structuring capability.
ENFORM Language Elements Rules for Naming User Defined Elements Rules for Naming User When you name variables, tables, aggregates or parameters, the name: Defined Elements Must be unique. Must start with either an alphabetic character or a circumflex (^). Can contain numbers, hyphens (-), or circumflexes (^). Can be from 1 to 31 characters in length.
ENFORM Language Elements Rules for Naming User Defined Elements A field name requires as much qualifying as necessary to uniquely identify the field to ENFORM. The necessary qualification might be as simple as combining the field name with the record name or group name. It might require combining the field name with both a group name and a record name or with two group names.
Page 47
ENFORM Language Elements Rules for Naming User Defined Elements The primary key for files with key-sequenced file structure is a field within the record. For key-sequenced files, referencing the primary key using the form record-name.KEY is the same as explicitly naming the field described as the primary key. The advantage of the form record-name.KEY is that you do not have to know the name of the primary key field in order to reference it.
ENFORM Language Elements Subscripts Subscripts Subscripts, although they are not required, are usually used to reference elements in a user table or data base table. (A data base table is created when the dictionary description of a data base field contains an OCCURS clause.) Subscripts are needed for references to user tables and data base tables because all the elements in such tables have the same name.
Page 49
ENFORM Language Elements Subscripts grp-name is the name of a group described in the dictionary. A group is defined as a record element whose level number (02, 03, 04,...) is less than that of the next record element. field-name-ref2 is the name of a subordinate field. A subordinate field is defined as a record element whose level number (05, 06, 07,...) is greater than that of grp-name.
Page 50
ENFORM Language Elements Subscripts Subscript-range can be included in user or data base table references when the table is the target-item in a LIST statement. Subscript-range is illegal if a data base table is modified by a BY, BY DESC, ASCD, or DESC clause. (Refer to Section 5 for information about these clauses.) Including subscript-range is the same as referencing the table elements individually.
ENFORM Language Elements Aggregates ENFORM allows you to reference nested data base tables. For example: Refers to month, top-dept, and the first tot-sales through last elements of wkly-sales within the first element of tot-sales. Refers to the second element of wkly-sales tot-sales[4].wkly-sales[2] within the fourth element of tot-sales.
Page 52
ENFORM Language Elements Aggregates COUNT is a predefined ENFORM aggregate that tallies the occurrences of a field defined as either numeric or alphanumeric. is a predefined ENFORM aggregate that finds the highest number in a set of numbers or expressions, or finds the alphanumeric string with the highest value based on the ASCII collating sequence.
ENFORM Language Elements Aggregates OVER defines a range for the aggregate operations. The aggregate operation takes place only over the specified over-item. The operation yields one aggregate value for each unique value of over-item. UNIQUE excludes duplicate values from contributing to the collecting operation of the aggregate.
ENFORM Language Elements Aggregates When the predefined aggregates do not meet your needs, you can define your own User Aggregates aggregates with a DECLARE statement. A user-defined aggregate can be used anywhere a predefined aggregate can appear with two exceptions: A user aggregate cannot be referenced in the end expression of the declaration of another user aggregate.
ENFORM Language Elements Aggregates The user-aggregate name is grossavg. The formal-argument is x. The step-expression is (grossavg + .10 * x). The end-expression is grossavg/COUNT (x). This user-aggregate could be used to compare the new gross salaries to the old average salary: LIST AVG (salary), grossavg (salary);...
ENFORM Language Elements Aggregates Specifying the aggregate shown in Figure 3-3 is the same as specifying: AVG(target-item-2); The query groups target-item-1 and target-item-2 within by-item-2. The aggregate AVG is used and the average value of target-item-2 is found by totaling all of the values of target-item-2 and dividing that total by the number of target-item-2 values.
ENFORM Language Elements Aggregates In this example, AVG target-item-1 prints as a separate report column with a non- blank entry only on the first line of each new by-item-2 group. This entry represents the average of target-item-1 over the by-item-2 group. When a target aggregate is specified in a FIND statement with the OVER syntax, the aggregate value is present only in the first target-record for a by-item.
ENFORM Language Elements Aggregates Qualification Aggregates and Target Records A qualification aggregate functions as a full subquery. This means that ENFORM computes the value for the aggregate over all the records in the data base file, (not over the target records selected in the rest of the LIST or FIND statement) and uses the result as input to the target list.
ENFORM Language Elements Aggregates Figure 3-5. Query Outline of Qualification Aggregate with OVER Over-item Syntax OPEN employee; LIST regnum, branchnum, WHERE salary GT AVG( salary OVER regnum ); The qualification aggregate value for each group is: regnum AVG salary 24666 28333 38000 39500...
ENFORM Language Elements Aggregates Qualification Aggregate with an Embedded WHERE Clause If a qualification aggregate contains a WHERE clause that restricts the records for the aggregate calculation, ENFORM processes the embedded WHERE clause before the aggregate. If any record for an over-item does not satisfy the restriction specified in the embedded WHERE clause, ENFORM excludes that record from the aggregate calculation.
ENFORM Language Elements Literals If you want the aggregate to return a value with a scale other than that of the input field, assign the result to a user variable declared with the appropriate scale. For example: DECLARE fixit INTERNAL F6.2; LIST fixit := AVG (price OVER partnum);...
ENFORM Language Elements Arithmetic Expressions String literals can stand alone as target-items in a LIST statement. Using a string literal in this manner allows printing of one or more constant characters between two columns of data. For example: LIST customer,"..",address; produces the following report: CUSTOMER ADDRESS...
ENFORM Language Elements Logical Expressions The scale of the result is determined by the number of digits after the decimal point. Scale Factor of the Result In an arithmetic expression, the result has the same number of digits after the decimal point as the field or variable in the expression with the greatest precision.
Page 64
ENFORM Language Elements Logical Expressions The syntax of a logical expression is: [NOT] condition [NOT] condition condition has one of the following forms: BEGINS WITH [ not ] CONTAINS string-literal '>' conditional operator field-name EQUAL value-range [NOT] "[" pattern-match "]" <>...
ENFORM Language Elements Logical Expressions string-literal is the pattern of characters or numbers to which the field is being compared. String-literal must be enclosed in quotation marks. is two integers separated by comma indicating that at least m characters but not more than n characters must precede or follow string-literal when it is found in a field value.
ENFORM Language Elements Logical Expressions BEGINS WITH and CONTAINS are special conditional operators that can be used to BEGINS WITH and CONTAINS yield a true or false value if a field either begins with or contains a specific alphanumeric string. The BEGINS WITH operator determines if a field starts with a specified alphanumeric string.
ENFORM Language Elements IF/THEN/ELSE Expressions A range expression can also use a string literal if the field being examined is defined as alphanumeric in the data dictionary. The partname field is defined as PIC X(18). The following logical expression is evaluated as true if partname field contains a value that falls with in the range of A to L: partname EQ "A"...
ENFORM Language Elements User Variables The value keywords NULL, BLANK, and BLANKS print blanks on reports. The value keywords ZERO and ZEROS print zeros on reports. Consider the following IF/THEN/ELSE expression: IF partnum = 2001 THEN ZEROS ELSE partnum, This expression specifies that if partnum is equal to 2001, then zeros are to be printed on the report.
ENFORM Language Elements User Variables When a user variable is specified as a target-item, ENFORM uses the default value or User Variable as a Target-item the initial value, whichever is appropriate. When a user variable is a target-item in a LIST statement, assignment syntax can be used to specify a new value for the user variable.
Page 70
ENFORM Language Elements User Variables When assignment syntax is used, ENFORM reassigns a value to the user variable for each target-record; therefore, the value of the user variable might be different for each target-record. For example: LIST u-var, u-var := salesman; ENFORM uses the default or initial value for the first occurrence of u-var in every target-record.
ENFORM Language Elements Arithmetic Overflow Conditions A user variable can be specified in a request-qualification. When a user variable is A User Variable in Request-Qualification used for request qualification, ENFORM always uses either the default or initial value whichever is appropriate. Consider the following: SET u-var to 10;...
4 Statements This section contains the syntax of the ENFORM statements. The statements are arranged in alphabetical order to provide ease of access. The ENFORM statements, with the exception of the LIST and FIND statement, have a session-wide affect unless cancelled or overridden. The LIST and FIND statements effect only the queries of which they are a part.
Page 73
Statements Table 4-1. Summary of Statements (continued) Report Information Formatting Statement Function AT END prints information at the end of all subsequent reports in the current session. See also the AT END PRINT clause in Section 5. AT START prints information just before the first set of column headings for all subsequent reports in the current session.
Statements AT END Statement AT END Statement The AT END statement allows you to specify information that is printed at the end of all subsequent reports in the current session unless cancelled or reset by another AT END statement or overridden by an AT END clause. (See the AT END PRINT clause in Section 5.) The syntax of the AT END statement is: AT END [ PRINT print-list [ CENTER ] ] [ ;...
Statements AT END Statement Using the CENTER clause following the print-list of an AT END statement centers the information on the page. The CENTER, Option Variable, SKIP, SPACE, and TAB clauses are described in Section 5. AT END Information for An AT END statement prints information at the end of all subsequent reports in the Current Report or All current session.
Statements AT START Statement AT START Statement The AT START statement allows you to specify information that is printed just before the first set of column headings for all subsequent reports in the current session unless cancelled or reset by another AT START statement or overridden by an AT START clause.
Statements AT START Statement If you specify either a SKIP clause or the symbol / (slash) within a print-list, the printer advances one or more lines before printing the rest of the AT START print-list. The number of lines advanced can be affected by one or more of the following: the digit (if any) following the keyword SKIP, the number of slashes specified, or the option variable @VSPACE.
Statements CLOSE Statement CLOSE Statement The CLOSE statement allows you to delete a user variable, user aggregate, user table, a parameter, or a record description from the internal table. The syntax of the CLOSE statement is: record-name user-variable-name CLOSE user-aggregate-name , ...
Statements DECLARE Statement DECLARE Statement The DECLARE statement allows you to define a user variable, user aggregate, or user table. The syntax of the DECLARE statement is: user-variable-name user-table-name "[" max-subscript "]" DECLARE user-aggregate-name ( formal-argument ) = ( step-expression˚ [ ‚ [ end-expression ] [ ‚...
Statements DECLARE Statement internal-format is the internal format for storing the user variable, aggregate or table. display-format is the default display format for printing the declared item. heading-string is a string literal that is the default heading for the declared element. Remember string literals must be enclosed in quotation marks (“...
Statements DECLARE Statement A user variable or table declaration remains in effect until the end of the current Declaring a User Variable or User Table ENFORM session unless you override the user variable or table by declaring a new variable or table with the same name. By default both user variables and elements in user tables are stored as 64-bit signed integers.
Statements DELINK Statement DELINK Statement The DELINK statement allows you to clear a connecting relationship between dictionary record descriptions. The syntax of the DELINK statement is: record-name1 [ TO [OPTIONAL] ] record-name2 VIA field-name DELINK , ... [;] qualified-field-name1 [ TO [ OPTIONAL ] ] qualified-field-name2 record-name1 or record-name2 are the names of dictionary record descriptions.
Statements DICTIONARY Statement DICTIONARY The DICTIONARY statement allows you to identify the subvolume containing your Statement dictionary. It also allows you to clear the internal table. The DICTIONARY statement has the same effect as the ?DICTIONARY command. The syntax of the DICTIONARY statement is: DICTIONARY [ dict-subvol-name ] dict-subvol-name...
Statements DICTIONARY Statement Entering the DICTIONARY statement without a volume and subvolume name is a Clearing the Internal Table simple means of clearing the entire internal table and reclaiming table space without changing the dictionary. To clear only certain elements of the internal table, refer to the CLOSE and DELINK statements in this section.
Statements EXIT Statement EXIT Statement The EXIT statement terminates the current ENFORM session. The syntax of the EXIT statement is: EXIT [ ; ] The EXIT statement returns control to the invoking process, usually the Command Interpreter. The EXIT statement is the same as the ?EXIT command. Pressing the CTRL and Y terminal keys simultaneously is an alternate way to exit ENFORM.
Statements FIND Statement FIND Statement The FIND statement allows you to specify the input fields and records that contribute to the target-record and either write output records to a physical file or transmit output records to a host language program. The FIND statement must end with a semicolon.
Statements FIND Statement target-item is an input field. Valid values for an input field are: a field name, a string literal enclosed in parentheses, a predefined aggregate, a user aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user table name, a user variable, or a System Variable.
Statements FIND Statement The BY and BY DESC clauses group and sort records. The appearance of a BY or BY Group Definition and Sorting DESC clause in a FIND statement causes every occurrence of a grouped by-item value to be written to the output record (unlike the LIST statement where only the first occurrence of a grouped value is written to the output record).
Page 89
Statements FIND Statement If you omit output-field-name, ENFORM assumes that it is the same as the input field name (including any subscripts or qualifications that apply to the input field name). Consider, for example, the following record descriptions and FIND statements: RECORD OLD.
Statements FIND Statement The output fields receive values from any combination of the following input Input Elements elements: The value of a field from the input record. The assignment to an output-field-name is optional. When you do not specify the output-field-name, ENFORM assumes it is the same as the field name from the input record.
Statements FIND Statement The value of either a user aggregate or a predefined aggregate. FIND ... ( BY employee.job, employee.salary, rate := AVG (salary OVER job), ... ) ; A group name. ENFORM allows you to specify a group name as an input element.
Page 92
Statements FIND Statement When you explicitly request summary records you get target-records summarized down to the lowest level where an aggregate is calculated over that level. For example: SET @SUMMARY-ONLY TO ON; FIND findfil ( BY employee.dept, BY employee.job, BY employee.empname, employee.salary, COUNT(employee.empname OVER employee.job);...
Statements FIND Statement ENFORM queries with a FIND statement produce records only. There are no report Statements and Clauses That Do Not Apply to the features such as headings, titles, summary information, and special formatting. The following statements and clauses apply only to queries using the LIST statement and FIND Statement cannot be used with the FIND statement.
Statements FOOTING Statement FOOTING Statement The FOOTING statement allows you to specify a footing to be printed at the bottom of each report page for all reports in the current session unless overridden or reset by another FOOTING statement or temporarily overridden by a FOOTING clause. (See Section 5 for the FOOTING clause.) The syntax of the FOOTING statement is: FOOTING [ print-list [ CENTER ] ] [ ;...
Statements FOOTING Statement Using a FORM clause within a FOOTING statement forces a new page. ENFORM continues with the remainder of the FOOTING print-list. The page number remains the same. A single logical page can span multiple physical pages such that a TITLE can appear on one page, the data on the next, and a FOOTING on the next.
Statements LINK Statement LINK Statement The LINK statement allows you to specify a connecting relationship between dictionary record descriptions. The syntax of the LINK statement is: record-name1 [ TO ] [ OPTIONAL ] record-name2 VIA field-name LINK ,...[ ; ] qualified-field-name1 [ TO ] [ OPTIONAL ] qualified-field-name2 record-name1 and record-name2...
Statements LINK Statement When you use either the LINK statement or the LINK OPTIONAL statement, you Duration of Link Established by LINK or establish a link that exists for the duration of the ENFORM session. You can clear such a link by entering one of the following: LINK OPTIONAL Statement a CLOSE statement for one of the record descriptions.
Statements LINK Statement When you establish a link by specifying the LINK OPTIONAL statement, you preserve LINK OPTIONAL Statement Considerations all of the information from the data file whose record description is specified on the left side of the statement. You preserve this information because ENFORM builds the logical records for such a link in a different manner than it does for a link established by a LINK statement.
Statements LINK Statement ENFORM uses these rules to determine whether your query specifications contain legal links. (Unless otherwise stated, the word link applies to a link established by a WHERE clause, a LINK statement, or a LINK OPTIONAL statement.) These rules are: A record description on the right side of a LINK OPTIONAL statement must not be linked back to the record description on the left side of the same LINK OPTIONAL statement.
Page 100
Statements LINK Statement Any record description that is linked to a “non-contributing” record description is also “non-contributing.” For example, consider the following query specifications: OPEN employee, region, order; LINK order.salesman TO OPTIONAL employee.empnum; LIST ordernum, empname, regname WHERE employee.regnum = region.regnum; If the employee record description is “non-contributing”...
Page 101
Statements LINK Statement If your query involves aggregates, you can eliminate these invalid results by including the WHERE option with the aggregate. For example, suppose that you want to use the aggregate COUNT to count the occurrences of no-num, a two-character field that is declared alphanumeric (PIC XX or TYPE CHARACTER 2) in the record description.
Statements LIST Statements LIST Statement The LIST statement allows you to select the information printed in a report and prints the report. The LIST statement must end with a semicolon. The syntax of the LIST statement is: BY by-item BY DESC by-item target-item ASCD target-item DESC target-item...
Page 103
Statements LIST Statements UNIQUE prevents identical records from contributing to the report. UNIQUE adds processing overhead and should not be used unless undesirable duplicate records are known to exist. by-item is the name of a field modified by a BY or a BY DESC clause. ENFORM sorts and groups the report according to the value of this field.
Statements LIST Statements When you use a LIST statement, ENFORM opens the data files associated with any Input Record Description open record descriptions. (You open record descriptions by using OPEN statement.) ENFORM obtains information about the structure of the data file from the record description.
Page 105
Statements LIST Statements an IF / THEN / ELSE expression. Enclose IF/THEN/ELSE expressions in parentheses. LIST ..., (IF inventory GT 0 THEN inventory ELSE ZERO); a user variable. Define the user variable with a DECLARE statement. The variable should be either initialized with a SET statement or assigned a value with assignment syntax.
Statements LIST Statements Within this record, account-num is a group. The data type of a group is always alphanumeric. When a group name is specified as a target-item within a LIST statement, ENFORM displays each field within the group as alphanumeric data. If one of the fields within a group contains binary data, using a group name as a target-item causes undesirable results.
Page 107
Statements LIST Statements returns one record for each job in each department. Only the first employee name (empname) for each job is returned, as follows: COUNT DEPT EMPNAME SALARY EMPNAME ---- ------- ------ ------- 0101 MANAGER JACK RAYMOND 36000 SALESMAN JIM HERMAN 19000 SECRETARY...
Statements LIST Statements returns more than one record for each job in each department. All the employee names (empname) for each job are returned, as follows: COUNT DEPT EMPNAME EMPNAME ---- ------- ------- 0101 MANAGER JACK RAYMOND TIM WALKER SALESMAN JIM HERMAN TOM HALL SECRETARY...
Page 109
Statements LIST Statements NOHEAD clause suppresses the printing of the column heading for a target-item or by-item NOPRINT clause suppresses the printing of a target-item or by-item PCT clause prints a percentage for a target-item or by-item SUBFOOTING clause prints a subfooting for a report SUPPRESS clause defines a condition that prevents specific records from printing in a report SUBTOTAL clause prints a subtotal for a target-item within each by-item...
Statements OPEN Statement OPEN Statement The OPEN statement accesses the dictionary record description. The syntax of the OPEN statement is: record-name OPEN ,...[ ; ] record-name2 [ AS ] COPY [ OF ] record-name1 record-name or record-name1 are the names of dictionary record descriptions. record-name2 is a name that you supply for the copy of record-name1.
Statements PARAM Statement PARAM Statement The PARAM statement allows you to name and define a parameter that can receive a value from a Command Interpreter PARAM command. The syntax of the PARAM statement is: PARAM { param-name [ INTERNAL internal-format ] } , ... [ ;] param-name is the name of the parameter being defined.
Statements PARAM Statement ENFORM treats a parameter syntactically as if it were a literal. ENFORM handles How ENFORM Treats Parameters parameters declared with an alphanumeric internal format as string literals. ENFORM handles all other parameters as numeric literals. When you specify a parameter as a target-item or as an item in a print-list, you must enclose the parameter in parentheses just as you would an actual numeric literal.
Statements SET Statement SET Statement The SET statement allows you to initialize or reset a user variable, user table, or a parameter. The SET statement also allows you to reset option variables. The syntax of the SET statement is: user-variable-name string-literal user-table-name [TO]...
Statements SET Statement When initializing a user variable, user table, or a parameter, specify values that are Initializing User-Defined Elements consistent with the internal format type. If the internal format type is alphanumeric, specify a a string literal; if the internal format type is numeric, specify a numeric literal. In the following example, the user variable u-var is defined as numeric by the DECLARE statement and set to the value of 99 by the SET statement: DECLARE u-var INTERNAL I2;...
Statements SUBFOOTING Statement SUBFOOTING The SUBFOOTING statement allows you to specify a subfooting to be printed at the Statement bottom of each report page for all reports in the current session unless overridden or reset by another SUBFOOTING statement or temporarily overridden by a SUBFOOTING clause.
Statements SUBFOOTING Statement Using the FORM clause within a SUBFOOTING statement forces a new page. The remainder of the SUBFOOTING print-list is printed on the new page. The page number remains the same. A single logical page can span multiple physical pages such that a TITLE can appear on one page, the data on the next, and a SUBFOOTING on the next.
Statements SUBTITLE Statement SUBTITLE Statement The SUBTITLE statement allows you to specify a subtitle for all subsequent reports in the current session. The subtitle is printed at the top of each page immediately following the title. The SUBTITLE statement can be overridden or reset by another SUBTITLE statement or temporarily overridden by a SUBTITLE clause.
Statements SUBTITLE Statement Using the FORM clause within a SUBTITLE statement forces a new page. ENFORM prints the remainder of the SUBTITLE print-list, starting at the top of the next physical page. The page number remains the same. A single logical page can span multiple physical pages such that a SUBTITLE can appear on one page, the data on the next, and a FOOTING on the next.
Statements TITLE Statement TITLE Statement The TITLE statement allows you to specify a title to be printed the top of each page for all subsequent reports in the current session unless cancelled or reset by another TITLE statement or temporarily overridden by a TITLE clause. ( See the TITLE clause in Section 5.) The syntax of the TITLE statement is: TITLE [ print-list [ CENTER ] ] [ ;...
Statements TITLE Statement Using the FORM clause within a TITLE statement forces a new page. The remainder of the TITLE print-list is printed, starting at the top of the next physical page. The page number remains the same. A single logical page can span multiple physical pages such that a TITLE can appear on one page, the data on the next, and a FOOTING on the next.
Page 121
Statements TITLE Statement (This page left intentionally blank) 4–50 058057 Tandem Computers Incorporated...
5 Clauses This section describes the syntax of the ENFORM clauses. The clauses are specified in alphabetical order. ENFORM clauses are components of statements. They provide additional specifications of the ENFORM program to be performed. Most of the ENFORM clauses remain in effect only for the query associated with the LIST OR FIND statement of which they are a part.
Page 123
Clauses Table 5-1. ENFORM Clauses and Their Functions (continued) Calculating Running Total, Total, Subtotal, and Percentage Clause Function prints a running total for a numeric target-item. The CUM OVER clause prints the running group total for a numeric target-item. prints the value of the percentage of the grand total for a numeric target- item.
Page 124
Clauses Table 5-1. ENFORM Clauses and Their Functions (continued) Converting Data to Internal or Display Format Clause Function specifies a display format for printing a target-item or by-item. AS DATE specifies the display format for printing a date. AS TIME specifies the display format for printing a time.
Clauses AFTER CHANGE Clause AFTER CHANGE The AFTER CHANGE clause prints information preceding the records for each group Clause for the current report. The AFTER CHANGE clause is an optional part of a LIST statement. The syntax of the AFTER CHANGE clause is: AFTER CHANGE [ ON ] by-item PRINT print-list [ CENTER ] by-item is the name of a field that has been grouped by a BY or BY DESC clause.
Page 126
Clauses AFTER CHANGE Clause If you specify either a SKIP clause or the slash symbol (/) within a print-list, ENFORM advances one or more lines before printing the rest of the AFTER CHANGE print-list. The number of lines advanced can be affected by one or more of the following: the digit (if any) following the keyword SKIP, the number of slashes specified, or the option variable @VSPACE.
Clauses ASCD and DESC Clauses ASCD and DESC The ASCD and DESC clauses sort target-records, in ascending or descending order Clauses respectively, according to the value of the specified field. The syntax of the ASCD and DESC clauses is: ASCD target-item DESC target-item...
Clauses AS Clause AS Clause The AS clause specifies a display format for printing a target-item or by-item. The syntax of the AS clause is: report-item AS [ nonrepeatable-edit-descriptors ] repeatable-edit-descriptors report-item AS " "[" [ decorations,… ] [ modifiers,… ] "]" repeatable-edit-descriptors "...
Page 129
Clauses AS Clause where specifies the width of the report-item. specifies the number of digits that appear to the left of the decimal for fixed point values and the minimum number of digits for integer values. specifies the number of digits to the right of the decimal. mask combination of the characters 9, Z, V, .(period) and literals.
Clauses AS Clause "[" modifiers "]" alter the effect of the edit descriptors as follows: prints blanks for null or zero values respectively. BN,BZ specifies a substitute fill character. FL char respecifies the overflow character. OC char specifies right or left justification. LJ, RJ allows substitution of symbols.
Clauses AS Clause Alphanumeric Edit Descriptor The alphanumeric edit descriptor specifies the target-item or by-item is to be printed using alphanumeric display format. The syntax is: A [ w ] is an unsigned integer that specifies the width in characters of the value of the target-item or by-item to be printed.
Clauses AS Clause Examples of the Integer Edit Descriptor. The following examples show the effect of the integer edit descriptor. Format Item Value Printed Item ------ ---------- ------------ I7.2 I7.6 000100 I7.6 -000001 Fixed Format Edit Descriptor The fixed format edit descriptor specifies a fixed point display format. The syntax is: F w .
Clauses AS Clause Mask Edit Descriptor The mask edit descriptor specifies a display format according to a template. The syntax is: M mask mask is a set of symbols or characters enclosed within quotation marks (“ ”), apostrophes (‘ ’), or angle brackets (< >). The symbols in a mask that serve a special function are: is a digit selector.
Page 134
Clauses AS Clause Display Format and Scale. The output mask used to display a value has no effect on the scale of the value. For example, if the value of the user-variable “cost” is an integer, and the variable appears in the query as: LIST (cost) AS M<99.99>, ...
Clauses AS Clause Nonrepeatable edit descriptors indicate some ways target-items or by-items are to be Nonrepeatable Edit Descriptors printed. Values described by the nonrepeatable edit descriptors do not require data conversion by the Formatter; however, the Formatter does process these values. When nonrepeatable edit descriptors are specified with modifiers or decorations, both the nonrepeatable edit descriptor and the repeatable edit descriptor must be enclosed in parentheses.
Clauses AS Clause Optional Plus Edit Descriptor The optional plus edit descriptors are used to control the printing of a plus (+) sign. The syntax is: S or SS indicates no plus (+) sign is to be printed. indicates a plus (+) sign is to be printed. When an object-item or by-item with a positive value is printed, ENFORM does not normally precede the value with a plus (+) sign.
Clauses AS Clause Field Blanking Modifiers Field blanking modifiers indicate under what circumstances to print blanks. The syntax is: prints a blank field if value is null. prints a blank field if value is zero. Although most edit descriptors cause a minimum number of characters to be printed regardless of the value of the field, a field blanking modifier causes the entire field to be filled with blanks if the specified condition is met.
Clauses AS Clause Overflow Character Modifier The overflow character modifier temporarily overrides the global default overflow indicator for the current display format. The overflow indicator is printed when a value exceeds the width specified in the display format. The syntax is: OC char char is a single ASCII character enclosed within apostrophes (‘...
Clauses AS Clause Examples of the Justification Modifiers. The following examples show the effect of the justification modifiers. Format Item Value Printed Item ------ ---------- ------------ "[RJ] A12" HELLO HELLO HELLO HELLO "[RJ] A2" HELLO Symbol Substitution Modifier The symbol substitution modifier allows you to change the standard symbols ( ‘9’, ‘V’, ‘Z’, ‘.’...
Clauses AS Clause Decorations specify character strings that can be printed along with the value of a Decorations target-item or by-item. Decorations also specify the conditions under which the character string is added, the location at which the character string is added, and whether the character string is added before normal formatting is done or after it is completed.
Clauses AS Clause Conditions The condition specifiers (negative, positive, zero, null, or overflow) indicate that a character string prints only when the specified condition occurs. A null condition takes precedence over negative, positive, and zero conditions. The overflow condition test is done after the other conditions are tested. Conditions specified for alphanumeric target-items or by-items can be positive or null only.
Clauses AS Clause Default Decorations When decorations are not specified, ENFORM prints a negative value with a preceding negative (–) sign. In other words, [MF‘–’] is assumed. If a decoration is specified that tests for a positive value , such as [PF‘+’], the default [MF‘–’] no longer automatically applies.
Page 143
Clauses AS Clause The following are examples of decorations: Format Item Value Printed Item ------ ---------- ------------ "[MF'<',MP'>',ZPP'b'] F12.2" 1000.00 1,000.00 "[MF'<',MP'>',ZPP'b'] F12.2" -1000.00 <1,000.00> "[MA1'CR',MPF'$'] F12.2" 1000.00 $1,000.00 "[MA1'CR',MPF'$'] F12.2" -100.00 $100.00 "[MA1'CR',MPF'$'] F12.2" 0.00 0.00 "[OA1'**overflow**'] F12.2" 1000000.00 1000000000 "[OA1'**overflow**'] F12.2"...
Clauses AS DATE Clause AS DATE Clause The AS DATE clause allows you to specify the display format for printing a date. The syntax of the AS DATE clause is: date-in-internal-format AS DATE display-format date-in-internal-format is the name of a variable or field that contains a date in internal format. The option variable @DATE can be specified to give the current date in internal format.
Clauses AS TIME Clause AS TIME Clause The AS TIME clause allows you to specify the display format for printing a time. The syntax of the AS TIME clause is: time-in-internal-format AS TIME display-format time-in-internal-format is the name of a variable or field which contains a time in internal format. specifies the default display format which specifies the hour, minute, and second as HP2:M2:S2 (see the following description of display-format).
Page 147
Clauses AS TIME Clause These time keywords produce the following: Examples of the Time Display Format 1, 2,..,24 01,02,..,12 AM or PM HPB2 1, 2,..,12 AM or PM 00,01,..,59 0, 1,..,59 00,01,..,59 0, 1,..,59 5–26 058057 Tandem Computers Incorporated...
Clauses AT END PRINT Clause AT END PRINT Clause The AT END PRINT clause prints information at the end of the current report. This clause is an optional part of the LIST statement. The syntax of the AT END PRINT clause is: AT END PRINT print-list [ CENTER ] print-list...
Clauses AT END PRINT Clause Using the FORM clause within the print-list causes ENFORM to start a new page, increment the page number, and continue with the rest of the print-list. Using the CENTER clause following the print-list centers the information on the page. The CENTER, Option Variable, SKIP, SPACE, and TAB clauses are described in this section.
Clauses AT START PRINT Clause AT START PRINT The AT START PRINT clause allows you to specify information to be printed just Clause before the first set of column headings for the current report. This clause is an optional part of the LIST statement. The syntax of the AT START PRINT clause is: AT START PRINT print-list [ CENTER ] print-list contains any combination of literals, FORM, SKIP, SPACE or TAB clauses.
Clauses AT START PRINT Clause The use of the FORM clause within a print-list causes ENFORM to start a new page, increment the page number, and continue with the rest of the print-list. Using the CENTER clause following the print-list of the AT START PRINT clause centers the information on the page.
Clauses BEFORE CHANGE Clause BEFORE CHANGE The BEFORE CHANGE clause allows you to specify information to be printed Clause following the records for each group for the current report. The BEFORE CHANGE clause is an optional part of the LIST statement. The syntax of the BEFORE CHANGE clause is: BEFORE CHANGE [ ON ] by-item PRINT print-list [ CENTER ] by-item...
Clauses BEFORE CHANGE Clause By default the BEFORE CHANGE clause information begins printing in the same Spacing Considerations column position as the leftmost report column. Using SPACE or TAB clauses as the first element of the print list overrides this default. SPACE or TAB clauses can also appear anywhere within the print-list.
Clauses BY AND BY DESC Clauses BY and BY DESC The BY and BY DESC clauses group and sort target-records according to the value of a Clauses specified field. The syntax of the BY and BY DESC clauses is: by-item BY DESC by-item is the name of a field from an input record whose values are to be used to group...
Clauses CENTER Clause CENTER Clause The CENTER clause centers an object within its context. The syntax of the CENTER clause is: target-item CENTER‚ by-item CENTER ALL‚ target-item is a record name, a field name, a string literal, a predefined aggregate, a user aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user variable, or a System Variable clause.
Clauses CUM Clause CUM Clause The CUM clause allows you to specify printing of a running total for a numeric target-item either for all the instances of the target-item or for the instances of the target-item grouped within the each value of a by-item. The syntax of the CUM clause is: OVER ALL target-item...
Clauses CUM Clause When a numeric target-item with a CUM clause is assigned to a user variable, CUM Clause Used with User Variable ENFORM assigns the value to the user variable first, before the running total is calculated. When the user variable is referenced as a target-item element in a LIST statement or as an element within a LIST target-item, ENFORM uses the value of the user variable.
Clauses FOOTING Clause FOOTING Clause The FOOTING clause allows you to specify information for printing at the bottom of each page for the current report. This clause is an optional part of the LIST statement. The syntax of the FOOTING clause is: FOOTING print-list [ CENTER ] print-list...
Clauses FOOTING Clause Using a FORM clause within a FOOTING statement forces a new page. Printing continues with the remainder of the FOOTING print-list, starting at the top of the next physical page. The page number remains the same. A single logical page can span multiple physical pages, such that a TITLE can appear on one page, the data on the next, and a FOOTING on the next.
Clauses FORM Clause FORM Clause The FORM clause allows you to control when to skip to a new page. The syntax of the FORM clause is: FORM [ number ] number is an unsigned integer. FORM Clause with When the FORM clause follows a field name that has been grouped with a BY or BY a By-item DESC clause, ENFORM starts a new page whenever the field value changes.
Clauses HEADING Clause HEADING Clause The HEADING clause allows you to override the default column title for a target-item or by-item in a report. The HEADING clause also allows you to define a column title for target-items, such as arithmetic expressions, that do not have a default column title. The syntax of the HEADING clause is: by-item HEADING "...
Clauses HEADING Clause Sometimes, the / character needs to appear within a column heading. In this case, use Printing / in a Column Heading the SET statement described in Section 4 to change the @NEWLINE option variable from a / to a different character. After the new line character is redefined, the new special character can be used within the heading string instead of the / character.
Page 163
Clauses HEADING Clause If a HEADING clause is not included, ENFORM includes the subscript with the default heading. For example: LIST month [ 3 ]; causes ENFORM to print: MONTH [ 3 ] ----- Remember the default heading for a field name is either the heading declared in the dictionary or if no heading is so declared, the field name.
Clauses INTERNAL Clause INTERNAL Clause The INTERNAL clause allows you to specify the storage format for a user defined element. The syntax of the INTERNAL clause is: INTERNAL internal-format internal-format is the format for storing the user-defined element. Internal-format can be: Alphanumeric, where n is the length Integer, where n is the length Fw.d...
Clauses JULIAN-DATE Conversion Clause JULIAN-DATE The JULIAN-DATE Conversion clause allows you to specify translation of a date Conversion Clause target-item into internal format. The syntax for the JULIAN-DATE Conversion clause is: JULIAN-DATE ( year , month , day ) year is the year in 4 digits.
Clauses JULIAN-DATE Conversion Clause Alternatively, convert the date to an integer that can be formatted with an AS clause. For example: date AS M<99-99-99> To convert a date stored as a yearly Julian date, where the day of the year is relative to January 1 of that year, define each part of the date: yearly-julian-date.
Clauses NOHEAD Clause NOHEAD Clause The NOHEAD clause allows you to specify suppression of the printing of the column heading of a target-item or by-item. The syntax of the NOHEAD clause is: target-item NOHEAD by-item NOHEAD ALL target-item is a record name, a field name, a numeric literal, a predefined aggregate, a user aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user table name, a user variable, a System Variable clause, or a JULIAN-DATE clause.
Clauses NOPRINT Clause NOPRINT Clause The NOPRINT clause allows you to specify suppression of the printing of a target-item or by-item and its associated column heading. The syntax of the NOPRINT clause is: target-item NOPRINT by-item NOPRINT ALL target-item is a record name, a field name, a numeric literal, a predefined aggregate, a user aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user table name, a user variable, a System Variable clause or a JULIAN-DATE clause.
Clauses Option Variable Clauses Option Variable The Option Variable clauses allow you to redefine the default values for several Clauses operational variables. Refer to the SET statement in Section 4. The Option Variables and their legal values are: @BLANK-WHEN-ZERO @BREAK-KEY @CENTER-PAGE @HEADING @STATS...
Page 170
Clauses Option Variable Clauses " character " is a single ASCII character enclosed within quotation marks. string-literal is a string literal; remember string literals must be enclosed in quotation marks (“ ”). display-format specifies the default format for printing dates or times when AS DATE * and AS TIME * clauses are used;...
Page 171
Clauses Option Variable Clauses @COPIES specifies how many copies to print. Default is 1. @COST-TOLERANCE can be set to a number between 1 and 8. Setting @COST-TOLERANCE prevents ENFORM from executing a strategy that is more expensive than the user wants. When a larger number is specified, the query processor performs more work than when a smaller number is specified.
Page 172
Clauses Option Variable Clauses @DISPLAY-COUNT determines how many lines to display on output device at one time. When number lines are displayed, ENFORM pauses. To continue the display, press the carriage return. Execution of the ENFORM program, while at the pause, can be aborted by: Entering two slashes (//).
Page 173
Clauses Option Variable Clauses @OVERFLOW When a value does not fit within its formatted width, ENFORM replaces the value with overflow characters. When this clause is set to a single ASCII character, ENFORM prints that character when overflow occurs. The default overflow character is an asterisk (*).
Page 174
Clauses Option Variable Clauses @STATS When set to ON, ENFORM prints the statistics regarding the records after the ENFORM program is completed. ENFORM prints the following statistics: FILENAME physical file name of a set of records. LEVEL READ order this physical file was read in relation to all physical files read.
Page 175
Clauses Option Variable Clauses @UNDERLINE specifies a single ASCII character used to underline headings and totals. To specify no underlining, set the @UNDERLINE Option Variable clause to blank, “ ”. The default character is “_”. @VSPACE specifies how many lines are skipped before a report line when the SKIP clause is used.
Clauses PCT Clause PCT Clause The PCT clause prints the percentage of the grand total for a numeric target-item, based either on a total figure for all instances of the target-item or a total for the instances of the target-item grouped over a by-item. The syntax of the PCT clause is: OVER ALL target-item OVER by-item...
Clauses PCT Clause The SUBTOTAL OVER clause can be combined with the PCT OVER clause, causing Combining Percentages and Subtotals ENFORM to print the percentage the subtotal is of the total value of the target-item. ENFORM does not print the value of each target-item. The percentage values do not always exactly total 100% due to truncation during division.
Clauses SKIP Clause SKIP Clause The SKIP clause allows you to indicate the number of lines ENFORM should move forward before continuing printing. The syntax of the SKIP clause is: SKIP [ number ] number an integer representing the number of lines. Sometimes it is desirable to print more than one target-item under the same column heading.
Clauses SPACE Clause SPACE Clause The SPACE clause allows you to specify horizontal spacing. The syntax of the SPACE clause is: SPACE [ number ] number is an integer. SPACE Clause with a LIST The SPACE clause can precede an either a target-item or a by-item within a LIST Target-item or By-item statement.
Clauses SUBFOOTING Clause SUBFOOTING Clause The SUBFOOTING clause allows you to specify printing of information at the bottom of each page preceding the footing for the current report. This clause is an optional part of the LIST statement. The syntax of the SUBFOOTING clause is: SUBFOOTING print-list [ CENTER ] print-list contains any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
Clauses SUBFOOTING Clause Using the FORM clause within a SUBFOOTING print-list forces a new page. ENFORM continues printing the remainder of the SUBFOOTING print-list, starting at the top of the next physical page. The page number remains the same. A single logical page can span multiple physical pages, such that a TITLE can appear on one page, the data on the next, and a SUBFOOTING on the next.
Clauses SUBTITLE Clause SUBTITLE Clause The SUBTITLE clause allows you to specify printing of information at the top of each page immediately following the title for the current report. This clause is an optional part of the LIST statement. See also the TITLE clause in this section and the SUBTITLE statement in Section 4.
Clauses SUBTITLE Clause Using the FORM clause within the print-list causes ENFORM to start a new page. ENFORM continues with the remainder of the print-list starting at the top of the next physical page. The page number remains the same. Using the CENTER clause centers the subtitle on the page.
Clauses SUBTOTAL Clause SUBTOTAL Clause The SUBTOTAL clause allows you to specify the printing of a subtotal for a numeric target-item. This clause is an optional part of the LIST statement. The syntax for the SUBTOTAL clause is: target-item SUBTOTAL [ OVER by-item ] target-item is a record name, a field name, a numeric literal, a predefined aggregate, a user aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user table...
Clauses SUPPRESS Clause SUPPRESS Clause The SUPPRESS clause allows you to eliminate certain records from being printed in the report. The records still contribute to the report calculations. This clause is an optional part of the part of the LIST statement. This clause cannot be used with the FIND statement.
Clauses System Variable Clauses System Variable The System Variable clauses allow you to obtain the current value for the current date, Clauses time, line number, and page number. The syntax for the System Variable clauses is: @DATE @TIME @LINENO @PAGENO Printing the Current The @DATE and @TIME System Variable clauses return the current date and time in Date or Time...
Clauses TAB Clause TAB Clause The TAB clause allows you to specify in which column in the report a target-item or by-item is to begin. This clause is an optional part of the LIST statement and must not be specified in the FIND statement. The syntax of the TAB clause is: [ number ] number is an integer.
Clauses TIMESTAMP-DATE Clause TIMESTAMP-DATE The TIMESTAMP-DATE clause extracts the date portion of a timestamp field that has Clause been created by the GUARDIAN procedure TIMESTAMP. The syntax of the TIMESTAMP-DATE clause is: TIMESTAMP-DATE ( field-name ) field-name is the name of a field to which the TIMESTAMP-DATE clause returns a date value. The field must be described in the dictionary.
Clauses TIMESTAMP-TIME Clause TIMESTAMP-TIME The TIMESTAMP-TIME clause extracts the time portion of a timestamp field that has Clause been created by the GUARDIAN procedure TIMESTAMP. The syntax of the TIMESTAMP-TIME clause is: TIMESTAMP-TIME ( field-name ) field-name is the name of a field to which a time value is returned. The field must be described in your data dictionary.
Clauses TITLE Clause TITLE Clause The TITLE clause allows you to specify printing of information at the top of each page for the current report. See also the SUBTITLE clause in this section and the TITLE statement in Section 4. The syntax of the TITLE clause is: TITLE print-list [ CENTER ] print-list contains any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
Clauses TITLE Clause Using the FORM clause within the print-list causes ENFORM to start a new page and continue with the rest of the print-list. The page number remains the same. A single logical page can span multiple physical pages such that a TITLE appears on one page, the data on the next, and a FOOTING on the next.
Clauses TOTAL Clause TOTAL Clause The TOTAL clause prints the grand total for a numeric target-item. This clause is an optional part of the LIST statement and cannot be specified in a FIND statement. The syntax of the TOTAL clause is: target-item TOTAL by-item...
Clauses WHERE Clause WHERE Clause The WHERE clause allows you to restrict the records that contribute to the target file. The syntax of the WHERE clause is: WHERE logical-expression logical-expression is a condition that returns a true or false value. See Section 3 for more information about logical expressions.
6 Commands This section contains a complete description of the syntax of the ENFORM commands. The commands are arranged in alphabetical order. ENFORM commands are compiler directives that instruct the ENFORM compiler/report writer to perform a specific operation. The compiler/report writer recognizes a command by the presence of a question mark in column 1.
Commands ?ASSIGN Command ?ASSIGN Command The ?ASSIGN command associates a physical file with a dictionary record description or a generic file. This command is functionally equivalent to the Command Interpreter ASSIGN command. The syntax of the ?ASSIGN command is: record-name ‚...
Page 196
Commands ?ASSIGN Command create-open-spec is one file creation or open attribute. Only exclusion spec is used by ENFORM. create-open-spec is of the form: extent-spec CODE file-code exclusion-spec access-spec REC record-size BLOCK block-size extent-spec is one of the following: EXT [ ( ] pri-extent-size [ ) ] EXT ( [ pri-extent-size ] ‚...
Page 197
Commands ?ASSIGN Command The ?ASSIGN command can be used to assign the generic ENFORM files to a physical device. In the following example, the generic file QUERY-COMPILER-LISTING is assigned to a printing device named $ep: ?ASSIGN QUERY-COMPILER-LISTING TO $s.#ep The ?ASSIGN command can be used to change the exclusion specification for a file; the default is SHARED.
Commands ?ATTACH Command ?ATTACH Command The ?ATTACH command allows you to specify a query processor to use during an ENFORM session. The syntax of the ?ATTACH command is: ?ATTACH [ process-name ] process-name is the name of a query processor. When one or more server query processors exist on a Tandem system, you can use the ?ATTACH command to specify the query processor you want to use.
Commands ?COMPILE Command ?COMPILE Command The ?COMPILE command compiles a query and stores it in a physical file. The syntax of the ?COMPILE command is: ?COMPILE edit-filename [ ( section-name , ... ) ] TO compiled-physical-filename edit-filename is the name of the EDIT file containing the ENFORM query. ( section-name , ...) is the name of the section(s) within an EDIT file.
Commands ?DICTIONARY Command ?DICTIONARY The ?DICTIONARY command names a subvolume that contains your dictionary. It Command also clears the internal table and reclaims table space. The ?DICTIONARY command is the same as the DICTIONARY statement. ?DICTIONARY [ dict-subvol-name ] dict-subvol-name is the name of the subvolume where your dictionary files reside.
Commands ?EDIT Command ?EDIT Command The ?EDIT command allows you to access the Editor without leaving ENFORM. The syntax of the ?EDIT command is: ?EDIT [ edit-filename ] edit-filename is the name of an EDIT file. A query can be stored in an EDIT file. The EDIT file can be created or changed without leaving ENFORM.
Commands ?EXECUTE Command ?EXECUTE Command The ?EXECUTE command executes a compiled query file. The syntax of the ?EXECUTE command is: ?EXECUTE compiled-physical-filename compiled-physical-filename is the name of the physical file containing the stored compiled query. The ?EXECUTE command resets the internal table to the same state that existed at time of compilation.
Commands ?EXIT Command ?EXIT Command The ?EXIT command terminates the current ENFORM session. The syntax of the ?EXIT command is: ?EXIT The ?EXIT command returns control to the Command Interpreter. It is the same as the EXIT statement. An alternate way of exiting ENFORM is to press the terminal CTRL and Y keys simultaneously.
Commands ?HELP Command ?HELP Command The ?HELP command displays information about the syntax of the ENFORM language. The ?HELP command can also display information about user-defined topics if your system manager has provided this information. The syntax of the ?HELP command is: ?HELP [ help-element ] help-element is one of the topics for which help is available.
Page 205
Commands ?HELP Command The following example shows a list of topics that might be displayed when you enter the ?HELP command without help-element: >?HELP Help is available for the following topics: STATEMENTS: AT END AT START CLOSE DECLARE DELINK DICTIONARY EXIT FIND FOOTING...
Commands ?OUT Command ?OUT Command The ?OUT command specifies the output device for a report. The syntax of the ?OUT command is: ?OUT [ physical-filename ] physical-filename is the name of the output device to which any subsequent report is directed. The ?OUT command is used to name the physical device on which a report is printed.
Commands ?RUN Command ?RUN Command The ?RUN command executes one or more queries stored in an EDIT file. The syntax of the ?RUN command is: ?RUN [ edit-filename [ ( section-name , ... ) ] edit-filename is the name of the EDIT file containing the ENFORM source query. ( section-name , ...) is the name of one or more sections of the EDIT file.
Commands ?SECTION Command ?SECTION Command The ?SECTION command names a collection of ENFORM commands and statements within an EDIT file. The syntax of the ?SECTION command is: ?SECTION section-name section-name is the name to be used for a collection of ENFORM commands and/or statements within an EDIT file.
Commands ?SHOW Command ?SHOW Command The ?SHOW command displays information about the environment of the current ENFORM session. The syntax of the ?SHOW command is: OPEN LINK CONTROL LIMITS ?SHOW ASSIGN [ record-name ] user-variable-name record-name param-name user-variable-name is the name of a user variable. record-name is the name of an opened dictionary record description.
Page 210
Commands ?SHOW Command Table 6-2. Environment Information Displayed by ?SHOW Command (continued) Command Display Message ?SHOW ASSIGN Displays all of the opened record descriptions and physical file name pairs specified by a ?ASSIGN command or Command Interpreter ASSIGN command. If none were assigned, nothing is displayed.
Commands ?SOURCE Command ?SOURCE Command The ?SOURCE command reads an EDIT file or a collection of commands and statements within an EDIT file. The syntax of the ?SOURCE command is: ?SOURCE edit-filename [ ( section-name , ... ) ] edit-filename is the name of the EDIT file containing an ENFORM query.
ENFORM Syntax Summary Appendix A ENFORM syntax is summarized in this appendix. For specific details of syntax, refer to the language elements, statement, clause and command sections. Language Elements Aggregates: COUNT field-name OVER ALL expression OVER over-item [ WHERE logical-expression ] ) ‚ user-aggregate COUNT ( [ UNIQUE ] field-name [ OVER ALL ]...
Page 213
ENFORM Syntax Summary Language Elements Logical Expression: [NOT] condition [NOT] condition where condition has one of the following forms: BEGINS WITH [ not ] CONTAINS string-literal '>' conditional˚operator field-name EQUAL value-range [NOT] "[" pattern-match "]" <> variable variable field-name [NOT] conditional-operator field-name expression expression...
ENFORM Syntax Summary Language Elements Statements AT END [ PRINT print-list [ CENTER ] ] [ ; ] AT START [ PRINT print-list [ CENTER ] ] [ ; ] record-name user-variable-name CLOSE user-aggregate-name , ... [ ; ] user-table-name param-name user-variable-name user-table-name "["...
Page 215
ENFORM Syntax Summary Language Elements FIND [ UNIQUE ] output-record-name BY by-item BY DESC by-item [ output-field-name := ] target-item ,... ) ASCD target-item DESC target-item [ WHERE logical-expression ] ; FOOTING [ print-list [ CENTER ] ] [ ; ] record-name1 [ TO ] [ OPTIONAL ] record-name2 VIA field-name LINK...
Page 216
ENFORM Syntax Summary Language Elements BY by-item BY DESC by-item target-item ASCD target-item DESC target-item user-var-name := target-item LIST [ UNIQUE ] CUM [ OVER ALL ] CUM OVER by-item PCT [ OVER ALL ] PCT OVER by-item TOTAL SUBTOTAL SUBTOTAL OVER by-item NOHEAD NOPRINT...
ENFORM Syntax Summary Clauses Clauses AFTER CHANGE [ ON ] by-item PRINT print-list [ CENTER ] ASCD target-item DESC report-item AS [ nonrepeatable-edit-descriptors ] repeatable-edit-descriptors report-item AS " "[" [ decorations,… ] [ modifiers,… ] "]" repeatable-edit-descriptors " report-item AS "...
Page 219
ENFORM Syntax Summary Clauses repeatable-edit-descriptors specify data conversion to the GUARDIAN Formatter for printing the report-item values. Valid values for repeatable-edit-descriptors are: for alphanumeric values. A [ w ] for integer values. I w [ . m ] for fixed point values. F w .d [ .
Page 220
ENFORM Syntax Summary Clauses location is where the character string is to be printed: A n indicates char-string is to be printed at absolute position n. indicates char-string is to be inserted after the value is formatted. If condition is satisfied, char-string is printed immediately to the left of the item value.
Page 221
ENFORM Syntax Summary Clauses BEFORE CHANGE [ ON ] by-item PRINT print-list [ CENTER ] by-item BY DESC target-item CENTER‚ by-item CENTER ALL‚ OVER ALL target-item OVER by-item print-list [ CENTER ] FOOTING FORM [ number ] by-item HEADING " heading-string " target-item INTERNAL internal-format JULIAN-DATE ( year , month , day )
Page 222
ENFORM Syntax Summary Clauses target-item NOPRINT by-item NOPRINT ALL The Option Variables and their legal values are: @BLANK-WHEN-ZERO @BREAK-KEY @CENTER-PAGE @HEADING @STATS @SUMMARY-ONLY @WARN @COPIES @COST-TOLERANCE @DISPLAY-COUNT @LINES @MARGIN @PAGES @PRIMARY-EXTENT-SIZE TO number @SECONDARY-EXTENT-SIZE @READS @SPACE @TARGET-RECORDS @VSPACE @WIDTH @DECIMAL @NEWLINE @NONPRINT-REPLACE TO "...
Page 223
ENFORM Syntax Summary Clauses SKIP [ number ] SPACE [ number ] SUBFOOTING print-list [ CENTER ] SUBTITLE print-list [ CENTER ] target-item SUBTOTAL [ OVER by-item ] SUPPRESS [ WHERE ] logical-expression System Variables: @DATE @TIME @LINENO @PAGENO TAB [ number ] TIMESTAMP-DATE ( field-name ) TIMESTAMP-TIME ( field-name ) TITLE print-list [ CENTER ]...
Page 227
ENFORM Syntax Summary ENFORM Procedures (This page left intentionally blank) A–16 058057 Tandem Computers Incorporated...
Page 228
Error Messages Appendix B This appendix documents the following types of messages: !!! ERROR error-number types: mean a serious error has occurred. Statement execution terminates. If this type of error occurs for a LIST or FIND statement, the query terminates. *** WARNING warning-number types: point out an error that could change the expected results.
Error Messages ENFORM Initialization Messages ENFORM Initialization Messages Current reserved word cannot be used to redefine another reserved word A reserved word redefinition in the ?VOCABULARY section of the message table contains an old reserved word where a new word is expected. (The key-sequenced message table file was not built by the BUILDMK utility or the file has been modified since it was built).
Error Messages !!! Error and *** Warning Type Messages Message table must contain both ?MESSAGES and ?HELP sections Self-explanatory. Use the BUILDMK utility to build the key-sequenced message table file. Message table version number is not correct The version number in the message table does not match the version number expected by ENFORM.
Page 231
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [28] The boolean operators AND and OR cannot be used in a TITLE or PRINT statement expression Only a simple logical expression may be used in a IF/THEN/ELSE expression within an AFTER CHANGE, AT END, AT START, BEFORE CHANGE, FOOTING, SUBFOOTING, SUBTITLE, or TITLE statement or clause.
Page 232
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [35] Record description not found in dictionary The record name has been misspelled or the wrong dictionary is being used. !!! ERROR [36] Symbol table overflow The maximum available space for file descriptions, user defined variables, etc., has been exceeded.
Page 233
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [43] The specified relation is invalid in the above context CONTAINS, BEGINS WITH, and pattern match conditions require string arguments. The pattern match operation allows only EQ and NE operators. !!! ERROR [44] Too many actual file assignments Table of assignments exceeds eight entries.
Page 234
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [50] Insufficient memory available for data buffer (SERVER-related failure on name) An ENFORM server (process file) cannot be opened because there is no space for a message buffer. *** WARNING [51] Null target list LIST or FIND statement is not processed.
Page 235
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [57] Item type incompatible with use Expecting a field or user-defined variable to subscript or illegal use of a condition in an Arithmetic Expression clause. Similar to a type mismatch. !!! ERROR [58] Illegal use of KEY item Record-name.KEY or KEY OF record-name is not allowed in a LINK statement or in an...
Page 236
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [63] Too many PRINT statements Number of items in Print List clauses exceeds 172. Processing of the ENFORM program is stopped and the contents of the internal table is reset to the values held at start of processing the statement which produced the error.
Page 237
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [69] Invalid range Incorrectly defined a range for a comparison pattern or THRU within a Logical Expression clause. !!! ERROR [70] Nonnumeric item in arithmetic expression Used alphanumeric item in an Arithmetic Expression clause. !!! ERROR [71] The table containing literals, AS formats and headings has overflowed...
Page 238
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [77] A destination name must be specified An item in a FIND statement needs to be assigned to an output field name, because the “name-correspondence” rules are insufficient here. !!! ERROR [78] The attribute UNIQUE may not be used with an OVER clause UNIQUE may not be used with aggregates computed OVER a grouped-item.
Page 239
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [85] More than one PCT or CUM modifies list item Only one PCT or CUM clause allowed per item. !!! ERROR [86] Server QP process has failed repeatedly Either the primary or the backup process for the ENFORM query processor has failed more than 10 times.
Page 240
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [92] At least one record has no LINK or a qualification relating it to any other record You have entered query specifications that reference two or more record descriptions. At least one of these record descriptions has no relationship (link) to any other record description in the query.
Page 241
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [100] Undefined SET variable User defined item or parameter used in a SET statement has not been defined yet. *** WARNING [101] The param table would overflow if updated to the SET value Parameter table is full and the last value has not been added.
Page 242
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [108] An aggregate may not be used in a SUPPRESS clause Self-explanatory. !!! ERROR [109] An aggregate may not be used as a parameter to a function Self-explanatory. !!! ERROR [110] Insufficient memory available to produce the report.
Page 243
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [123] Physical file type does not match DDL. The file type (key-sequenced, relative, entry-sequenced, or unstructured) given in the DDL record description does not match the type of the physical file read by the query processor.
Page 244
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [167] String literal cannot contain more than 127 characters Self-explanatory. !!! ERROR [168] TOTAL may not be specified OVER a BY item TOTAL can only be specified OVER ALL. If you wish to compute a total over a BY item, specify SUBTOTAL instead.
Page 245
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [176] Help item phrase must be less than 32 characters long. The phrase following the ?HELP keyword must be less than 32 characters long, including embedded blanks and the initial question mark (if present). !!! ERROR [177] Parameter is treated like a literal here.
Error Messages *** File Error Type Messages !!! ERROR (Cost tolerance exceeded) : required cost = n The strategy that the query processor will need to use to execute the query is greater than the value (n) you specified for the @COST-TOLERANCE option variable. !!! ERROR (Messages not in expected order) The query processor received an unexpected message from the query compiler/report...
Page 247
Error Messages *** File Error Type Messages *** FILE ERROR (CONTROL failure) #file-error-number on name A control failure occurred on the physical file named. *** FILE ERROR (CREATE failure) #file-error-number on name There was a problem creating the physical file. *** FILE ERROR (Dictionary file access failure) #file-error-number on name Refer to the Data Definition Language (DDL) Reference Manual.
Page 248
Error Messages *** File Error Type Messages *** FILE ERROR (POSITION failure) #file-error-number on name A position failure occurred on the physical file named. *** FILE ERROR (Process nonexistent, insufficient system resources or full queue) #file-error-number on name The server query processor named in the ?ATTACH command does not exist or cannot accept more users.
Page 249
Error Messages *** File Error Type Messages *** FILE ERROR (Specified ENFORM compile file exists as edit or TAL object file) on name The file must be a compiled query file created with an ENFORM ?COMPILE command. *** FILE ERROR (Unable to open ENFORM message table) #file-error-number on name Self-explanatory.
Error Messages BUILDMK Error Messages ENFORM Trap Messages ENFORM TRAP: nnn S: xxxxxx P: xxxxxx E: xxxxxx L: xxxxxx The ENFORM Compiler/Report Writer process has failed. nnn is the trap number as described in the GUARDIAN Operating System Programmer’s Guide. xxxxxx are values in the hardware registers.
Page 251
Error Messages BUILDMK Error Messages ** ERROR Edit file contains ?MESSAGES section but no ?HELP section The Edit file version of the message table must contain a ?HELP section if a ?MESSAGES section is included. *** ERROR Identifier contains an illegal character An identifier specified in the Edit file version of the message table contains an illegal character.
Page 252
Error Messages BUILDMK Error Messages *** ERROR In a reserved word redefinition, the old reserved word is missing Supply the old reserved word. ** FILE ERROR (EDITREAD read error) on name The indicated error occurred on the specified file during the execution of BUILDMK. *** FILE ERROR (EDITREAD sequence error) on name The indicated error occurred on the specified file during the execution of BUILDMK.
Page 253
Error Messages BUILDMK Error Messages *** FILE ERROR (READ failure) #file-error-number on name The indicated file error occurred on name during the execution of BUILDMK. *** FILE ERROR (WRITE failure) #file-error-number on name The indicated file error occurred on name during the execution of BUILDMK. B–26 058057 Tandem Computers Incorporated...
LINKS and the LINK OPTIONAL Appendix C Statement Rules To fully understand the rules for the LINK OPTIONAL statement, you must first understand how ENFORM defines links. This appendix describes how ENFORM defines a link, reviews the rules for the LINK OPTIONAL statement, and provides some examples of illegal links.
LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK the following is true of the logical records built for the link: A given apple record occurrence appears in the logical records even if its linking field value does not match a linking field value in an orange record occurrence. Thus, an apple record occurrence does not depend on an orange record occurrence.
LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK Note that what appears as a term in your WHERE clause might not be a term in a converted WHERE clause. For example, consider the WHERE clause in the following query: OPEN fruit, orange, peach;...
LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK The converted form of this WHERE clause contains two terms: apple.color = "RED" first term AND banana.color = "YELLOW" second term Since neither term references two record descriptions, the WHERE clause does not establish a link.
LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK The transitive property of links applies to both two-directional and one-directional Links Due to the Transitive Property of Links links. For two-directional links, the transitive property is defined as: If A is linked to X and B is linked to X, then A is linked to B and B is linked to A.
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement Under the transitive property of links, apple is linked optionally to orange, banana, and pear. Orange, banana, and pear are linked to each other. These links could be symbolically represented as: apple orange...
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement The following examples involve query specifications that use the sample data base Examples of Illegal Links shown in the ENFORM User’s Guide. The purpose of these examples is to show illegal links, not to show useful queries.
Page 261
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement The preceding query specifications are effectively the same as the first query specifications. These specifications contain illegal links because the WHERE clause links order back to employee due to the transitive property of links. The following query specifications violate rule 2: OPEN employee, region;...
Page 262
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement The following query specifications, which attempt to generate a “double” exception report, violate rule 2: OPEN employee, region, branch; LINK employee TO OPTIONAL region VIA regnum; LINK employee TO OPTIONAL branch VIA branchnum;...
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement The following examples contain legal links that might appear to be illegal. These Examples of Legal Links examples also include a sketch of their links. The symbols used for the sketches are the same as those used for the illegal link examples.
Page 264
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement The following query specifications show a valid method of generating a “double” exception report: OPEN employee, region, jobs; LINK employee TO OPTIONAL region VIA regnum; LINK employee TO OPTIONAL branch VIA branchnum;...
LINKS and the LINK OPTIONAL Statement Rules Comparison of the LINK Statement, the LINK OPTIONAL Statement, and the WHERE Clause Comparison of the LINK Statement, the LINK OPTIONAL Statement, and the WHERE Clause Table C-1 contains a truth table that compares the LINK statement, the LINK OPTIONAL statement, and the WHERE clause.
Glossary Aggregate. A cumulative operation on set(s) of numbers, producing a single value per set. See Predefined Aggregate and User Aggregate. By-item. The field name used to group and sort ENFORM output; always associated with a BY or BY DESC clause. A by-item is a special kind of target-item. Clause.
Page 267
Glossary Link. Specifies a relationship between records in a relational data base to be used in an ENFORM query. Literal. One or more numeric or alphanumeric characters. See String Literal and Numeric Literal. Logical Expression. An expression that returns a true or false value. Normalized.
Page 268
Glossary Reserved words. Keywords with specific meaning and reserved by ENFORM. Server Query Processor. Specific query processor specified by an ?ATTACH command, initiated separately from the compiler. Session. Period of interaction with ENFORM. Source Code. The ENFORM statements, clauses, and commands that comprise the query specifications.
Page 269
Glossary (This page left intentionally blank) Glossary–4 058057 Tandem Computers Incorporated...
Index Accessing the text editor from ENFORM 6-8 Adding a character string to a target-item 5-19 AFTER CHANGE clause and a field name 5-4 description 5-4 print-list elements 5-4 spacing considerations 5-4 syntax 5-4 Aggregates and null values created by LINK OPTIONAL 4-29 described 3-12 and scale 3-21 embedded WHERE clause 3-18...
Page 271
Index Arithmetic operators 3-23 Arithmetic overflow conditions 3-32 AS clause decorations 5-19 default display format 5-9 modifiers field blanking 5-16 fill character 5-16 justification 5-17 overflow character 5-17 symbol substitution 5-18 nonrepeatable edit descriptors optional plus 5-15 scale factor 5-14 repeatable edit descriptors alphanumeric 5-9 fixed format 5-11...
Page 272
Index Assigning a FIND file to a generic file 2-10 a generic file to a process name 2-10 files before entering ENFORM 2-5 files to a server query processor 2-6 output to generic files 2-10 Assignment syntax described 3-4 in a FIND statement 4-17 used for a user variable 3-30 Associating a physical file with a record description 2-5, 6-2 AT END PRINT clause...
Page 273
Index syntax 4-5 with a field name 4-5 Attaching a query processor 6-6 Average value, finding 3-13 AVG 3-13 Backspacing 5-66 BEFORE CHANGE clause example 5-32 print-list elements 5-32 spacing considerations 5-32 specifying a field name within 5-31 syntax 5-31 Blanking fields for reports 3-27, 5-16, 5-49 Boolean operators 3-26 BREAK key 2-3...
Page 274
Index Calculating a percentage value 5-55 a running total 5-35 a running total for grouped elements 5-35 a subtotal 5-63 a total 5-71 Cancelling AT END statement 4-4 AT START statement 4-6 FOOTING statement 4-24 SUBFOOTING statement 4-45 SUBTITLE statement 4-47 TITLE statement 4-49 CENTER clause description 5-34...
Page 275
Index Clauses AFTER CHANGE 5-4 AS 5-7 AS DATE 5-23 AS TIME 5-25 ASCD 5-6 AT END PRINT 5-27 AT START PRINT 5-29 BEFORE CHANGE 5-31 BY 5-33 BY DESC 5-33 CENTER 5-34 CUM 5-35 DESC 5-6 FOOTING 5-37 FORM 5-39 HEADING 5-40 INTERNAL 5-43 JULIAN-DATE CONVERSION 5-44...
Page 276
Index DICTIONARY statement 4-13 CLOSE statement and the internal table 4-7 description 4-7 syntax 4-7 Column headings specifying 5-40 suppressing 5-46 Combining percentages and subtotals 5-56 Command Interpreter ASSIGN command for a server query processor 2-6 maximum file assignments 2-1 overriding 6-3, 6-4 syntax 2-5 ENFORM command...
Page 277
Index ?OUT 6-13 ?RUN 6-14 ?SECTION 6-15 ?SHOW 6-16 ?SOURCE 6-18 Commands and statements in an edit file 6-15 Comments description 3-4 example 3-4 Comparison template mask edit descriptor 5-12 pattern match in a logical expression 3-26 Compilation output 2-11 Compiled query file @BREAK-KEY 5-49 commands not saved 6-1...
Page 278
Index LE 3-24 LESS THAN 3-24 LT 3-24 NE 3-24 Conjunctive normal form C-3 Controlling the printing of a plus sign 5-15 Conventions for referencing field names 3-6 Converting a date to internal format 5-44 Converting data values 5-7 Cost tolerance levels 5-50 COUNT 3-13 Creating a new physical file 4-15 Creating a server query processor...
Page 279
Index default display format 5-23 obtaining the current date 5-67 Date keywords 5-23 data description 1-3 dictionaries produced by 6-7 DECLARE statement description 4-8 examples 4-9 syntax 4-8 user aggregates 4-9 user table 4-10 user variable 4-9, 4-10 Declaring user elements 4-8 Decorations conditions 5-20 default 5-21...
Page 280
Index DELINK statement description 4-11 example 4-11 syntax 4-11 DESC clause description 5-6 sorting precedence 5-6 syntax 5-6 Descending order, sorting 5-6 Descriptors See also AS clause alphanumeric 5-10 altering the effect of 5-15 fixed format 5-11 integer 5-10 mask 5-12 nonrepeatable 5-14 optional plus 5-15 repeatable 5-14...
Page 281
Index Displaying environmental information description 6-16 internal table space 6-16, 6-17 links in effect 6-16, 6-17 option variables 6-16, 6-17 record name 6-16, 6-17 Duplicate field names 3-7 Duration of ENFORM statements 3-5 Edit descriptors alphanumeric 5-10 altering the effect of 5-15 combined with modifiers 5-15 fixed format 5-11 integer 5-10...
Page 282
Index in noninteractive mode 2-2 internal table values 4-7, 6-17 language components 3-1 language elements 3-1 output files 2-13 processes 1-3 processing of user variables 3-29 processing strategy, specifying 5-49 prompt 2-1 session beginning 2-1 terminating 2-3, 6-10 statements 4-1 statistics 5-53 subsystem 2-1 terminating statements 3-4...
Page 283
Index Exclusion mode ?ASSIGN command 6-2 and a server query processor 2-6 ASSIGN command 2-5 generic files 2-10 Exclusion specification, changing 6-4 Executing a compiled query file 6-9 and compiling a query 6-14 source code in an Edit file 6-14, 6-18 EXIT statement description 4-14 syntax 4-14...
Page 284
Index specifying in a statement AT END 4-3 AT START 4-5 FOOTING 4-23 SUBFOOTING 4-44 SUBTITLE 4-46 TITLE 4-48 with subscripts 3-9 Field sorting clauses 5-6, 5-33 File error messages B-19 File type and the LIST statement 4-31 Fill character modifier description 5-16 examples 5-16 syntax 5-16...
Page 285
Index FOOTING statement cancelling 4-24 description 4-23 examples 4-23 overriding 4-24 resetting 4-24 spacing considerations 4-23 syntax 4-23 with a field name 4-23 FORM clause description 5-39 specifying in a clause AT END PRINT 5-27 AT START PRINT 5-29 FOOTING 5-37 SUBFOOTING 5-59 SUBTITLE 5-61 TITLE 5-69...
Page 286
Index output record length 2-10 QUERY-COMPILER-LISTING 2-11 QUERY-QPSTATISTICS 2-12 QUERY-QPSTATUS-MESSAGES 2-12 QUERY-REPORT-LISTING 2-11 QUERY-SORT-AREA 2-11 QUERY-STATISTICS 2-11 QUERY-WORK-AREA 2-11 the current output listing file 2-3 Getting help 6-11 Glossary Glossary-1 Gregorian dates 5-44 Group definition LIST statement 4-33 Grouping target-records by field values 4-15, 4-33, 5-33 GUARDIAN Formatter 5-7 GUARDIAN procedure...
Page 287
Index and the current output listing file 2-3 defined 2-1 Indicating a new page 5-39 Initial value of a user variable 3-29 Input file 2-2 Integer edit descriptor description 5-10 examples 5-11 syntax 5-10 Interactive mode ASSIGN command 2-5 described 2-2 getting help 6-11 INTERNAL clause description 5-43...
Page 288
Index Left justification 5-17 Left margin size 5-51 Limiting the number of records per query 5-53 Link diagrams C-1 LINK OPTIONAL statement and other links C-1 considerations 4-27 duration 4-27 examples of illegal links C-7 examples of legal links C-10 rules 4-27, C-6 syntax 4-25 LINK statement...
Page 289
Index Literals described 3-22 examples 3-22 numeric 3-22 string 3-22 Location of temporary work files 2-11 Location specifiers 5-20 Logical expression BEGINS WITH operator 3-27 boolean operators 3-26 compound 3-26 conditional operators 3-24 CONTAINS operator 3-27 described 3-24 pattern match 3-24, 3-28 range of values 3-25, 3-26 simple 3-26 syntax 3-24...
Page 290
Index overflow character 5-16 symbol substitution 5-18 syntax 5-7 Naming a section 6-15 a server query processor 2-9 a subvolume containing a dictionary 2-1, 6-7 fields 3-6 parameters 3-6 records 3-6 the message table file 2-1 user aggregates 3-6 user tables 3-6 user variables 3-6 Nested arithmetic expressions 3-23...
Page 291
Index NOPRINT clause description 5-47 example 5-47 suppressing report items 5-47 syntax 5-47 Number of lines displayed on output device 5-51 per page to skip 5-51 Numeric literals described 3-22 examples 3-22 rules for specifying 3-22 Obtaining the current time or date 5-65 OPEN AS COPY OF description 4-39 syntax 4-39...
Page 292
Index @PRIMARY-EXTENT-SIZE 5-52 @READS 5-52 @SECONDARY-EXTENT-SIZE 5-52 @SPACE 5-52 @STATS filename 5-53 level read 5-53 positions 5-53 records read 5-53 strategy cost 5-53 @SUBTOTAL-LABEL 5-53 @SUMMARY-ONLY 5-53 @TARGET-RECORDS 5-53 @TIME-FORMAT 5-53 @UNDERLINE 5-54 @VSPACE 5-54 @WARN 5-54 @WIDTH 5-54 description 5-48 displaying the current value of 6-16, 6-17 resetting 4-42 setting 4-42...
Page 293
Index Overflow character modifier description 5-17 examples 5-17 syntax 5-17 Overflow condition 3-32, 5-18 Overriding AT END statement 4-4, 5-28 AT START statement 4-6, 5-30 Command Interpreter ASSIGN command 6-3, 6-4 ENFORM ?ASSIGN command 6-2 FOOTING statement 4-24, 5-38 parameters specified in a SET statement 2-6 physical file named in DDL FILE IS 6-3 SUBFOOTING statement 4-45, 5-60 SUBTITLE statement 4-47, 5-62...
Page 294
Index rules for naming 3-6 variable-length 3-27 Parameter name value, displaying 6-17 Passing parameters 2-6 Pattern match 3-24, 3-28 See also Logical expression PCT clause combining percentages and subtotals 5-55 description 5-55 examples 5-55 restrictions 5-56 syntax 5-55 with a by-item 5-55 with user variable 5-56 Percentage of the grand total 5-56 Percentage values 5-56...
Page 295
Index Processing order of compound logical expressions 3-26 of decorations 5-19 of nested arithmetic expressions 3-23 QP command 2-9 Qualification aggregate as a subquery 3-19 example 3-18, 3-19, 3-20 rules for specifying 3-18 with an embedded WHERE clause 3-18 with OVER ALL syntax 3-18 with OVER syntax 3-18 Qualifying field names 3-7 Query...
Page 296
Index Range of values described 3-26 syntax 3-25 Reading an Edit file 6-18 Reassigning a physical file 2-5, 6-4 Reclaiming table space 4-12, 6-7 Record displaying environmental information 6-16, 6-17 referencing a record name 3-6 Record description accessing 4-39 and the ASSIGN Command 2-5 clearing links between 4-11 defined 1-3 deleting from the internal table 4-7...
Page 297
Index Reports adding character strings to target-items 5-19 centering 5-34, 5-49 creating a running total 5-35 footing 4-24, 5-37 headings 5-40 headings for subscripted elements 5-41 horizontal spacing 5-52, 5-58 including the current date 5-23, 5-65, 5-67 including the current time 5-25, 5-65, 5-68 indicating a new page 5-39 information at the end 4-3, 5-27 information at the start 4-5, 5-29...
Page 298
Index SUBTITLE statement 4-47 TITLE statement 4-49 Restricting records 5-72 Restricting records for aggregate calculation 3-21 Result of arithmetic operations assigning to a user variable 3-23 scale factor 3-24 Right justification 5-17 Rules decorations 5-19 field names 3-6 for input elements for FIND files 4-20 for LINK OPTIONAL statement 4-27, C-6 for output fields in FIND files 4-17 for target-items in a LIST statement 4-33...
Page 299
Index Selecting records that contribute to output 4-31, 5-72 Server query processor ASSIGN command 2-7 creating 2-6 creation example 2-9 defined 2-6 PARAM command 2-8 QP command 2-9 Session defined 1-1 example 1-2 terminating 6-10 SET statement and option variables 4-43 and user defined elements 4-43 description 4-42 examples 4-43...
Page 300
Index TITLE 5-69 specifying in a statement AT END 4-3 AT START 4-6 FOOTING 4-23 LIST 4-32 SUBFOOTING 4-43 SUBTITLE 4-46 TITLE 4-48 syntax 5-57 Sort key in a DESC clause 5-6 in an ASCD clause 5-6 Sorting and the BREAK key 2-3 in a FIND statement 4-17 in ascending order 5-6, 5-33 in descending order 5-6, 5-33...
Page 301
Index syntax 5-58 with a Print List 5-58 with a target-item or by-item 5-58 Special characters 3-4 Special edit symbols 5-18 Specifying horizontal spacing 5-58 the primary extent size 5-52 the secondary extent size 5-52 where error messages are sent 2-11 where work files are built 2-10, 2-11 Statements applying only to queries with a LIST statement 4-1...
Page 302
Index Storing a date in internal format 5-67 a time in internal format 5-68 source code in an Edit file 6-8 source code in an edit file 6-18 Strategy cost and a server query processor 2-9 described 5-53 String literals described 3-22 examples 3-22 rules for specifying 3-22...
Page 303
Index SUBTITLE clause and field names 5-61 description 5-61 for current reports 5-62 overriding session wide subtitle 5-62 spacing considerations 5-61 syntax 5-61 SUBTITLE statement cancelling 4-47 description 4-46 examples 4-46 overriding 4-47 resetting 4-47 spacing considerations 4-46 syntax 4-46 with a field name 4-46 SUBTOTAL clause description 5-63...
Page 304
Index TAB clause description 5-66 specifying in a clause AFTER CHANGE 5-4 AT END PRINT 5-27 AT START PRINT 5-29 BEFORE CHANGE 5-31 FOOTING 5-37 SUBFOOTING 5-59 SUBTITLE 5-61 TITLE 5-69 specifying in a statement AT END 4-3 AT START 4-5 FOOTING 4-24 LIST 4-32 SUBFOOTING 4-45...
Page 305
Index Target-list aggregates 3-16 defined 1-2 literals 3-22 Target-record defined 1-3 generated by a LIST statement 4-31 grouping by field values 5-33 sorting 5-6, 5-33 summary records 4-20 summary reports 4-35 Temporarily changing the default overflow character 5-17 the fill character 5-16 Terminal BREAK key 2-3 Terminating query output 2-4...
Page 306
Index TITLE clause description 5-69 examples 5-69 for current report 5-70 overriding session wide title 5-70 spacing considerations 5-69 syntax 5-69 with a field name 5-69 TITLE statement cancelling 4-49 description 4-48 examples 4-48 overriding 4-49 resetting 4-49 spacing considerations 4-48 syntax 4-48 with a field name 4-48 TOTAL clause...
Page 307
Index parameters 4-40 tables 3-32 variables 3-29 User table assignment syntax 3-30 declaring 4-8 default display format 4-10 default storage format 4-10 deleting from the internal table 4-7, 4-12 described 3-32 displaying the current value of 6-17 initializing 4-42 maximum elements 3-32 names 3-6 subscripting 3-9 user defined display format 4-10...
Page 308
Index Value keywords 3-28 Variable See User variable, System variables, or Option variables Vertical spacing 5-55, 5-57, 5-66 Warning messages appearing on a terminal 5-55 listed B-2 WHERE clause and a qualification aggregate 3-21 compared to LINK and LINK OPTIONAL C-12 description 5-72 examples 5-72 link established by C-2...
Need help?
Do you have a question about the ENFORM 058057 and is the answer not in the manual?
Questions and answers