Data Management Library ENFORM Reference Manual ™ Abstract Part Number This manual provides detailed information about the syntax of the ENFORM language.
Document History Edition Part Number Operating System Version Date First Edition Second Edition Update 1 Update 2 Third Edition 82348 A00 82348 B00 82194 82205 058057 GUARDIAN A04/E05 GUARDIAN A05/E06 GUARDIAN A06/E07 GUARDIAN B00/E08 GUARDIAN B00/E08 October 1982 April 1983 December 1983 March 1985 July 1991 The second edition of this manual, including updates 1 and 2, was reformatted in July 1991; no changes were made to the manual’s content at that time.
Document History Edition Part Number Operating System Version Date First Edition Second Edition Update 1 Update 2 Third Edition 82348 A00 82348 B00 82194 82205 058057 October 1982 April 1983 December 1983 March 1985 July 1991 GUARDIAN A04/E05 GUARDIAN A05/E06 GUARDIAN A06/E07 GUARDIAN B00/E08 GUARDIAN B00/E08 The second edition of this manual, including updates 1 and 2, was reformatted in July 1991; no changes were made to the manual’s content at that time.
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. ENFORM now issues error message 123 when the file type given in the DDL record description does not match the physical file type read by the query processor.
New and Changed Information (This page left intentionally blank) iv 058057 Tandem Computers Incorporated
New and Changed Information 058057 Tandem Computers Incorporated v
Contents Preface xv Notation Conventions Section 1 xvii Introduction ENFORM Terminology Section 2 1-1 Running ENFORM Interactive Mode 2-2 Noninteractive Mode 2-2 The Current Output Listing File 2-3 Pressing the Terminal BREAK Key Logical File Assignments 2-3 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 The Command Interpreter QP Command 2-9 Example of Server Query Proces
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 Aggregates and Scale 3-21 Literals 3-22 Numeric Literals 3-22 String Literals 3-22 Arithme
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 Cancelling Session-Wide AT END Information 4-4 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 Cancelling Session-Wide AT START Information 4-6 CLOSE Statement 4-7 The Effect of a CLOSE Statement on the Internal
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 Request-Qualification 4-35 Conditional Printing 4-35 Summary Reports 4-35 Optional Clauses 4-37 OPEN Statement 4-39 Using OPEN AS A COPY OF 4-33 4-39 PARAM Statement 4-40 How ENFORM Treats Parameters 4-41 SET Statemen
Contents Section 5 Clauses AFTER CHANGE Clause 5-4 Specifying a Field Name within an AFTER CHANGE Clause Spacing Considerations 5-4 ASCD and DESC Clauses 5-4 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 Scale Factor Edit Descriptor 5-14 Optional Plus Edit Descriptor 5-15 Modifiers 5-15 Field Blanking Modifiers 5-16 Fill Character Modifier 5-
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 Spacing Considerations 5-32 BY and BY DESC Clauses 5-33 CENTER Clause 5-34 Centering Single Report Items 5-34 Centering All Report Items 5-34 Centering a Print List 5-34 CUM Clause 5-35 CUM with OVE
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 SKIP Clause with a Print List 5-57 5-57 SPACE Clause 5-58 SPACE Clause with a LIST Target-item or By-item SPACE Clause with a Print List 5-58 5-58 SUBF
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 Section 6 Commands ?ASSIGN Command 6-2 ?ATTACH Command 6-5 ?COMPILE Command 6-6 ?DICTIONARY Command 6-7 Identifying the Dictionary 6-7 Clearing Internal Tables 6-7 ?EDIT Command 6-8 ?EXECUTE Command ?EXIT Command 6-9 6-10 ?HELP Command
Contents Appendix B Error Messages ENFORM Initialization Messages B-2 !!! Error and ***Warning Type Messages *** File Error Type Messages ENFORM Trap Messages BUILDMK Messages Appendix C B-3 B-19 B-23 B-23 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 How ENFORM Handles a WHERE Clause C-2 When a WHERE Clause Establishes a Link C-3 Comparison of
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 Figure 3-4. Query Outline of Target-Aggregate with OVER Syntax 3-16 3-17 Figure 3-5. Query Outline of Qualification Aggregate with OVER Over-item Syntax 3-20 Figure 3-6.
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.
Preface (This page left intentionally blank) xvi 058057 Tandem Computers Incorporated
Preface 058057 Tandem Computers Incorporated xvii
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. Lowercase italic letters represent variable items that you supply.
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. The syntax of the ENFORM language elements including statements, clauses, commands, aggregates, expressions, literals, and variables.
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 Clause empname,salary, Targetlist Target-items Statement Query WHERE salary GT 2000; Clause Request-Qualification Report Compiler/ Report Writer Dictionary TargetRecords Query Processor Data Base The important terms are: Query specifications.
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. A request-qualification begins with a WHERE keyword followed by a logical expression. Compiler/report writer.
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.
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 > ENFORM commands and statements can be entered either directly or indirectly.
Running ENFORM Pressing the Terminal Break Key The Current Output Listing File The current output listing file is the file to which ENFORM directs output. During the 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.
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. Use the PARAM command of the Command Interpreter to specify parameters prior to execution of the compiled query file. The PARAM command overrides any values specified in a SET statement for a parameter.
Running ENFORM Passing Parameters to Compiled Query Files Figure 2-1.
Running ENFORM Passing Parameters to Compiled Query Files The Command Interpreter ASSIGN Command For every physical file an ENFORM application accesses, the server query processor 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. A server query processor allows for heavily accessed physical files to be kept open.
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. Max-cost must be an integer between one and eight. The default is no limit.
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” names. In the example, these are F1, F2, and F3.
Running ENFORM Generic Files Table 2-1. ENFORM Generic Files and Their Uses Generic File Name Use 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). Output is produced in ASCII with a record length of 132 bytes. All reports produced as a result of the execution of a LIST statement.
Running ENFORM Generic Files Table 2-1. ENFORM Generic Files and Their Uses (continued) Generic File Name Use 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 Generic Files and the Server Query Processor The generic files QUERY-WORK-AREA, QUERY-SORT-AREA, QUERYQPSTATISTICS, 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 Commands Statements Command output (e.g.,?SHOW) Report from a LIST statement 1) The QUERY-COMPILER-LISTING file if assigned, otherwise 2) 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. The syntax of these language elements is described later in this manual.
ENFORM Language Elements Figure 3-1. ENFORM Language Elements ?DICTIONARY $mkt.
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 Comments Character blank quotation mark ” assignment syntax apostrophe := ’ parenthesis () brackets [] question mark comma ? , semicolon ; Description Separates keywords and other language elements.
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. Must not contain embedded blanks. Must not end with a hyphen (-).
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. Consider the record descriptions shown in Figure 3-2. Figure 3-2. Records with Duplicate Field Names RECORD stock-items.
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.
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.
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. For example: u-var [ 3:8 ] Refers to the third through eighth elements of the user table.
ENFORM Language Elements Aggregates ENFORM allows you to reference nested data base tables. For example: tot-sales Refers to month, top-dept, and the first through last elements of wkly-sales within the first element of tot-sales. tot-sales[4].wkly-sales[2] Refers to the second element of wkly-sales within the fourth element of tot-sales. tot-sales[1:5].wkly-sales[3] Refers to the third element of wkly-sales within the first thru fifth elements of totsales. tot-sales[2:3].
ENFORM Language Elements Aggregates COUNT is a predefined ENFORM aggregate that tallies the occurrences of a field defined as either numeric or alphanumeric. MAX 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. UNIQUE adds considerable processing overhead and should not be specified unless you know unwanted duplicate values exist. UNIQUE is redundant with MAX or MIN.
ENFORM Language Elements Aggregates User Aggregates When the predefined aggregates do not meet your needs, you can define your own 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. A user aggregate declared with an end expression cannot be used as a qualification aggregate OVER a by-item.
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 Target Aggregates AVG (salary), grossavg (salary); A target aggregate appears as part of the ENFORM output.
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. Notice that AVG target-item-2 prints as a separate column on the report with only one non-blank entry.
ENFORM Language Elements Aggregates In this example, AVG target-item-1 prints as a separate report column with a nonblank 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. This field is blank for all other target-records.
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.
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. For example consider Figure 3-6.
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); The average of “price” over “part number” will now be returned with six total digits, with two digits to the right of the decimal point. Literals Literals can be used in both a target-list and a request-qualification.
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 ---------------------------------------CENTRAL UNIVERSITY....UNIVERSITY WAY BROWN MEDICAL CO ....
ENFORM Language Elements Logical Expressions Scale Factor of the Result The scale of the result is determined by the number of digits after the decimal point. 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. This could result in loss of significant digits if too great a precision is used for the field or variable.
ENFORM Language Elements Logical Expressions The syntax of a logical expression is: [NOT] condition [NOT] condition ...
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. m,n 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. is a dash indicating any number of characters (0 thru 255) can precede or follow string-literal when it is found as a field value.
ENFORM Language Elements Logical Expressions BEGINS WITH and CONTAINS BEGINS WITH and CONTAINS are special conditional operators that can be used to 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" THRU "LZZZZZZZZZZZZZZZZZ" Note that the second string literal is 18 characters long, the length of the partname field.
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. If partnum has any other value except 2001, partnum prints.
ENFORM Language Elements User Variables User Variable as a Target-item When a user variable is specified as a target-item, ENFORM uses the default value or 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. The value of a user variable changes as target list elements are evaluated, so that at any time, the value of the user variable depends upon the value most recently assigned.
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. For the second occurrence of u-var ENFORM uses the value of the salesman field. This value changes for every target-record.
ENFORM Language Elements Arithmetic Overflow Conditions A User Variable in Request-Qualification A user variable can be specified in a request-qualification. When a user variable is used for request qualification, ENFORM always uses either the default or initial value whichever is appropriate.
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. The AT END, AT START, FOOTING, SUBFOOTING, SUBTITLE, and TITLE statements apply only to queries containing a LIST statement.
Statements Table 4-1. Summary of Statements (continued) Report Information Formatting Statement Function AT END AT START FOOTING SUBFOOTING SUBTITLE TITLE 4–2 prints information at the end of all subsequent reports in the current session. See also the AT END PRINT clause in Section 5. prints information just before the first set of column headings for all subsequent reports in the current session. See also the AT START PRINT clause in Section 5.
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 ] ] [ ; ] print-list can contain any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
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 Current Report or All Reports Cancelling Session-Wide AT END Information An AT END statement prints information at the end of all subsequent reports in the 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. (See the AT START PRINT clause in Section 5.
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: CLOSE record-name user-variable-name user-aggregate-name user-table-name param-name , ... [ ; ] record-name is the name of a dictionary record description previously accessed by an OPEN statement.
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 ( formal-argument ) user-aggregate-name = ( step-expression˚[ ‚ [ end-expression ] [ ‚ initialize-constant ] ] ) [ INTERNAL internal-format ] [ AS display-format ] [ HEADING heading-string ] ,...
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 (“ ”). Specify the DECLARE statement before you reference a user variable, user aggregate, or user table.
Statements DECLARE Statement Declaring a User Variable or User Table A user variable or table declaration remains in effect until the end of the current 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. To change this default, specify the optional INTERNAL clause described in Section 5.
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: DELINK record-name1 [ TO [OPTIONAL] ] record-name2 VIA field-name qualified-field-name1 [ TO [ OPTIONAL ] ] qualified-field-name2 , ... [;] record-name1 or record-name2 are the names of dictionary record descriptions. field-name is the name of a field common to both of the 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 is the name of the subvolume where your dictionary files reside.
Statements DICTIONARY Statement Clearing the Internal Table Entering the DICTIONARY statement without a volume and subvolume name is a 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. The elements cleared by the DICTIONARY statement are: All dictionary record descriptions from previous OPEN statements. All previous links.
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. The syntax of the FIND statement is: FIND [ UNIQUE ] output-record-name ( [ output-field-name := ] BY by-item BY DESC by-item target-item ASCD target-item DESC target-item ,...
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. An input field name must be sufficiently qualified to avoid ambiguity between it and any other name specified in the query. logical-expression is an expression returning a true or false value.
Statements FIND Statement Group Definition and Sorting The BY and BY DESC clauses group and sort records. The appearance of a BY or BY 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). The BY and BY DESC clauses are described in Section 5. The ASCD and DESC clauses sort records in ascending or descending order.
Statements FIND Statement 3. 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. FILE IS old KEY-SEQUENCED. 02 A PIC XX. 02 B PIC 99. 02 C OCCURS 2 times 04 DD PIC AA. 04 EE PIC XX. KEY 0 IS A. END RECORD new. FILE IS new 02 A PIC 02 B PIC 02 D1 PIC 02 D2 PIC 02 E1 PIC 02 E2 PIC END UNSTRUCTURED.
Statements FIND Statement Input Elements The output fields receive values from any combination of the following input 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. When the output-field-name is omitted, the input field name must be fully qualified. FIND ... ( parts.partnum, ...) ; The value of a numeric literal.
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. Avoid this specification, however, unless the data type of the fields receiving the data is exactly the same as the data type of the input group.
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); returns one target-record for each job in each department. Only the first employee name (empname) for each job is returned.
Statements FIND Statement Statements and Clauses That Do Not Apply to the FIND Statement ENFORM queries with a FIND statement produce records only. There are no report features such as headings, titles, summary information, and special formatting. The following statements and clauses apply only to queries using the LIST statement and 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 ] ] [ ; ] print-list can be any combination of literals, FORM, SKIP, SPACE or TAB clauses.
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. The same page number applies to all physical pages in a logical page. Using the CENTER clause within the FOOTING statement centers the footing on the page.
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: LINK record-name1 [ TO ] [ OPTIONAL ] record-name2 VIA field-name qualified-field-name1 [ TO ] [ OPTIONAL ] qualified-field-name2 ,...[ ; ] record-name1 and record-name2 are the names of dictionary record descriptions containing a common field.
Statements LINK Statement Duration of Link Established by LINK or LINK OPTIONAL Statement When you use either the LINK statement or the LINK OPTIONAL statement, you establish a link that exists for the duration of the ENFORM session. You can clear such a link by entering one of the following: a CLOSE statement for one of the record descriptions. a DELINK statement for the link. a DICTIONARY statement or a ?DICTIONARY command that clears the entire internal table.
Statements LINK Statement LINK OPTIONAL Statement Considerations When you establish a link by specifying the LINK OPTIONAL statement, you preserve 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: 1. 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. 2.
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” for a given logical record, the region record description is also “non-contributing” for that logical record.
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.
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. You cannot specify more than 63 by-items in your query.
Statements LIST Statements Input Record Description When you use a LIST statement, ENFORM opens the data files associated with any 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. The record description describes the file type (key-sequenced, relative, entry-sequenced, unstructured) of the data file.
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. If the variable value is neither initialized nor assigned, the default value is zero. A user variable cannot be assigned the values of a subscript range.
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. For example, specifying: LIST account-num; causes ENFORM to display account-num without first converting it to a readable form.
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: DEPT ---- JOB --- EMPNAME ------- SALARY ------ COUNT EMPNAME ------- 0101 MANAGER SALESMAN SECRETARY SYS.
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: DEPT ---- JOB --- 0101 MANAGER SALESMAN 0102 0201 SECRETARY SYS.
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 SUBTITLE clause prints a subtitle for a report TITLE
Statements OPEN Statement OPEN Statement The OPEN statement accesses the dictionary record description. The syntax of the OPEN statement is: record-name ,...[ ; ] { record-name2 [ AS ] COPY [ OF ] record-name1 } OPEN 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. record-name2 can be the name of a dictionary record description.
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. The name must conform to the naming conventions described in Section 3. internal-format is the internal format for storing the parameter.
Statements PARAM Statement How ENFORM Treats Parameters ENFORM treats a parameter syntactically as if it were a literal. ENFORM handles 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.
Statements SET Statement Initializing User-Defined Elements When initializing a user variable, user table, or a parameter, specify values that are 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.
Statements SUBFOOTING Statement SUBFOOTING Statement The SUBFOOTING statement allows you to specify a subfooting to be printed at the 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. See the SUBFOOTING clause in Section 5.
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. The same page number applies to all physical pages in a logical page.
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. The same page number applies to all physical pages in a logical page.
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 ] ] [ ; ] print-list can contain any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
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. The same page number applies to all physical pages in a logical page.
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.
Clauses Table 5-1. ENFORM Clauses and Their Functions (continued) Calculating Running Total, Total, Subtotal, and Percentage Clause Function CUM PCT SUBTOTAL TOTAL 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 targetitem. The PCT OVER clause prints the percentage that each grouped value is of the total of all values in the group.
Clauses Table 5-1. ENFORM Clauses and Their Functions (continued) Converting Data to Internal or Display Format Clause Function AS AS DATE AS TIME INTERNAL JULIAN-DATE specifies a display format for printing a target-item or by-item. specifies the display format for printing a date. specifies the display format for printing a time. specifies the storage format for a user defined element. translates date information to internal format.
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. print-list contains any combination of literals, FORM, SKIP, SPACE or TAB clauses.
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: target-item { ASCD DESC } target-item is the name of a field from an input record which serves as a sort key for the target records. The ASCD and DESC clauses do not group field values.
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 report-item AS " "[" [ decorations,… ] [ modifiers,… ] "]" repeatable-edit-descriptors " " "[" [ decorations,… ] [ modifiers,… ] "]" ( nonrepeatable-edit-descriptors repeatable-edit-descriptors ) " report-item AS [ nonrepeatable-edit-descriptors ] repeatable-edit-descriptors report-item is either a by-item or a target-item.
Clauses AS Clause where w specifies the width of the report-item. m 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. d specifies the number of digits to the right of the decimal. mask combination of the characters 9, Z, V, .(period) and literals. The combination must be enclosed within apostrophes (‘ ’) or greater than and less than symbols (< >).
Clauses AS Clause "["modifiers"]" alter the effect of the edit descriptors as follows: BN,BZ prints blanks for null or zero values respectively. FL char specifies a substitute fill character. OC char respecifies the overflow character. LJ, RJ specifies right or left justification. SS pr-of-symbols allows substitution of symbols. where char is an ASCII character enclosed in apostrophes. pr-of-symbols is a special mask symbol (see repeatable-edit-descriptors) and a substitution character.
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] w is an unsigned integer that specifies the width in characters of the value of the target-item or by-item to be printed. The maximum value for w is 255 characters. If you specify w, ENFORM prints the number of characters specified for the value of the target-item or by-item.
Clauses AS Clause Examples of the Integer Edit Descriptor. The following examples show the effect of the integer edit descriptor. Format -----I7 I7.2 I7.6 I7.6 Item Value ---------100 -1 100 -1 Printed Item -----------100 -01 000100 -000001 Fixed Format Edit Descriptor The fixed format edit descriptor specifies a fixed point display format. The syntax is: Fw.d [.m] w is an unsigned integer that defines the total width of the target-item or by-item value.
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: Z is a digit selector. Z specifies that if no digit exists, zeros are suppressed. Z can be used with alphanumeric or numeric data. Note: only a capitol Z is the special symbol.
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>, ... zeroes are displayed to the right of the decimal point (the mask does not change the INTEGER format). If cost were declared as INTERNAL F4.2, and appeared in the query as: LIST (cost) AS M<99>, ...
Clauses AS Clause Nonrepeatable Edit Descriptors Nonrepeatable edit descriptors indicate some ways target-items or by-items are to be 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 SS SP S or SS indicates no plus (+) sign is to be printed. SP 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. Specify SP when you want ENFORM to precede a value with an optional plus sign.
Clauses AS Clause Field Blanking Modifiers Field blanking modifiers indicate under what circumstances to print blanks. The syntax is: { BNBZ } BN prints a blank field if value is null. BZ 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. Examples of the Field Blanking Modifiers.
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 (‘ ’). The overflow condition occurs if there are more characters to be printed than the display format specifies.
Clauses AS Clause Examples of the Justification Modifiers. The following examples show the effect of the justification modifiers. Format -----"[RJ] A12" A12 "[RJ] A2" Item Value ---------HELLO HELLO HELLO Printed Item -----------HELLO HELLO LO Symbol Substitution Modifier The symbol substitution modifier allows you to change the standard symbols ( ‘9’, ‘V’, ‘Z’, ‘.’ and ‘,’) used in edit descriptors.
Clauses AS Clause Decorations Decorations specify character strings that can be printed along with the value of a 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. More than one condition specifier can exist for a decoration.
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. In this case, the negative condition must be explicitly indicated if you want ENFORM to print the negative sign.
Clauses AS Clause The following are examples of decorations: Format -----"[MF'<',MP'>',ZPP'b'] F12.2" "[MF'<',MP'>',ZPP'b'] F12.2" "[MA1'CR',MPF'$'] F12.2" "[MA1'CR',MPF'$'] F12.2" "[MA1'CR',MPF'$'] F12.2" "[OA1'**overflow**'] F12.2" "[OA1'**overflow**'] F12.2" "[ZPA2'+'] I8" "[ZPA2'+'] I8" "[ZPA2'+'] I8" 5–22 058057 Tandem Computers Incorporated Item Value ---------1000.00 -1000.00 1000.00 -100.00 0.00 1000000.00 1000000000.00 -10 100 0 Printed Item -----------1,000.00 <1,000.00> CR $1,000.00 $100.
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. * specifies the default display format.
Clauses AS DATE Clause Examples of Date Display Formats These date keywords produce the following: MA MA3 M2 M MB2 DA DA3 D2 DB2 D3 DB3 DOB2 DAO Y2 YB2 Y4 5–24 058057 Tandem Computers Incorporated JANUARY,FEBRUARY,...,DECEMBER JAN,FEB,...,DEC 01,02,...,12 1,2,...,12 1, 2,...,12 MONDAY,TUESDAY,...,SUNDAY MON,TUE,...,SUN 01,02,...,31 1, 2,...,31 001,002,...,366 1, 2,...,366 1ST, 2ND, ... 31ST FIRST, SECOND, ... ,THIRTY-FIRST 00,01, ...,76,77,78... 0, 1, ...,76,77,78... 1900,1901,...
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).
Clauses AS TIME Clause Examples of the Time Display Format These time keywords produce the following: HB2 HP2 HPB2 M2 MB2 S2 SB2 5–26 058057 Tandem Computers Incorporated 1, 2,....,24 01,02,....,12 1, 2,....,12 00,01,....,59 0, 1,....,59 00,01,....,59 0, 1,....
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 contains any combination of literals, FORM, SKIP, SPACE and TAB clauses.
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. The CENTER, Option Variables, SKIP, SPACE, and TAB clauses are described in this section.
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 is the name of a field grouped by a BY or BY DESC clause. print-list is any combination of literals, FORM, SKIP, SPACE or TAB clauses.
Clauses BEFORE CHANGE Clause Spacing Considerations By default the BEFORE CHANGE clause information begins printing in the same 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: { BYBY DESC } by-item by-item is the name of a field from an input record whose values are to be used to group and sort target-records. BY and BY DESC clauses group and sort records according to the field values.
Clauses CENTER Clause CENTER Clause The CENTER clause centers an object within its context. The syntax of the CENTER clause is: target-item { by-item }CENTER‚ 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. by-item is the name of a field grouped by a BY or BY DESC 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.
Clauses CUM Clause CUM Clause Used with User Variable Restrictions 5–36 When a numeric target-item with a CUM clause is assigned to a 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 can be any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
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. The same page number applies to all physical pages in the logical page. Using the CENTER clause centers the footing on the page.
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 a By-item When the FORM clause follows a field name that has been grouped with a BY or BY DESC clause, ENFORM starts a new page whenever the field value changes. If number is specified, ENFORM starts a new page only if there are fewer than that number of lines remaining on the current page.
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.
Clauses HEADING Clause Printing / in a Column Heading Sometimes, the / character needs to appear within a column heading. In this case, use 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.
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. The default heading for a user variable is either the heading defined in the DECLARE statement, or if no heading is defined, the user variable 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: An Alphanumeric, where n is the length In Integer, where n is the length Fw.
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. month is the month in 2 digits, 1-12. day is the day in 2 digits, 1-31. Dates are a common part of data base records.
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: 05 yearly-julian-date. 10 day-of-year PIC "999". 10 current-year PIC "99".
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 { by-item }NOHEAD 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 { by-item }NOPRINT 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 Clauses The Option Variable clauses allow you to redefine the default values for several operational variables. Refer to the SET statement in Section 4.
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; must be enclosed in quotation marks. @BLANK-WHEN-ZERO When set to ON, ENFORM suppresses the printing of target-item or by-item values of zero in reports.
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.
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 (//). Pressing the CTRL and Y keys simultaneously. Pressing the BREAK key. Control returns to ENFORM. To reset the display count so that the entire ENFORM program is printed, enter 0 for number.
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 (*). If you set @OVERFLOW to ASCII blank, ENFORM truncates the value in a field whenever an overflow occurs instead of replacing the value with blanks.
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. The first file read is indicated by the number 1. RECORDS READ total number of logical records read from this physical file.
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. The default number is one. @WARN specifies when warning messages are to appear on the terminal. When set to OFF, warning messages do not appear. The default is ON.
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.
Clauses PCT Clause Combining Percentages and Subtotals The SUBTOTAL OVER clause can be combined with the PCT OVER clause, causing 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 Target-item or By-item The SPACE clause can precede an either a target-item or a by-item within a LIST statement. When number is specified, ENFORM inserts the specified number of spaces every time the SPACE clause is processed. When number is not specified, one space is inserted.
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. The same page number applies to all physical pages in the logical page.
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. The syntax of the SUBTITLE clause is: SUBTITLE print-list [ CENTER ] print-list contains any combination of literals, FORM, SKIP, SPACE, or TAB clauses.
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. The CENTER, Option Variable, SKIP, SPACE, and TAB clauses are described in this section.
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 name, a user variable, or a System Variable clause.
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. The syntax of the SUPPRESS clause is: SUPPRESS [ WHERE ] logical-expression logical-expression is an expression returning a true or false value. See Section 3 for more information.
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 Date or Time The @DATE and @TIME System Variable clauses return the current date and time in internal format. When used in an expression, ENFORM treats them as numeric literals.
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 ] TAB number is an integer. The TAB clause specifies which column to tab to before printing an element on a report. Care must be taken not to overlap elements.
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. You must define the field that receives the date value from the TIMESTAMP-DATE clause in your data 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. Your data dictionary must contain a definition of the field to which the TIMESTAMPTIME clause returns a time value.
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. The same page number applies to all physical pages in a logical page. Using the CENTER clause centers the title on the page.
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 { by-item } TOTAL 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.
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. The logical expression in a WHERE clause defines which records are restricted from contributing to the target file.
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. You can either enter commands at the level of the ENFORM prompt (>) or place commands in an EDIT file.
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: ?ASSIGN record-name { generic-file-name }[ ‚TO ]physical-filename , create-open-spec [ ?ASSIGN ... ] record-name , { , create-open-spec } ... record-name is the name of a record description from a DDL dictionary.
Commands ?ASSIGN Command create-open-spec is one file creation or open attribute. Only exclusion spec is used by ENFORM.
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. If the DDL physical file name is not being overridden, only the record name and the exclusion specification need be specified.
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. If you do not specify the ?ATTACH command, ENFORM defaults to a dedicated query processor.
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. The list must be enclosed within parentheses.
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. Refer to the GUARDIAN Operating System Programmer’s Guide for information on specifying Tandem file names.
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. An ?EDIT command invokes the Editor and operates just as if the Command Interpreter EDIT Command was used.
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. The ?EXECUTE command changes the dictionary being used for the duration of the execution.
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. Among these topics is the syntax of the ENFORM statements, clauses, commands, and language elements.
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: CLAUSES: OTHER: AT END DICTIONARY LIST SUBTITLE AT START EXIT OPEN TITLE global modifier report format aggregate logical expression print list COMMANDS: ?ASSIGN ?EDIT ?RUN ?ATTACH ?EXECUTE ?SECTION CLOSE FIND PARAM DECLARE FOOTING SET DELINK LINK SUBFOOTING modifier positional control tar
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. The physical device can be a printing device such as such as $mlp. The physical device can also be a file name.
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. A section-name must be enclosed within parentheses.
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. The ?SECTION command names a collection of ENFORM commands and/or statements within an EDIT file. The ?COMPILE, ?RUN, and ?SOURCE commands can be used to read a section or sections of 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: ?SHOW OPEN LINK CONTROL LIMITS 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. param-name is the name of a parameter.
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. Displays all ASSIGN table information related to the specified record name. Displays the current value(s) of the user variable or table.
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. ( section-name, ...) the name of the sections of the EDIT file. section-name must be enclosed with parentheses.
Appendix A ENFORM Syntax Summary ENFORM syntax is summarized in this appendix. For specific details of syntax, refer to the language elements, statement, clause and command sections.
ENFORM Syntax Summary Language Elements Logical Expression: [NOT] condition [NOT] condition ...
ENFORM Syntax Summary Language Elements Statements AT END [ PRINT print-list [ CENTER ] ] [ ; ] AT START [ PRINT print-list [ CENTER ] ] [ ; ] CLOSE record-name user-variable-name user-aggregate-name user-table-name param-name , ...
ENFORM Syntax Summary Language Elements FIND [ UNIQUE ] output-record-name ( [ output-field-name := ] BY by-item BY DESC by-item target-item ASCD target-item DESC target-item ,... ) [ WHERE logical-expression ] ; FOOTING [ print-list [ CENTER ] ] [ ; ] LINK A–4 record-name1 [ TO ] [ OPTIONAL ] record-name2 VIA field-name qualified-field-name1 [ TO ] [ OPTIONAL ] qualified-field-name2 058057 Tandem Computers Incorporated ,...
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 CENTER HEADING string-literal AS display-format AS DATE display-format AS TIME display-format FORM [ n ] SKIP [ n ] SPACE [ n ] TAB [ n ] ,... ,... ;...
ENFORM Syntax Summary Language Elements PARAM { param-name [ INTERNAL internal-format ] }, ...
ENFORM Syntax Summary Clauses Clauses AFTER CHANGE [ ON ] by-item PRINT print-list [ CENTER ] target-item { ASCD DESC } report-item AS report-item AS report-item AS " "[" [ decorations,… ] [ modifiers,… ] "]" repeatable-edit-descriptors " " "[" [ decorations,… ] [ modifiers,… ] "]" ( nonrepeatable-edit-descriptors repeatable-edit-descriptors ) " [ nonrepeatable-edit-descriptors ] repeatable-edit-descriptors report-item is either a by-item or an target-item.
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: A [ w ] for alphanumeric values. Iw [ .m ] for integer values. Fw.d [ .m ] for fixed point values. M mask for a template to combine literals and values. where w specifies the width of the report-item.
ENFORM Syntax Summary Clauses location is where the character string is to be printed: An indicates char-string is to be printed at absolute position n. F 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. P indicates char-string is inserted before the value is formatted. If condition is satisfied, char-string is prints to the right of the value.
ENFORM Syntax Summary Clauses BEFORE CHANGE [ ON ] by-item PRINT print-list [ CENTER ] { BYBY DESC } by-item target-item { by-item }CENTER‚ CENTER ALL‚ target-item FOOTING CUM ALL [ OVER OVER by-item ] print-list [ CENTER ] FORM [ number ] by-item { target-item } HEADING "heading-string" INTERNAL internal-format JULIAN-DATE ( year , month , day ) A–10 target-item { by-item }NOHEAD NOHEAD ALL 058057 Tandem Computers Incorporated
ENFORM Syntax Summary Clauses target-item { by-item }NOPRINT 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 @SECONDARY-EXTENT-SIZE @READS @SPACE @TARGET-RECORDS @VSPACE @WIDTH @DECIMAL @NEWLINE @NONPRINT-REPLACE @OVERFLOW @UNDERLINE @SUBTOTAL-LABEL TO { ONOFF } TO
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 ] target-item { by-item } TOTAL WHERE logical-expression A–12 058057 Tandem Computers Incorporated
ENFORM Syntax Summary Commands Commands ?ASSIGN record-name { generic-file-name }[ ‚TO ]physical-filename , create-open-spec [ ... ] ?ASSIGN record-name , { , create-open-spec } ... ?ATTACH [ process-name ] ?COMPILE edit-filename [ ( section-name, ... ) ] TO compiled-physical-filename ?DICTIONARY [ dict-subvol-name ] ?EDIT [ edit-filename ] ?EXECUTE compiled-physical-filename ?EXIT ?HELP [ help-element ] ?OUT [ physical-filename ] ?RUN [ edit-filename [ ( section-name, ...
ENFORM Syntax Summary ENFORM Procedures ?SHOW OPEN LINK CONTROL LIMITS ASSIGN [ record-name ] user-variable-name record-name param-name ?SOURCE edit-filename [ ( section-name, ...
ENFORM Syntax Summary ENFORM Procedures FORTRAN: CALL ENFORMSTART (ctlblock ,compiled-physical-filename ,\buffer-length\ ,error-number [, \restart-flag\] [, param-list ] [, assign-list ] [, process-name ] [, \cpu\] [, \priority\] [, \timeout\] [, reserved-for-expansion ] ,\maskword !INT:ref !INT:ref !INT:value !INT:ref !INT:value !INT:ref !INT:ref !INT:ref !INT:value !INT:value !INT:32:value !INT:ref !INT:value count ENFORMRECEIVE ( ctlblock, buffer ) !INT:function INT:ref INT:ref ! CALL ENFORMFINISH (
ENFORM Syntax Summary ENFORM Procedures (This page left intentionally blank) A–16 058057 Tandem Computers Incorporated
Appendix B Error Messages 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. The error does not abort the query although it could lead to more serious error conditions. *** FILE ERROR ...
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. Rebuild the key-sequenced message table file using the appropriate version of BUILDMK.
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.
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. All tables are cleared. !!! ERROR [37] Overflow encountered on input conversion of numeric-literal Numeric literal exceeds 32767.
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. Clear the table by entering ?ASSIGN without a physical file name.
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. !!! ERROR [52] Not currently supported The indicated feature or operation may not be used.
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 Aggregate clause. !!! ERROR [58] Illegal use of KEY item (SERVER-related failure on name) Record-name.
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. !!! ERROR [64] By-item not found Either the grouped item was not defined in a BY or BY DESC clause or was misspelled. !!! ERROR [65] An aggregate may not be used in a print-list clause.
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 The literal table overflowed its maximum size of 5,915 words.
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. !!! ERROR [79] TAB 0, SKIP 0 or FORM 0 not defined Number must be greater than zero.
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. The QP terminates abnormally when this condition occurs and must be restarted (preferably in another CPU). *** WARNING [87] No RUN file has been named Specify the Edit file name.
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. ENFORM will not execute your query because this could produce an undesirable cross-product.
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. Use the CLOSE statement to clear parameter values not needed.
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. Try running ENFORM with a MEM (Refer to the GUARDIAN Operating System Programmer’s Guide ) greater than 52. !!! ERROR [112] Illegal dictionary description (SERVER-related failure on name).
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. !!! ERROR [133] Invalid dictionary specification The dictionary name specified in either a DICTIONARY statement or a ?DICTIONARY command is not a valid file name.
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. !!! ERROR [169] ?RUN command is ignored unless entered interactively The ?RUN command must be typed in at the terminal.
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. changed. Its value cannot be In certain cases, ENFORM treats a parameter exactly like a numeric literal.
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 writer.
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.
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. *** FILE ERROR (PURGE failure) on name There was a problem purging the physical file.
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. ENFORM terminates abnormally. Correct the problem with the message table and restart the session.
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. ENFORM QP TRAP: nnn S:xxxxxx P: xxxxxx E: xxxxxx L: xxxxxx The ENFORM Query Processor process has failed. nnn is the trap number as described in the GUARDIAN Operating System Programmer’s Guide.
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.
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.
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.
Appendix C LINKS and the LINK OPTIONAL 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. How ENFORM Defines ENFORM recognizes links that are established: a LINK 1. by a LINK statement that references both record descriptions 2.
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; LIST fruit.color, orange.variety, peach.variety WHERE (fruit.season = "summer" AND fruit.color = orange.color) OR (fruit.season <> "spring" AND fruit.fuzz = 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. Comparison of the WHERE Clause and the LINK Statement A WHERE clause differs from a LINK statement as follows: A WHERE clause can link more than two record descriptions.
LINKS and the LINK OPTIONAL Statement Rules How ENFORM Defines a LINK Links Due to the Transitive Property of Links The transitive property of links applies to both two-directional and one-directional 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. For one-directional links, A is linked to B if: A is optionally linked to X and X is linked to B. A is linked to X and X is optionally linked to B.
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 banana pear Note that apple is linked to orange, banana, and pear; but orange, banana, and pear are not linked to apple.
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement Examples of Illegal Links The following examples involve query specifications that use the sample data base shown in the ENFORM User’s Guide. The purpose of these examples is to show illegal links, not to show useful queries. Each example includes a sketch of its links. The following symbols are used for the sketches: represents a one-directional link initiated by a LINK OPTIONAL statement.
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.
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; LIST empname, employee.regnum, employee.branchnum WHERE employee.regnum <> region.regnum OR employee.branchnum <> branch.
LINKS and the LINK OPTIONAL Statement Rules Review of Rules for the LINK OPTIONAL Statement Examples of Legal Links The following examples contain legal links that might appear to be illegal. These 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. The following query specifications contain a LINK OPTIONAL statement and a WHERE clause: LINK employee TO OPTIONAL region VIA regnum; LIST empname, employee.
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; LIST empname, employee.regnum, employee.branchnum SUPPRESS WHERE employee.regnum = region.regnum OR employee.branchnum = branch.
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. Table C-1. Truth Table C–12 LINK Statement LINK OPTIONAL Statement WHERE Clause Establishes a session-wide link. Establishes a two-directional link.
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. Component of an ENFORM statement. Command. A directive to the ENFORM compiler. Compiler/Report Writer. The ENFORM process that both compiles ENFORM queries and formats and writes ENFORM reports.
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. Data that has been described in such a manner that only one value exists for every field position in a record. Numeric Literal. Composed of the digits 0 thru 9.
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. Source File. The Edit file that contains the source code. See also Source Code. Statement. Main instruction of an ENFORM program. String Literal.
Glossary (This page left intentionally blank) Glossary–4 058057 Tandem Computers Incorporated
Index A 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 excluding duplicate values (UNIQUE) 3-14 predefined 3-14 qualification aggregates described 3-18 example 3-18, 3-19 rules for specifying 3-18 with embedded WHERE clause 3-21 with OV
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 integer 5-10 mask 5-12 AS DATE clause description 5-23 examples 5-24 syntax 5-23 with the JULIAN-DATE CONVERSION clause 5-44 AS TIME clause
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 and a field name 5-27 description 5-27 examples 5-27 overriding session-wide AT END 5-28 print-list elements 5-27 spacing considerations 5-27 syntax 5-2
Index syntax 4-5 with a field name 4-5 Attaching a query processor 6-6 Average value, finding 3-13 AVG 3-13 B 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 BUILDMK messages B-23 BY clause description 5-33 example 5-33 sorting precedence 5-33 syntax 5-33 BY DESC clause description 5-33 sorting precedence 5-33 syntax 5-33 B
Index C 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 specifying in a clause AFTER CHANGE 5-5 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 4-37 AT END 4-4 AT
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 NOHEAD 5-46 NOPRINT 5-47 Option Variable 5-48 PCT 5-55 requiring grouping 5-4, 5-31 SKIP 5-57 SPACE 5-58 SUBFOOTING 5-59 SUBTITLE 5-61 SUBTOTAL 5-63 summarized 5-2 SUPPRESS 5-64 System Variable 5-65 TAB 5-66 TIMESTAMP-DATE 5-67 TIMESTAMP-TIME 5-68 TITL
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 defined 2-1 dictionary option 2-1 IN option 2-1 message table file option 2-1 OUT option 2-1 FC command 2-2 PARAM command for a server query processor 2-8 syntax 2-6 to pass pa
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 creating 6-6 defining parameters for 4-40 executing 6-9 passing parameters to 2-6, 4-40 Compiler directives 6-1 Compiler/report writer defined 1-3 error and warning messages 2-10 Compiling and
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 ASSIGN command 2-7 description 2-6 example 2-9 PARAM command 2-8 QP command 2-9 CUM clause description 5-35 example 5-35 restrictions 5-36 syntax 5-35 Cumulative operations 3
Index default display format 5-23 obtaining the current date 5-67 Date keywords 5-23 DDL 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 description 5-19 examples 5-21 location 5-20 processing order 5-20 rules for use 5-19 syntax 5-19 Default column spacing 5-52 date display format 5-23 decorations 5-19 fill character 5-
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 scale factor 5-13 Dictionary described 1-3 identifying 4-12, 6-7 produced by DDL 1-3, 4-12, 6-7 record description of FIND file 4-15 DICTIONARY statement clearing the internal table
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 E Edit descriptors alphanumeric 5-10 altering the effect of 5-15 combined with modifiers 5-15 fixed format 5-11 integer 5-10 mask 5-12 nonrepeatable 5-14 optional plus 5-15 repeatable 5-14 scale factor 5-13 Edit files containing ENFORM queries 2-3 reading 6-18 storing source code
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 terms 1-2 ENFORM trap messages B-23 Entering commands and statements directly 2-2 indirectly 2-2 Entry-sequenced file 3-7 Environment information, displaying internal tab
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 Exiting ENFORM 2-2, 4-14, 6-10 interactive mode 2-2 noninteractive mode 2-2 the editor 6-8 Extent size, specifying primary 5-52 secondary 5-52 F Field blanking modifiers description 5-16 examples 5-16 syntax 5-16 Fi
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 Filling fields with blanks 3-27, 5-16, 5-49 FIND statement description 4-15 examples 4-16 file type of generated file 4-16 grouping and sorting target-records 4-17 input elements 4-19 output fields 4-17 statements and c
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 specifying in a statement AT END 4-3 AT START 4-6 FOOTING 4-24 LIST 4-32 SUBFOOTING 4-44 SUBTITLE 4-46 TITLE 4-48 syntax 5-39 with a by-item 5-39 with a target-item 5-39 within a print-list 5-39 Formatt
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 TIMESTAMP 5-67, 5-68 H HEADING clause description 5-40 examples 5-41 multiple
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 example 5-43 internal format types 5-43 syntax 5-43 Internal table clearing 4-7, 4-11, 4-13, 6-7 description 4-7 J JULIAN-DATE Conversion clause converting dates to internal format 5-44 description 5-44 di
Index L 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 compared to WHERE clause C-4 considerations 4-26 description 4-25 duration 4-26 link initiated by C-1 syntax 4-25 Linking relationships clearing 4-11, 4-13 combining C-5 one-directional C-2 two-directional C-1 Lin
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 Logical file assignments and a server query processor 2-6 defined 2-5 maximum 2-1 M Margin 5-51 Mask 5-12 Mask edit descriptor changing the special symbols
Index overflow character 5-16 symbol substitution 5-18 syntax 5-7 N 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 data base tables 3-11 Nesting ?SOURCE commands 6-18 arithmetic expressions 3-23 IF/THEN/ELSE expressions 3-28 logical expressions 3-26 New line character 5-51 NOHEAD clause description 5-46 ex
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 O Obtaining the current time or date 5-65 OPEN AS COPY OF description 4-39 syntax 4-39 OPEN statement description 4-39 syntax 4-39 Opened record description information 6-16 Opening record descriptions 4-39 Operators arithmetic 3-23 boolean 3-26 conditional 3-24 Option Variab
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 syntax 5-48 Optional plus edit descriptor description 5-15 syntax 5-15 OUT option and the current output listing file 2
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 TITLE statement 4-49, 5-70 P Page numbers 5-65 specifying new 5-39 Paginating a report 5-39
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 Performing arithmetic operations 3-23 Physical file associated with a record description 6-2 creating 6-6 Precision of arithmetic oper
Index Processing order of compound logical expressions 3-26 of decorations 5-19 of nested arithmetic expressions 3-23 Q 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 defined 1-2 in a compiled query file 2-3 stored in an EDIT file 2-3 Query compiler/report writer 1-3 Query processor defined 1-3 error messages 2-12 identifying with
Index R 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 for LIST statement 4-33 linking 4-25, 5-72 list of opened 6-17 output record of a FIND statement 4-15 removing from the internal table 4-7, 4
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 information within a report 5-4, 5-31 line numbers 5-65 page numbers 5-51, 5-65 preventing records from appearing i
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 literals 3-22 naming a section 6-15 naming user defined elements 3-6 numeric lit
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 syntax 4-42 Setting option variables 4-43 the left margin 5-51 the number of report lines 5-51 values of user elements 4-43 Sharing a server query processor 2-6 Size determining
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 specifying where query processor sorts 2-12 target-records 5-6, 5-33 Source code entering 2-2 in an edit file 6-8, 6-15, 6-18 SPACE clause description 5-58 specifying in a clause AFTER CHANGE 5-4 AT END
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 AT END 4-3 AT START 4-5 CLOSE 4-7 DECLARE 4-8 DELINK 4-11 DICTIONARY 4-12 duration of effect 3-5, 4-1 EXIT 4-14 FIND 4-15 FOOTING 4-23 LINK 4-25 LIST 4-31 O
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 SUBFOOTING clause description 5-59 examples 5-59 for current reports 5-60 spacing considerations 5-59 specifying field names within 5-59 syntax 5-59 SUBFOOTING statement cancelling 4-45 description 4-44 examples 4-44 overriding 4-45 rese
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 syntax 5-63 SUM 3-13 Summary records 4-20, 5-53 Summary report 4-35, 5-53 SUPPRESS clause description 5-64 example 5-64 syntax 5-64 Suppressing column head
Index T 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 SUBTITLE 4-47 TITLE 4-49 syntax 5-66 with a LIST target-item or by-item 5-66 with a print list 5-66 Tabbing to a report column 5-66 Tallying the instances of an element 3-14 Target aggregate described 3-16 example 3-16, 3-17 used in a
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 statements 3-5 the current ENFORM session 6-10 Terms of a WHERE clause C-3 Text Editor, accessing from ENFORM 6-8 Time changing the default display format all reports
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 and the width of element modified 5-71 description 5-71 syntax 5-71 Totaling a set of numbers 3-14 Transitive property of links C-5 Translating a date to internal format
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 user specified storage format 4-10 User variable as a target-item 3-30 assigning the result of an arithmetic operation 3-23 assignment syntax 3-30 declaring 4-10 d
Index V Value keywords 3-28 Variable See User variable, System variables, or Option variables Vertical spacing 5-55, 5-57, 5-66 W 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 syntax 5-72 WHERE Clause terms 4-28 WHERE clause terms C-3 to specify a link 5-72 !!!ERROR and *** WARNING messages B-3 ***FILE ERROR messages B-19 ***WARNING messages B-1 ?ASSIGN c
Index ?DICTIONARY command clearing internal tables 6-7 description 6-7 syntax 6-7 where the dictionary resides 6-7 ?EDIT command description 6-8 storing ENFORM programs 6-8 syntax 6-8 ?EXECUTE command description 6-9 syntax 6-9 ?EXIT command description 6-10 syntax 6-10 ?HELP command description 6-11 examples 6-11 syntax 6-11 ?OUT command description 6-13 syntax 6-13 ?OUT file 2-3, 6-13 ?RUN command description 6-14 restrictions 6-14 syntax 6-14 ?SECTION command description 6-15 naming a collection of sour
Index @BREAK-KEY and the BREAK key 2-4 description 5-49 resetting 4-42 setting 4-42 @CENTER-PAGE description 5-49 resetting 4-42 setting 4-42 @COPIES description 5-50 resetting 4-42 setting 4-42 @COST-TOLERANCE description 5-50 resetting 4-42 setting 4-42 @DATE 5-65 See also System variables @DATE-FORMAT description 5-50 resetting 4-42 setting 4-42 @DECIMAL description 5-50 resetting 4-42 setting 4-42 @DISPLAY-COUNT description 5-51 resetting 4-42 setting 4-42 @HEADING description 5-51 resetting 4-42 setti
Index @MARGIN description 5-51 resetting 4-42 setting 4-42 @NEWLINE description 5-51 resetting 4-42 setting 4-42 @NONPRINT-REPLACE 5-51 @OVERFLOW 5-52 @PAGENO 5-65 See also System variables @PAGES description 5-52 resetting 4-42 setting 4-42 @PRIMARY-EXTENT-SIZE description 5-52 resetting 4-42 setting 4-42 @READS description 5-52 resetting 4-42 setting 4-42 @SECONDARY-EXTENT-SIZE description 5-52 resetting 4-42 setting 4-42 @SPACE description 5-52 resetting 4-42 setting 4-42 @STATS Statistics description 5
Index @SUMMARY-ONLY and FIND files 4-20 and summary reports 4-20, 4-35 description 5-53 resetting 4-42 setting 4-42 @TARGET-RECORDS description 5-53 resetting 4-42 setting 4-42 @TIME 5-65 See also System variables @TIME-FORMAT description 5-53 resetting 4-42 setting 4-42 @UNDERLINE description 5-54 resetting 4-42 setting 4-42 @VSPACE description 5-54 resetting 4-42 setting 4-42 @WARN description 5-54 resetting 4-42 setting 4-42 @WIDTH description 5-54 resetting 4-42 setting 4-42 058057 Tandem Computers In