Data Management Library ENFORM User’s Guide ™ Abstract Part Number This guide provides a task-oriented view of ENFORM for both programmers and nonprogrammers.
Document History Edition Part Number Operating System Version Date First Edition Second Edition Update 1 Update 2 Third Edition 82349 A00 82349 B00 82195 82206 058058 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.
New and Changed Information This second update to the ENFORM User’s Guide adds the following information: ENFORM now issues an 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. The ENFORMRECEIVE procedure in the Host Language Interface returns error #13 if the DDL description and the physical file type do not match. A FORTRAN program that calls ENFORM through the Host Language Interface is included.
New and Changed Information iv 058058 Tandem Computers Incorporated
Contents Preface xiii Notation Conventions Section 1 xv Introduction Using ENFORM—Overview 1-1 ENFORM Processing Environment 1-3 The Dictionary 1-4 The Data Base 1-4 A Query Specification 1-4 The Query Compiler/Report Writer The Query Processor 1-5 Host Language Interface 1-6 ENFORM Server 1-7 ENFORM Terminology Section 2 1-5 1-8 Developing the Data Base What is a Data Base? 2-1 Fields 2-1 Records 2-1 Record Occurrences 2-2 Key Fields 2-3 Tasks Involved in Developing Your Data Base 2-3 Normalizin
Contents Section 3 Developing an ENFORM Query Establishing the Query Environment 3-2 Identifying the Dictionary 3-2 Identifying Record Descriptions 3-2 Assigning Record Descriptions to Different Physical Files Defining User Elements 3-6 Setting Option Variables 3-6 3-4 Connecting Record Descriptions to Form New Relationships 3-7 Making Session Wide Links 3-8 Using the LINK Statement 3-9 Using the LINK OPTIONAL Statement 3-10 Session-Wide Links and the WHERE Clause 3-12 Clearing Unnecessary Session-Wide
Contents Defining the Layout of the Report 3-49 Centering One Element or All Elements of a Report 3-50 Paginating a Report 3-51 Changing the Default Column Heading 3-51 Suppressing the Printing of a Column Heading 3-52 Suppressing the Printing of Both the Column Heading and the Element 3-52 Indicating a New Line 3-53 Changing the Default Spacing 3-53 Setting a Tab for a Report 3-54 Formatting the Appearance of Selected Information 3-54 Temporarily Changing the Default Display Format of an Element 3-55 Prin
Contents Improving Performance 5-5 Changing the Data (Disc) Environment 5-5 Remove Levels of Indexing in Key-Sequenced Files 5-6 Add or Remove Alternate Keys 5-7 Avoid Sorting an Already Sorted File 5-9 Specify Where ENFORM Builds Temporary Work Files 5-10 Spread Input/Output Demands Among Discs 5-10 Alter Cache Size 5-10 Control the Size of the Target File 5-10 Changing the Nondisc Environment 5-11 Process Placement 5-11 Share Query Processors 5-12 Reduce Network Traffic 5-12 Changing the Wording of the Q
Contents Section 7 ENFORM Servers Why Use ENFORM Servers 7-2 Writing ENFORM Servers 7-3 ENFORM Server and Query Processor Dialogue 7-3 Interprocess Communication 7-4 Message Protocol and Descriptions 7-6 Message Components 7-7 DDL Message Header Description 7-7 ENFORM Server and Query Processor Messages 7-8 INITIATE-INPUT-REQUEST Message 7-9 INITIATE-INPUT-REPLY Message 7-10 RECORD-INPUT-REQUEST Message 7-10 RECORD-INPUT-REPLY Message 7-12 TERMINATE-INPUT-REQUEST Message 7-14 TERMINATE-INPUT-REPLY Messa
Contents Appendix B Error Messages ENFORM Initialization Messages B-2 !!! Error and *** Warning Type Messages *** File Error Type Messages ENFORM Trap Messages BUILDMK Error Messages Appendix C B-19 B-23 B-23 Sample Data Base Sample Data Base Appendix D B-3 C-1 Example ENFORM Programs Example ENFORM Programs D-1 Appendix E Changing The Message Table Text How to Change the Message Table E-1 Guidelines for Creating a Message Table for the Current Session Guidelines For Replacing the Default Mess
Contents Figure 3-3. The Effect of an ?ASSIGN Command 3-5 Figure 3-4. The Process of Finding Matching Values Figure 3-5. Logical Records Built When a Matching Value is Missing Figure 3-6. Diagram of LINK OPTIONAL Where Region is Linked to Employee 3-11 Figure 3-7. Diagram of LINK OPTIONAL Where Employee is Linked to Region 3-12 Figure 3-8. Report Produced When Both LINK OPTIONAL and WHERE Clause Specified 3-14 Figure 3-9. ENFORM Query and Report 3-9 3-10 3-25 Figure 3-10.
Contents Figure 7-4. Message Format and DDL Description for the INITIATE-INPUT-REPLY Message 7-10 Figure 7-5. Message Format and DDL Description for the RECORD-INPUT-REQUEST Message 7-11 Figure 7-6. Message Format and DDL Description for the RECORD-INPUT-REPLY Message 7-13 Figure 7-7. Message Format and DDL Description for the TERMINATE-INPUT-REQUEST Message 7-14 Figure 7-8. Message Format and DDL Description for the TERMINATE-INPUT-REPLY Message 7-15 Figure C-1.
Preface This guide is one of three volumes that describe the ENFORM language. This guide provides a task-oriented approach to ENFORM use. It does not contain syntax details, with the exception of the syntax used for the host language interface. For other information about ENFORM and related products, refer to the publications listed below.
Preface xiv 058058 Tandem Computers Incorporated
Notation Conventions The following list summarizes the conventions for syntax presentation in this manual. For distinction, syntactical elements appear in a typeface different from that of ordinary text. Notation Meaning UPPERCASE LETTERS Uppercase letters represent keywords and reserved words; enter these items exactly as shown. 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.
1 Introduction ENFORM, a product that is part of the ENCOMPASS Distributed Data Base Management System, enables you to simply and efficiently: Retrieve data from a data base. Perform calculations (such as addition, subtraction, multiplication, and division) upon the retrieved data. Sort and group the retrieved data. Perform cumulative operations (such as counting, totaling, and averaging) upon the retrieved data. Format and print a report containing the retrieved data.
Introduction Using ENFORM—Overview Figure 1-1.
Introduction ENFORM Processing Environment The following paragraphs provide a brief overview of the tasks shown in Figure 1-1 (refer to Sections 2, 3, and 4 for detailed information). The tasks are organized into steps as follows: 1. Design the data base. This guide does not describe a process for data base design. Section 2 does, however, discuss some basic guidelines for developing or producing a data base to be used with ENFORM. 2. Use the Data Definition Language (DDL) to describe the data.
Introduction ENFORM Processing Environment Figure 1-2 shows the ENFORM processes and the required user-supplied components of the ENFORM processing environment. Figure 1-2. ENFORM Processing Environment Dictionary Query Specifications Query Compiler Report Writer Query Processor Data Base Report The Dictionary The dictionary is a collection of seven files that define the contents of a data base.
Introduction ENFORM Processing Environment The Query Compiler/Report Writer The query compiler/report writer has two functions or phases: (1) compiling the query and (2) formatting and writing a report. During the first phase, the query compiler checks the query specifications for syntactical correctness. If the query compiler detects errors at this time, query processing is stopped and a syntax error message is issued.
Introduction ENFORM Processing Environment After producing the target records, the query processor does one of the following: Returns the target records to the compiler/report writer if the query specifications contained a LIST statement. The query processor returns the target records as a unit in the target file if they required sorting or if more than one data base record was accessed.
Introduction ENFORM Processing Environment ENFORM Server Figure 1-4 shows the role of an ENFORM server (process file) in the ENFORM processing environment. Figure 1-4 .
Introduction ENFORM Terminology ENFORM Terminology This guide uses the following terms to discuss the ENFORM language and the output produced by ENFORM: Query specifications—the language elements (statements, clauses, commands, ...) that you specify to provide ENFORM with the information it needs to retrieve data and to establish the query environment. Query—one complete LIST or FIND statement. Both the LIST and the FIND statements specify the information to be retrieved.
2 Developing the Data Base ENFORM enables you to retrieve data from a data base. This section discusses some of the tasks involved in developing or producing a data base. It does not recommend a method of data base design. Data base design is a complex task, one that is beyond the scope of this guide. Before performing the tasks described in this section, it is important to understand the characteristics of the data that comprise a data base.
Developing the Data Base What is a Data Base? Record Occurrences A record occurrence contains the actual data which is retrieved by ENFORM. For example, consider Figure 2-2 which shows some record occurrences for both parts and odetail. Figure -2-2. Sample Record Occurrences Record Occurrences for Parts partname partnum inventory location price 212 System 192KB Core 7 J87 92000.00 244 System 192KB Semi 3 B78 87000.00 21 A21 22000.00 –100 X10 1500.
Developing the Data Base Tasks Involved in Developing Your Data Base Key Fields A key field is a field whose value an application can use to identify a specific record occurrence. Sometimes more than one field is needed to identify a record. When two or more contiguous fields are used to identify a record occurrence, the combined fields are called composite key fields. The two categories of key fields are primary key fields and alternate key fields.
Developing the Data Base Tasks Involved in Developing Your Data Base Normalizing the Data ENFORM (and most other applications that access the data base) will retrieve data most efficiently when record occurrences do not contain repeating groups. Remember, a repeating group is a field that stores more than one value. Use the process of normalization to remove the repeating groups from your data. Consider Figure 2-3 which shows the record occurrences of oldorder.
Developing the Data Base Tasks Involved in Developing Your Data Base Figure 2-4.
Developing the Data Base Tasks Involved in Developing Your Data Base Data Definition Language Use the Data Definition Language (DDL) to create and manage data descriptions. Using DDL allows you to describe the file, record, and data structures of a data base and to create the dictionary used by ENFORM to obtain information about your data base.
Developing the Data Base Tasks Involved in Developing Your Data Base Use the SEQUENCE IS clause for nonkey-sequenced files if the records are already sorted according to the value of a field. When the field is modified by a BY or ASCD clause, ENFORM reads the SEQUENCE IS clause and suppresses its own sort process thus reducing processing time. Specify the actual file type of the physical file (or files) associated with the record description. ENFORM obtains the file type from the dictionary.
Developing the Data Base Tasks Involved in Developing Your Data Base To produce dictionary reports, use an ENFORM source file that resides in the file $SYSTEM.SYSTEM.DDQUERYS. The ENFORM source file can be modified to produce reports tailored to answer specific questions. The ENFORM source file consists of twelve queries that produce twelve different reports. Each query is a separate section of the source file; therefore, the queries can be run either individually or in combination.
Developing the Data Base Tasks Involved in Developing Your Data Base Loading Data Base Files Choose a method of loading the data into the physical files. Use either an application program or the ENABLE subsystem. Using an application program is most advantageous when the data already exists in some machine readable form (such as on a disc file or a tape), but some data conversion operation must be performed before the data is loaded.
3 Developing an ENFORM Query The primary aim of entering a query is to retrieve the information you want from the data base. Depending on your needs, ENFORM provides the information in one of the following forms: as a report, as a new physical file, or as records transmitted to a host language program. This section discusses the steps needed to produce a report or a new physical file. (Refer to Section 6 for information about transmitting records to a host language program).
Developing an ENFORM Query Establishing the Query Environment Establishing the Query Establishing the query environment is the first step in developing a query. Table 3-1 Environment shows the ENFORM statements and commands that establish the query environment. If your dictionary resides on your current volume and subvolume, the OPEN statement is the only statement or command that is required.
Developing an ENFORM Query Establishing the Query Environment Figure 3-1. Effect of an OPEN Statement Dictionary parts record description odetail record description ••• :ENFORM >OPEN parts; Query Compiler Report Writer Internal table parts record description Note that the OPEN statement does not actually open the physical file in which the parts record occurrences are stored.
Developing an ENFORM Query Establishing the Query Environment The following OPEN AS COPY OF statement logically makes a duplicate copy of employ and names it empdup. Notice that the OPEN statement for the record description being duplicated must precede the OPEN AS COPY OF statement. OPEN employ; OPEN empdup AS COPY OF employ; LINK employ.mgr-id TO empdup.empl-no; Specification of the OPEN AS COPY OF and LINK statements allows the names of all employees and their managers to be listed.
Developing an ENFORM Query Establishing the Query Environment Figure 3-3. The Effect of an ?ASSIGN Command Dictionary :ENFORM >?ASSIGN parts TO test >OPEN parts; >LIST parts; RECORD parts. FILE IS $mkt.sample.parts ••• Query Compiler Report Writer Report Internal Table Assign: parts $mkt.sample.test Record Description: parts $mkt.sample.parts ••• Query Processor $mkt.sample.parts $mkt.sample.
Developing an ENFORM Query Establishing the Query Environment Defining User Elements Use the DECLARE statement to define any user elements to be used in the query. The DECLARE statement defines user variables, user tables, and user aggregates. The DECLARE statement also optionally establishes the internal format, the default display format, and the default heading of user variables or tables. When the DECLARE statement is issued, the query compiler stores the information specified in the internal table.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships For example, if you have a terminal that does not have a scrolling mechanism, you might want to control the number of lines of information that ENFORM displays on your terminal at any one time. To do this, set the value of the @DISPLAY-COUNT option variable to 24: SET @DISPLAY-COUNT TO 24; When you set @DISPLAY-COUNT to 24, ENFORM displays a maximum of 24 lines of information.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships The number of resulting target records is 3 million, the product of the number of record occurrences associated with a-rec and the number of record occurrences associated with b-rec. If your query returns an unexpectedly large number of target records, examine the links specified. Use the following guidelines for links: Link fields that belong to the same data category (either both numeric or both alphanumeric).
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Using the LINK Statement When you enter the LINK statement, ENFORM treats the linked record descriptions as one logical record description. ENFORM builds record occurrences for the new logical record description by selecting matching records from the data files associated with the linked record descriptions. Records match when both contain the same data value in their linking fields.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Figure 3-5.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships For example, consider the following: OPEN region,employee; LINK region.manager TO OPTIONAL employee.empnum; Figure 3-6 shows the record occurrences associated with both the region and the employee record descriptions. This figure also shows the logical record occurrences built for the LINK OPTIONAL statement. Notice that some of the logical record occurrences contain blanks for the fields from the employee records.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Figure 3-7.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Normally, ENFORM produces target records by evaluating all of the “terms” in the WHERE clause and selecting only those logical record occurrences that satisfy all the “terms.” If your query specifications contain both a WHERE clause and LINK OPTIONAL statements, ENFORM might not use every “term” in a converted WHERE clause to evaluate every given logical record occurrence.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships ENFORM builds the logical record occurrences from the record occurrences shown in Figure 3-8. ENFORM then produces the target records also shown in that figure. Figure 3-8.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships ENFORM converts the preceding WHERE clause into two “terms”: empnum < 100 AND > first term regname = "GERMANY" > second term Notice that ENFORM produces a target record from the logical record occurrence whose empnum value is 49.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Establishing Links for the Current Query You can establish a link that applies only to the current query by including a WHERE clause in either a LIST or FIND statement. If you want to establish a link with a WHERE clause, at least one of the terms of the WHERE clause must reference two record descriptions. (Refer to the ENFORM Reference Manual for an explanation of the terms of a WHERE clause).
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Report: Part Number -----212 244 1403 ... 7102 7301 PARTNAME -----------------SYSTEM 192KB CORE SYSTEM 192KB SEMI PROC 96KB SEMI CABINET LARGE POWER MODULE SUPPNUM ------1 1 1 ... 10 1 SUPPNAME --------TANDEM COMPUTERS TANDEM COMPUTERS TANDEM COMPUTERS ... STEELWORK INC TANDEM COMPUTERS Using a WHERE clause to link record descriptions with conditional operators other than EQUAL is also possible.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships You might specify a combination of links if you want to obtain information from the data files associated with more than two record descriptions. For example, suppose that you want to produce a report that lists the orders taken by your company, the price that your company can charge for each ordered part, and the price that your company must pay for each ordered part.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships If you need to see all of the data stored for a particular record description, you can specify that record description on the left side of a LINK OPTIONAL statement. For example, suppose that you want a report that lists all of the orders for your company, all the employees who took the orders, and the region to which those employees belong.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Since employee is optionally linked to region, the logical record occurrences built for the linked record descriptions contain all of the employee records. The WHERE clause tells ENFORM that you are interested only in those logical record occurrences that do not have data values in the fields that correspond to the region record descriptions.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships Since employee is linked optionally to both region and branch, the logical record occurrences built for the linked record descriptions contain all of the employee records. The SUPPRESS WHERE clause tells ENFORM that you are interested only in those logical record occurrences that do not have data values in the fields that correspond to the region and branch records.
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships A sketch of the links in the preceding query appears as: newpart component npart-1 The report produced is as follows: PART -------------------- MAIN COMPONENTS -------------------- 16 INCH WORK CENTER PORTABLE WORK TABLE VISE 3 AMP UNIVER MOTOR BAND SAW BAND SAW BLADE BRACES CASTERS MITRE GAUGE PORTABLE WORK BENCH ... 3 AMP UNIVER MOTOR BAND SAW BLADE ROUTER AND SHAPER GD BRACES CASTERS PORTABLE WORK TABLE ...
Developing an ENFORM Query Connecting Record Descriptions to Form New Relationships 2. Link the record descriptions and their copies. The first LINK OPTIONAL statement ensures that the name of a part appears in the report even if it has no components. The second LINK OPTIONAL statement ensures that the name of a main component appears in the report even if it has no secondary components. LINK LINK LINK LINK 3. newpart.p-no TO OPTIONAL component.part-no; component.compon-no TO OPTIONAL cp-1.
Developing an ENFORM Query Selecting Information Selecting Information The information selected for a report or a new physical file is called the target list. The target list defines the elements that appear in the target records produced by the query processor. Table 3-3 shows the statements that both identify the target list and tell ENFORM whether to produce a report or a new physical file. Table 3-3.
Developing an ENFORM Query Selecting Information Figure 3-9. ENFORM Query and Report ENFORM Query: OPEN parts, fromsup; DECLARE u-var INTERNAL F3.2; SET u-var TO 0.10; Establish Query Environment LIST parts.
Developing an ENFORM Query Selecting Information In Figure 3-9 the value of the user variable u-var remains constant for each target record. A user variable specified as part of a target list does not always maintain a constant value.
Developing an ENFORM Query Selecting Information Creating a New Physical File Use the FIND statement to select data base elements and store them in an unstructured disc file called a FIND file. A FIND file is useful as an intermediate file for a multi-step query (one in which a LIST statement subsequently retrieves the data stored in the FIND file). Before executing the FIND statement: Add a description of the record type to be created to the data dictionary. Establish the necessary query environment.
Developing an ENFORM Query Selecting Information Figure 3-10. DDL Record Description, ENFORM Query, and FIND File DDL Record Description: Record profit. file is "profit". 02 partnum 02 suppnum 02 partname 02 stock 02 new-prof 02 avg-stock end PIC 9(4). PIC 9(3). PIC X(18). PIC 9(4). PIC 999999V99. PIC 9(4). ENFORM Query: OPEN parts,fromsup,profit; DECLARE u-var INTERNAL F3.2; SET u-var TO 0.10; FIND profit ( parts.partnum, parts.partname, fromsup.
Developing an ENFORM Query Selecting Information Using a FIND file as an intermediate file is useful when your data base contains unnormalized data. For example, suppose the following record description describes record occurrences stored in your data base: RECORD alias. FILE IS "$mkt.sample.alias" RELATIVE. 02 name PIC X(20). 02 synonym PIC X(10) OCCURS 3 TIMES. END The OCCURS clause causes the data stored for this record description to be unnormalized. When subscripts (synonym [1], synonym [2],...
Developing an ENFORM Query Restricting Selected Information Restricting Selected Restrict the information selected for the report or the FIND file by using the WHERE Information clause. The WHERE clause allows you to define a condition or a set of conditions that a data base record must meet before it is selected to contribute to the output record.
Developing an ENFORM Query Sorting and Grouping Selected Information Sorting and Grouping Sorting the information selected for a report makes the report easier to read. Grouping Selected Information the sorted information improves the appearance of the report and more clearly defines important data. Sorting the information selected for a FIND file eliminates the need for sorting of the records when the FIND file is used in a subsequent query.
Developing an ENFORM Query Sorting and Grouping Selected Information If a BY or BY DESC clause is specified in a FIND statement, duplicate values are included in the FIND file. For instance, consider the query and the diagram of a FIND file shown in Figure 3-11. Figure 3-11. Sample ENFORM Query and FIND File Diagram ENFORM Query: OPEN odetail,orderup; FIND orderup (BY odetail.ordernum, odetail.
Developing an ENFORM Query Specifying Computations for a Report Specifying To prepare a complete report, arithmetic operations are often necessary. Besides Computations for a arithmetic expressions and aggregates (refer to the ENFORM Reference Manual for Report information about these language elements), ENFORM also provides clauses that allow you to: Calculate a total or subtotal value for numeric elements. Calculate a percentage value for numeric elements.
Developing an ENFORM Query Specifying Computations for a Report Write the SUBTOTAL clause after the element whose values are to be subtotaled. Unless you specifically indicate otherwise, ENFORM computes the subtotal over all the by-items in the report.
Developing an ENFORM Query Specifying Computations for a Report Report: ORDERNUM -------21 * ... Calculating a Total Part Number -----244 2001 2403 4103 ... QUANTITY -------1 2 2 2 -------7 ... Use the TOTAL clause to generate a grand total for the values of a numeric element.
Developing an ENFORM Query Specifying Computations for a Report Report: ORDERNUM -------21 25 Part Number ------ QUANTITY -------- PCT QUANTITY -------- 244 2001 2403 4103 244 5103 6301 6402 1 2 2 2 1 1 2 10 4.76 9.52 9.52 9.52 4.76 4.76 9.52 47.62 When the OVER ALL syntax is specified or assumed, ENFORM calculates percentage values by performing the following: 1. ENFORM adds all of the values of the element modified by the PCT clause together to obtain a total.
Developing an ENFORM Query Specifying Computations for a Report When the OVER syntax is specified, ENFORM calculates grouped percentage values by performing the following: 1. ENFORM adds together the grouped values of the element modified by the PCT clause to obtain a total grouped value. (Remember an element is grouped when a preceding element in the query is modified by a BY or BY DESC clause.
Developing an ENFORM Query Specifying Computations for a Report Report: Part Number ------ QUANTITY -------- 21 244 2001 2403 4103 1 2 2 2 25 244 5103 6301 6402 1 1 2 10 ORDERNUM -------- * * PCT QUANTITY -------4.76 9.52 9.52 9.52 -------33.32 4.76 4.76 9.52 47.62 -------66.66 --------------99.
Developing an ENFORM Query Formatting a Report The following query generates a running total for quantity within the by-item ordernum: OPEN odetail; LIST BY ordernum, partnum, quantity, quantity CUM OVER ordernum AS I7, WHERE ordernum LE 25; Report: ORDERNUM 21 25 Part Number QUANTITY CUM QUANTITY 244 2001 2403 4103 244 5103 6301 6402 1 2 2 2 1 1 2 10 1 3 5 7 1 2 4 14 Running total begins anew at each new order.
Developing an ENFORM Query Formatting a Report Vertical spacing ENFORM uses single spacing between report lines. Margins ENFORM prints the first column in line column 1. ENFORM determines the location of the right margin by calculating the total number of characters in each column plus the two spaces between each column. Line length ENFORM uses a maximum line length of 132 characters for a printer; it uses a maximum line length of 80 characters for a terminal.
Developing an ENFORM Query Formatting a Report Printing Information Within a Report Adding information such as titles, subtitles, and footings to a report improves the appearance of the report and provides documentation as to the time, date, and reason for the report. ENFORM provides statements and clauses that allow you to add information: At the beginning or end of a report. Within the body of a report. At the end of every report page. At the beginning of every report page.
Developing an ENFORM Query Formatting a Report Figure 3-12 shows where the information supplied by these statements and clauses prints in a report. Figure 3-12.
Developing an ENFORM Query Formatting a Report Figure 3-12.
Developing an ENFORM Query Formatting a Report The BEFORE or AFTER keywords of these clauses refer to the values printed, not to the location of the printed information: The BEFORE CHANGE clause obtains values to print from the last set of grouped values printed; that is, the last value of the element before the by-item value changes. The AFTER CHANGE clause obtains values to print from the next set of grouped values to be printed; that is, the first value of the element after the by-item value changes.
Developing an ENFORM Query Formatting a Report Printing Information at the Beginning or End of a Report Specify AT START or AT END to print one or more lines of user-defined information at the beginning (AT START) or at the end (AT END) of a report. The session-wide AT START statement prints information directly after the title (if any) on the first page of every report in the current ENFORM session unless cancelled, reset, or overridden.
Developing an ENFORM Query Formatting a Report Printing Information at the Bottom of Every Report Page Use either SUBFOOTING or FOOTING to specify printing of information at the bottom of each page of a report. If both are specified, the information specified for FOOTING is printed below the information specified for SUBFOOTING. The FOOTING and SUBFOOTING statements are session wide; they apply to all reports generated during the current ENFORM session unless they are cancelled, reset, or overridden.
Developing an ENFORM Query Formatting a Report Printing Information at the Top of Each Report Page Use the SUBTITLE and TITLE statements or clauses to specify printing of one or more text lines at the top of each report page. The difference between SUBTITLE and TITLE is that the user-supplied text specified in a TITLE statement or clause prints before the user-supplied text specified in a SUBTITLE statement or clause.
Developing an ENFORM Query Formatting a Report Report generated by the first LIST statement: Daily Inventory Report for 05/24/82 Location L98 only Part Number -----5103 PARTNAME ------------------ INVENTORY --------- MAG TAPE DR 8/16 8 Report generated by the second LIST statement: *** CONFIDENTIAL REPORT *** Regional Salary Report as of 05/24/82 For Region 1 3–48 REGNUM ------ BRANCHNUM --------- SALARY -------------- 1 2 37,000.00 30,000.
Developing an ENFORM Query Formatting a Report Defining the Layout of the Report Defining the layout of the report improves its appearance and readability. ENFORM provides clauses that allow you to: Center one or all of the elements within the report. Paginate the report. Change the default column headings of the report. Suppress the printing of a column heading within the report. Suppress the printing of both the column heading and an element within the report. Tell ENFORM to begin a new report line.
Developing an ENFORM Query Formatting a Report Centering One Element or All Elements of a Report Use the CENTER clause to center either an element under its column heading or a column heading over the associated element. The object centered depends on which is longer: the element or the heading. Specify the CENTER clause after the element you want centered.
Developing an ENFORM Query Formatting a Report Paginating a Report Use the FORM clause to determine report pagination. The FORM clause can either modify a by-item or stand alone as a target list element. When a digit is included with a FORM clause modifying a by-item, ENFORM generates a page break if the number of lines indicated by the digit is not available when the new by-item begins. A page break is not generated from each by-item change.
Developing an ENFORM Query Formatting a Report Report: ORDER NUMBER ------ SALESMAN -------- 21 25 30 205 212 222 Suppressing the Printing of a Column Heading Use the NOHEAD clause to suppress the printing of a column heading. Suppressing a column heading is useful when you want to fold a line into two lines.
Developing an ENFORM Query Formatting a Report Report: EMPNUM ------ EMPNAME ------------------ 1 32 23 ... ROGER GREEN THOMAS RUDLOFF JERRY HOWARD ... JOB ---------------MANAGER MANAGER MANAGER ... Indicating a New Line Use the SKIP clause to specify that the elements following the SKIP clause are to be printed on a new line. If a digit is included as part of the SKIP clause, ENFORM skips the number of lines indicated by the digit before printing the elements.
Developing an ENFORM Query Formatting a Report Report: CUSTNUM ------- CUSTNAME ------------------ CITY -------------- 21 123 143 324 543 CENTRAL UNIVERSITY BROWN MEDICAL CO STEVENS SUPPLY PREMIER INSURANCE FRESNO STATE BANK PHILADELPHIA SAN FRANCISCO DENVER LUBBOCK FRESNO Setting a Tab for a Report Use the TAB clause to define where the next element is to be printed in a report line. The default column spacing resumes after the element is printed.
Developing an ENFORM Query Formatting a Report Temporarily Changing the Default Display Format of an Element Use the AS clause to temporarily override the default display format (described earlier in this section) used for printing the value of an element. Within the AS clause, indicate the new display format by specifying edit descriptors, modifiers, and decorations. Edit descriptors specify the display format as alphanumeric, fixed, or integer.
Developing an ENFORM Query Formatting a Report Decorations specify a character string that can be added to a column on the report, the conditions under which the string is to be added, the location of the string, and whether it is to be added either before or after the other formatting is done.
Developing an ENFORM Query Formatting a Report To print a date that is not stored in internal format, use the AS DATE clause to modify the JULIAN-DATE clause: OPEN order; LIST ordernum, JULIAN-DATE(oyear,omonth,oday) AS DATE *; Report: ORDERNUM -------21 25 ... 01/10/78 01/23/78 ... Temporarily change the display format used for a date by using the AS DATE clause.
Developing an ENFORM Query Formatting a Report Printing a Time Value on a Report Use the AS TIME clause to specify printing of a time value in internal format on a report. The AS TIME clause prints the time value by using the default time format or a user-created time format. Use the AS TIME clause to modify the system variable @TIME which returns the current time.
Developing an ENFORM Query Using the Help Command Using the ?HELP ENFORM displays the syntax of statements, clauses, and commands when you enter Command the ?HELP command. Using the ?HELP command is particularly useful during an interactive session when you want to refresh your memory about how to specify a particular ENFORM language element. To use the ?HELP command, simply enter “?HELP”. ENFORM responds by displaying a list of the elements for which help is available.
4 Compiling and Executing a Query Before returning the information you want, ENFORM must compile and execute your query. ENFORM compiles and executes a query during a session (the period of time that begins when you enter the ENFORM command and ends when ENFORM terminates). During a session, you can use ENFORM either in noninteractive mode or in interactive mode. The following paragraphs describe the use of ENFORM in both noninteractive and interactive mode.
Compiling and Executing a Query Using ENFORM in Noninteractive Mode Figure 4-1 shows a sample of the output produced when ENFORM is used in noninteractive mode. Figure 4-1. ENFORM in Noninteractive Mode ENFORM - T9102C09 - (02APR82) DATE - TIME : SOURCE FILE NAME IS $MKT.SAMPLE.TEST1 1 2 3 4 Employee Number -------- * * * * 8/17/82 - 15:31:32 ?SOURCE addfile1 SET @display-count to 24; OPEN employee; LIST empnum, empname, job; EMPNAME ------------------ JOB ------------ 1 23 29 ...
Compiling and Executing a Query Using ENFORM in Interactive Mode If you specify the name of a compiled query file for the IN option of the ENFORM command, ENFORM executes all the statements and clauses in the compiled query file and any ?ASSIGN, ?DICTIONARY, or ?EXIT commands. Using a compiled query file as the input file is particularly useful because you can pass a parameter value to a compiled query file. For example, suppose you frequently issue the same query for different branches of your business.
Compiling and Executing a Query Using ENFORM in Interactive Mode Entering Source Code Directly Enter source code directly by typing ENFORM statements, clauses, and commands in response to the ENFORM prompt. End each statement with a semicolon so that ENFORM displays any error occurring during statement execution immediately. ENFORM compiles and executes your program as soon as it encounters the terminating semicolon of a LIST or FIND statement. For example, consider Figure 4-2. Figure 4-2.
Compiling and Executing a Query Using ENFORM in Interactive Mode Entering Source Code Indirectly Enter source code indirectly by first placing it on an Edit file. Place any query that is longer than three or four lines or that is issued repeatedly on an Edit file. Enter the Tandem Text Editor from the ENFORM subsystem by using the ?EDIT command. For example: :ENFORM ENFORM - T9102C09 - (02APR82) DATE - TIME: 5/26/82 - 13:45:09 >?EDIT test1 TEXT EDITOR - T9601C08 - (01APR82) CURRENT FILE IS $DATA.TEST.
Compiling and Executing a Query Using ENFORM in Interactive Mode Use the ?RUN command to compile and execute the source code contained on the Edit file. For example: :ENFORM ENFORM - T9102C09 - (02AOR82) DATE - TIME: 5/26/82 - 13:50:23 >?EDIT test3 TEXT EDITOR - T9601C08 - (01APR82) CURRENT FILE IS $DATA.TEST.TEST3 *ADD 1 1 OPEN parts; ... * EXIT >?RUN ... Notice that including an Edit file name with the ?RUN command is not necessary because the ?EDIT command sets the default Edit file.
Compiling and Executing a Query Using ENFORM in Interactive Mode If you frequently use the same statements and commands, place them in an Edit file and use the ?SOURCE command to read them into your ENFORM programs. For example: :ENFORM ENFORM - T9102C08 - (01DEC81) DATE - TIME: 5/26/82 - 13:52:45 >?EDIT test5 TEXT EDITOR - T9601C08 - (01APR82) CURRENT FILE IS $DATA.TEST.
Compiling and Executing a Query Using ENFORM in Interactive Mode You can pass a value to a parameter in a compiled query file when you are using ENFORM in interactive mode. To pass a parameter value, issue the Command Interpreter PARAM command before entering the ENFORM command. For example: :PARAM rptnum 3 :ENFORM ENFORM - T9102C09 - (02APR82) DATE - TIME: 5/26/82 - 13:59:05 You can then use the ?EXECUTE command to execute the stored compiled query file.
5 Using ENFORM Efficiently After you develop a successful ENFORM query, consider optimizing the efficiency of the query. This section provides information about using the ENFORM statistics to examine the efficiency of your query and about changes that you can make to improve query performance. Using ENFORM Search When you set the Option Variable @STATS to ON, ENFORM produces search Statistics statistics.
Using ENFORM Efficiently Using ENFORM Search Statistics Figure 5-2 shows sample search statistics where both $mkt.sample.region and $mkt.sample.employee indicate LEVEL READ as 1. Figure 5-2. Search Statistics Where LEVEL READ = 1 SET @STATS TO ON; OPEN region,employee; LINK region TO employee VIA regnum; LIST BY regname,empname; FILE NAME LEVEL READ $mkt.sample.region 1 $mkt.sample.
Using ENFORM Efficiently Using ENFORM Search Statistics The RECORDS READ Column The third column, headed RECORDS READ, provides a number that indicates the number of records that the query processor read in each physical file. The number indicates logical reads. Logical reads (as opposed to physical reads) count the requests for records but ignore reads of alternate key data files and index blocks. Logical reads also ignore the effect of buffering, which might reduce physical reads.
Using ENFORM Efficiently Using ENFORM Search Statistics The STRATEGY COST Line The final line of the statistics contains the value of STRATEGY COST. Possible values of STRATEGY COST for successfully executed queries range from 1 to 8. In Figure 5-1, the strategy cost is 2. The significance of the strategy cost values is as follows: STRATEGY COST = 1 The query processor used keyed access on all files.
Using ENFORM Efficiently Improving Performance STRATEGY COST = 7 The query processor might have to sort two files more than once for a link. A strategy cost of 7 might occur when: A query involves at least three files. The query processor uses a join strategy on the last two files read. The query contains a request qualification that compares fields from both of the files involved in the join strategy with fields from a nonjoin file. The query processor must sort both files involved in the join strategy.
Using ENFORM Efficiently Improving Performance Remove Levels of Indexing in Key-Sequenced Files Reducing levels of indexing in key-sequenced files decreases the number of disc inputoutput (i/o) operations needed. Note that any alternate key file is a key-sequenced file. To remove levels of indexing, increase the index block size (allowing enough slack for anticipated growth) and reload the data.
Using ENFORM Efficiently Improving Performance Figure 5-4 shows the same key-sequenced file after the block size is increased to 4096 bytes. Figure 5-4. Key-Sequenced File with Increased Block Size Alternate Key File Level 1 Index Block Data File Level 1 Index Block Alternate Key File Data Blocks Data File Level 2 Index Blocks Data File Data Blocks Increasing the block size eliminates one index block for both the alternate key file and the data file.
Using ENFORM Efficiently Improving Performance Note that the addition or removal of alternate keys affects other transactions that access the physical file. For example, PATHWAY often uses alternate keys to access a tiny subset of the data base. Thus, removal of an alternate key might improve the performance of ENFORM but have a disastrous effect on a PATHWAY application. Consider the cost of record insertions as a consequence of adding alternate keys.
Using ENFORM Efficiently Improving Performance Removing Alternate Keys. To observe the effect of removing an alternate key that is used to select a large subset of records, assume that $mkt.sample.employee has an alternate key field called job, and the alternate key file: Stores one hundred records (one for each data record). Has ten data blocks each with ten records. Has one index block. Assume also that seventy records in $mkt.sample.employee contain the value SALESMAN for the job field.
Using ENFORM Efficiently Improving Performance Specify Where ENFORM Builds Temporary Work Files During an ENFORM session the query processor and the SORT process build temporary work files while processing a FIND or LIST statement. Use generic files to specify where these temporary files are built. Directing the query processor temporary work files to a scratch disc is particularly useful. For example: :ASSIGN QUERY-WORK-AREA, $SLOW Place temporary files built by the SORT process on less used volumes.
Using ENFORM Efficiently Improving Performance By default, the approximate extent sizes are determined as follows: For the primary extent size of the target file, ENFORM uses whichever is larger: the size (in bytes) of the largest input file divided by 2048 the largest primary extent size of all the input files.
Using ENFORM Efficiently Improving Performance Share Query Processors To reduce the number of processes competing for a system, create one or more shareable server query processors. The major advantages of a shareable server query processor are: Generally fewer processes exist within the system which results in reduced use of system resources such as memory paging and disc arm movement.
Using ENFORM Efficiently Improving Performance Some changes to query wording that might reduce physical file accesses are: Reduce the number of records selected by adding request qualifications (a WHERE clause) to the query. Experiment by changing the way field names are qualified in a WHERE clause. Determine if queries can share FIND files. Add a WHERE Clause Take advantage of information that is known to you but not known to the query processor and add a WHERE clause to your query.
Using ENFORM Efficiently Improving Performance Determine if FIND Files Can Be Shared Analyze the queries made to determine whether they are sufficiently similar to share the same FIND (intermediate) files. Sharing FIND files improves performance because the query processor must select the data used for many reports only once.
6 Host Language Interface The ENFORM interface procedures provide you with the ability to use a host programming language as a high-level access facility to a relational data base. The ENFORM interface procedures communicate with the query processor. By interfacing with ENFORM through the host programming language input/output interfaces, a host language program retrieves records at a fraction of the programming effort required by direct access.
Host Language Interface Figure 6-1. ENFORM Interface with Host Program 1 DDL Commands DDL Compiler Dictionary 2 Dictionary One ENFORM FIND Statement ENFORM Compiler/Report Writer Compiled Query 3 Compiled Query TAL, COBOL, or FORTRAN Process ENFORM Query Processor Data Base The host language interface works as shown in (3) of Figure 6-1. In the host program you specify parameters and the name of the compiled query file to the query processor.
Host Language Interface Interface Procedures Interface Procedures A host language program interfaces with ENFORM by calling the three procedures: ENFORMSTART, ENFORMRECEIVE, and ENFORMFINISH. ENFORMSTART initiates the query processor, ENFORMRECEIVE provides records to the host program one at a time, and ENFORMFINISH terminates the query processor.
Host Language Interface Interface Procedures TAL: CALL ENFORMSTART ( ctlblock , compiled-physical-filename , buffer-length , error-number ,[ restart-flag ] ,[ param-list ] ,[ assign-list ] ,[ process-name ] ,[ cpu ] ,[ priority ] ,[ timeout ] ,[ reserved-for-expansion ]) ctlblock INT:ref, is an 18-word integer array control block which must be supplied for global storage across the ENFORM procedure calls. This same storage is used in ENFORMRECEIVE and ENFORMFINISH, and any subsequent calls to ENFORMSTART.
Host Language Interface Interface Procedures restart-flag INT:value, is used when there is more than one query to be run by the host application program. A nonzero value causes the existing query processor to begin the next query with a new parameter and assign list, which is more economical than creating a new query processor for each query.
Host Language Interface Interface Procedures process-name INT:ref, is a four-word array that, if present, specifies the process name of a server query processor to use. If a query processor by that name does not exist, or if it cannot accept the query because the query processor is busy or the query exceeded its processing limits, an error results. If this parameter is omitted, a dedicated query processor for the query is created by ENFORMSTART and deleted by ENFORMFINISH.
Host Language Interface Interface Procedures mask-word INT:value, is a parameter that must be included when FORTRAN is used to call ENFORMSTART. Refer to the FORTRAN 77 Reference Manual for more information about this parameter. Condition code settings: < (CCL) means there is a problem. An error number representing the reason will be found in error-number. = (CCE) means the query processor has been successfully initialized.
Host Language Interface Interface Procedures ENFORMRECEIVE Procedure The ENFORMRECEIVE procedure provides records to the host application program, one at a time. The syntax of the ENFORMRECEIVE procedure is: COBOL: ENTER ENFORMRECEIVE USING ctlblock, buffer [ GIVING count ] FORTRAN: count = ENFORMRECEIVE ( ctlblock, buffer ) TAL: [ count := ] ENFORMRECEIVE ( ctlblock , buffer ) count returns a byte count for the length of the record retrieved (all FIND output records are the same length).
Host Language Interface Interface Procedures ENFORMRECEIVE Error Messages If an error occurs during the execution of the ENFORMRECEIVE Procedure, the number of the error is returned in error-number. Any of these error conditions terminate the ENFORM program. If the query processor is dedicated, it is deleted. Table 6-2 lists the error message for each of the possible error numbers. Error numbers with asterisks can have additional information returned for them in the buffer and are included in Table 6-3.
Host Language Interface Interface Procedures Table 6-3.
Host Language Interface Interface Procedures ENFORMFINISH Procedure ENFORMFINISH is called once to terminate the interface to ENFORM. The syntax of the ENFORMFINISH procedure is: COBOL: ENTER ENFORMFINISH USING ( ctlblock ) FORTRAN: CALL ENFORMFINISH ( ctlblock ) TAL: CALL ENFORMFINISH ( ctlblock ) ctlblock INT:ref, is the same 18-word integer array control block that was supplied to ENFORMSTART for global storage among all ENFORM procedure calls.
Host Language Interface Interface Procedures The ENFORM query shown in Figure 6-3 contains only one FIND statement. The host language program builds a PARAM message containing the region number. Refer to the GUARDIAN Operating System Programmer’s Guide for the Command Interpreter PARAM message format. Figure 6-3. Query Used to Pass Records to COBOL Program OPEN employee; OPEN branch; OPEN findfil; PARAM region-num; LINK branch.primkey TO employee.dept; FIND findfil (BY branch.regnum, BY branch.
Host Language Interface Interface Procedures Figure 6-4. COBOL Host Language Program (Page 1 of 3) IDENTIFICATION DIVISION. PROGRAM-ID. ENFORM-TEST. AUTHOR. E. TESTER. INSTALLATION. DATE-WRITTEN. JUNE 1982. DATE-COMPILED. JUNE 1982. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. TANDEM/16. OBJECT-COMPUTER. TANDEM/16. DATA DIVISION. WORKING-STORAGE SECTION. 01 END-FLAG PIC 9 VALUE 0. 88 CLOSE-FROM-ENFORM VALUE 1. 01 NO-ENTRY PIC 9 VALUE 0. 88 MORE-RECORDS-NEEDED VALUE 0.
Host Language Interface Interface Procedures Figure 6-4. COBOL Host Language Program (Page 2 of 3) PERFORM A-INIT. *THIS PROGRAM CALLS ENFORMSTART MULTIPLE TIMES UNTIL "9999" *IS ENTERED. PERFORM B-TRANS UNTIL NO-MORE-RECORDS-NEEDED. PERFORM C-EOJ. STOP RUN. A-INIT. *A PARAM MESSAGE TO A PROCESS REQUIRES TWO LENGTH BYTES; ONE FOR *THE LENGTH OF THE PARAM NAME, AND ONE FOR THE LENGTH OF THE PARAM *VALUE. MOVE 10 TO TEMP-BINARY. MOVE TEMP-N2 TO LENGTH-NAME. MOVE 4 TO TEMP-BINARY.
Host Language Interface Interface Procedures Figure 6-4. COBOL Host Language Program (Page 3 of 3) ELSE IF DATA-COUNT EQUAL ZERO MOVE 1 TO END-FLAG ELSE DISPLAY RECEIVED-DATA. C-EOJ. DISPLAY "END OF RUN". MOVE 0 TO ERROR-NUMBER. ENTER "ENFORMFINISH" USING CTLBLOCK. IF ERROR-NUMBER NOT EQUAL ZERO DISPLAY "ENFORMFINISH ERROR: " ERROR-NUMBER. In the second example, there is a need to do something with customers’ orders for parts.
Host Language Interface Interface Procedures Figure 6-6. An ENFORM Query for Host Language Interface OPEN customer, !Given a customer name and an order, !order date, return one record odetail, !for each part ordered order-process; !containing the order number LINK customer TO order VIA custnum; !and the part number. LINK odetail TO order VIA ordernum; PARAM passed-custname INTERNAL A18; PARAM passed-orderdate INTERNAL A6; FIND order-process (odetail.ordernum, odetail.
Host Language Interface Interface Procedures The TAL host application program that interfaces with ENFORM and processes the desired records is shown in Figure 6-7. Figure 6-7. A TAL-Host Application Program Interfacing with ENFORM (Page 1 of 2) LITERAL true = -1, false = 0; !filenames INT .query^filename [0:11] := "$MKT !global variables INT .cntl^block [0:17], .
Host Language Interface Interface Procedures Figure 6-7. A TAL-Host Application Program Interfacing with ENFORM (Page 2 of 2) STRUCT .order^process^rec (order^process^def); !structure allocated here ?NOLIST ?SOURCE $system.system.extdecs (ENFORMSTART, ENFORMRECEIVE, ? ENFORMFINISH, STOP); ?LIST PROC get^params (param^message); INT .param^message; BEGIN !This procedure obtains the Command Interpreter PARAM !message of the form provided by the Command !Interpreter.
Host Language Interface Interface Procedures The final example finds data on employees whose age is less than 30. The following DDL description is added to the data dictionary to describe the record being passed. Figure 6-8. DDL Description of Record Passed to FORTRAN Program RECORD fortsrce. FILE IS "fortsrce" UNSTRUCTURED. 02 who. 03 empnum PIC "9999". 03 empname PIC "X(18)". 02 info. 03 job PIC "X(12". 03 age TYPE BINARY. END. The ENFORM query in Figure 6-9 creates a FIND file named “fortsrce”.
Host Language Interface Interface Procedures Figure 6-10. FORTRAN Host Language Program (Page 1 of 2) ?symbols IMPLICIT INTEGER INTEGER INTEGER*4 INTEGER INTEGER INTEGER C C C INTEGER(E) CONTROLBLOCK(36) COUNT COMPILEDQUERY(6) ERRORNUMBER MASK IX The BUF record holds data returned from the ENFORMRECEIVE procedure.
Host Language Interface Interface Procedures Figure 6-10. FORTRAN Host Language Program (Page 2 of 2) Run the query by calling ENFORMSTART. Note that the timeout parameter (continuation line A) must be passed as a double word. Otherwise, ENFORMSTART cannot find the parameters following timeout.
Host Language Interface Interface Procedures This is the output from the FORTRAN program. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 6–22 0075 0201 0203 0207 0209 0213 0214 0217 0224 0233 0234 0235 0321 TIM WALKER JIM HERMAN KATHRYN DAY MARK FOLEY SUSAN CHAPMAN ROBERT WHITE JULIA KELLY MARLENE BONNY MARIA JOSEF TED MCDONNALDS MARY MILLER MIRIAM KING BILL WINN 058058 Tandem Computers Incorporated MANAGER SALESMAN SECRETARY SALESMAN PROGRAMMER ENGINEER SECRETARY SYS.-ANAL.
7 ENFORM Servers This section describes how to write and use ENFORM servers — processes that can supply data to the query processor as an alternative to the data being supplied directly from a disc file (Figure 7-1). ENFORM servers extend ENFORM’s query capability by enabling you to use data that might otherwise be unusable by the query processor. Figure 7-1.
ENFORM Servers Why Use ENFORM Servers Why Use ENFORM The following is a list of the types of data that create problems in query processing and Servers the solution to the problems using ENFORM servers: Non-Relational Data Non-relational data refers to files containing data that is not normalized and, therefore, cannot be processed by ENFORM.
ENFORM Servers Writing ENFORM Servers Edit Files An ENFORM server can be written to read data from an edit file and send the data to the query processor. MUMPS MUMPS data stored in variable-length records cannot be directly processed by ENFORM. An ENFORM server can be written to read the variable-length records, restructure the data into fixed-field records, and then send the records to the query processor to be used with other data.
ENFORM Servers Writing ENFORM Servers The preceding dialogue takes place within an ENFORM server session. A session is one query execution or the period of time an ENFORM server is held open by a server query processor. (The ENFORM server can be designated as a file to be held open when the server query processor is started.) An ENFORM server that is held open by a server query processor can be read many times for one request or many requests.
ENFORM Servers Writing ENFORM Servers Table 7-1. ENFORM Server Session Message Transfer Server Condition Not Created User Process CI Call Startup NEWPROCESS RUN RNFORM Server Created Receives startup message. Dormant Waits for an OPEN. ENFORM Server Opened Schecs for message on $RECEIVE. Server Session Begins OPEN QP Server Application Code Begins QP QP QP INITIATE-INPUT-REQUEST INITIATE-INPUT-REPLY ENFORM Server Initializing QP identifies a server. Server reads request and replies.
ENFORM Servers Writing ENFORM Servers Message Protocol and Descriptions The dialogue between processes is structured by a protocol that includes a startup message, an OPEN message, request and reply messages, and a CLOSE message. The messages transferred between processes to create, use, and terminate an ENFORM server are described below in the sequence of the protocol. Startup Message—The Command Interpreter startup message is sent to a process (an ENFORM server) when the process is successfully created.
ENFORM Servers Writing ENFORM Servers Message Components The messages to and from the query processor and an ENFORM server consist of two components, a message header and the message data. The message header is a fixed length for all messages. The message data is a fixed length for all messages except RECORD-INPUT-REQUEST and RECORD-INPUT-REPLY; the lengths are determined during initialization. DDL Message Header Description The following DDL definition shows the message header format. DEF pw-header-def.
ENFORM Servers Writing ENFORM Servers The message header is used to pass the following information between the query processor and an ENFORM server: Reply code—0 indicates successful operation and 1 indicates an error. Application code—S1 indicates simple sequential file simulation. Note The application code, S1, identifies the message formats and protocol for the query processor and ENFORM server communication.
ENFORM Servers Writing ENFORM Servers INITIATE-INPUT-REQUEST Message The query processor sends this message to an ENFORM server before a request or set of requests for data. The message format and DDL description for the INITIATEINPUT-REQUEST message are shown in Figure 7-3. Figure 7-3.
ENFORM Servers Writing ENFORM Servers INITIATE-INPUT-REPLY Message The ENFORM server returns this message to the query processor after reading an INITIATE-INPUT-REQUEST message. The message format and DDL description for the INITIATE-INPUT-REPLY message are shown in Figure 7-4. Figure 7-4.
ENFORM Servers Writing ENFORM Servers Figure 7-5. Message Format and DDL Description for the RECORD-INPUT-REQUEST Message 0: REPLY-CODE 1: APPLICATION-CODE 2: FUNCTION-CODE 3: TRANS-CODE 4-11: 12: HEADER TERM-ID,LOG-REQUEST (unused) ERROR-CODE 13-24: FILE-NAME 25: FILE-ERROR 26-27: POSITION-CODE 28: ACTUAL-DATA-BZ 29: DATA-RECORD-BZ 30-?: DATA-RECORD ?-?: CONTROL-BLOCK (optional) DEF record-input-request-def . 05 ENFORM-server-header-def TYPE * . 05 position-code PIC X(4) .
ENFORM Servers Writing ENFORM Servers The RECORD-INPUT-REQUEST message is bound by the following word size restrictions: MAX-MSG-WZ 4096 words This is maximum size for RECORD- INPUT-REQUEST and RECORD-INPUT-REPLY messages. MAX-DATA-WZ 2048 words This is the maximum key-sequenced ENSCRIBE record size. MAX-MSG-HEADER-WZ 26 words This is ENFORM header word size. MAX-CB-WZ- (4096-2048-26-4 ) = 2018 words This is the maximum user control block size.
ENFORM Servers Writing ENFORM Servers Figure 7-6. Message Format and DDL Description for the RECORD-INPUT-REPLY Message 0: REPLY-CODE 1: APPLICATION-CODE 2: FUNCTION-CODE 3: TRANS-CODE 4-11: 12: HEADER TERM-ID,LOG-REQUEST (unused) ERROR-CODE 13-24: FILE-NAME 25: FILE-ERROR 26-27: POSITION-CODE 28: ACTUAL-DATA-BZ 29: DATA-RECORD-BZ 30-?: DATA-RECORD ?-?: CONTROL-BLOCK (optional) DEF record-input-reply-def . 05 ENFORM-server-header-def TYPE * . 05 position-code PIC X(4) .
ENFORM Servers Writing ENFORM Servers The RECORD-INPUT-REPLY message is bound by the following word size restrictions: MAX-MSG-WZ 4096 words This is maximum size for RECORD-INPUT-REQUEST and RECORD-INPUT-REPLY messages. MAX-DATA-WZ 2048 words This is the maximum key-sequenced ENSCRIBE record size. MAX-MSG-HEADER-WZ 26 words This is ENFORM header word size. MAX-CB-WZ (4096-2048-26-4 ) = 2018 words This is the maximum user control block size.
ENFORM Servers Writing ENFORM Servers TERMINATE-INPUT-REPLY Message The ENFORM server returns this message to the query processor after reading a TERMINATE-INPUT-REQUEST message. The message format and DDL description for the TERMINATE-INPUT-REPLY message are shown in Figure 7-8. Figure 7-8.
ENFORM Servers Using an ENFORM Server It might be necessary for the query processor to read a file more than once; for example, to process a LINK statement or when a NonStop query processor restarts a query. In this case, the ENFORM server must be able to send the query processor the first record, more than once, at any point during a series of request messages. An ENFORM server session consists of one query execution or the period of time an ENFORM server is held open by an active server query processor.
ENFORM Servers Using an ENFORM Server Performance Considerations 3. A primary key or record key has no meaning for an ENFORM server. Using references such as KEY OF employee ... or employee.KEY is not allowed for records from an ENFORM server. Referring to a key in an ENFORM server file causes the query processor to issue an error message (Error 58). 4.
ENFORM Servers Using an ENFORM Server ENFORM Server Context ENFORM servers can be written as context-free or context-sensitive servers. The optional control block in the message format can be used to store context information. A data record received by the query processor in a request is returned in the next request and is available to the ENFORM server, as is the optional control block data. A control block contains all zeros the first time it is passed in a message to an ENFORM server.
ENFORM Servers Using an ENFORM Server The server does not check that each query processor sends messages in the correct sequence which is an initiate request, a record request, and then a terminate request. IDENTIFICATION DIVISION. PROGRAM-ID. ENFSERV. AUTHOR. ANON. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. TANDEM T/16. OBJECT-COMPUTER. TANDEM T/16. INPUT-OUTPUT SECTION. FILE-CONTROL.
ENFORM Servers Using an ENFORM Server FD MESSAGE-IN LABEL RECORDS ARE OMITTED RECORD CONTAINS 52 TO 78 CHARACTERS. 01 MSG-INIT * Record INITIATE-INPUT-REQUEST created on 03/05/82 05 INITIATE-INPUT-REQUEST. 10 INITIATE-INPUT-REQUEST-DEF. 15 ENFORM-SERVER-HEADER-DEF. 20 PW-HEADER-DEF. 25 REPLY-CODE PIC S9(4) 25 APPLICATION-CODE PIC XX. 25 FUNCTION-CODE PIC XX. 25 TRANS-CODE PIC XX. 88 INIT-INPUT Value is "SR". 88 RECORD-INPUT Value is "RR". 88 TERMINATE-INPUT Value is "TR". 25 TERM-ID PIC X(15).
ENFORM Servers Using an ENFORM Server 01 MSG-RCD . * Record RECORD-INPUT-REQUEST created on 03/05/82 at 09:44 05 RECORD-INPUT-REQUEST. 10 RECORD-INPUT-REQUEST-DEF. 15 ENFORM-SERVER-HEADER-DEF. 20 PW-HEADER-DEF. 25 REPLY-CODE PIC S9(4) COMP. 25 APPLICATION-CODE PIC XX. 25 FUNCTION-CODE PIC XX. 25 TRANS-CODE PIC XX. 88 INIT-INPUT Value is "SR". 88 RECORD-INPUT Value is "RR". 88 TERMINATE-INPUT Value is "TR". 25 TERM-ID PIC X(15). 25 LOG-REQUEST PIC X. 20 ENFORM-ERROR-HEADER-DEF. 25 ERROR-CODE PIC S9(4) COMP.
ENFORM Servers Using an ENFORM Server 01 MSG-END . * Record TERMINATE-INPUT-REQUEST created on 03/05/82 at 09:44 05 TERMINATE-INPUT-REQUEST. 10 TERMINATE-INPUT-REQUEST-DEF. 15 ENFORM-SERVER-HEADER-DEF. 20 PW-HEADER-DEF. 25 REPLY-CODE PIC S9(4) COMP. 25 APPLICATION-CODE PIC XX. 25 FUNCTION-CODE PIC XX. 25 TRANS-CODE PIC XX. 88 INIT-INPUT Value is "SR". 88 RECORD-INPUT Value is "RR". 88 TERMINATE-INPUT Value is "TR". 25 TERM-ID PIC X(15). 25 LOG-REQUEST PIC X. 20 ENFORM-ERROR-HEADER-DEF.
ENFORM Servers Using an ENFORM Server 01 REPLY-RCD * Record RECORD-INPUT-REPLY created on 03/05/82 at 05 RECORD-INPUT-REPLY. 10 RECORD-INPUT-REPLY-DEF. 15 ENFORM-SERVER-HEADER-DEF. 20 PW-HEADER-DEF. 25 REPLY-CODE PIC S9(4) 25 APPLICATION-CODE PIC XX. 25 FUNCTION-CODE PIC XX. 25 TRANS-CODE PIC XX. 88 INIT-INPUT Value is "SR". 88 RECORD-INPUT Value is "RR". 88 TERMINATE-INPUT Value is "TR". 25 TERM-ID PIC X(15). 25 LOG-REQUEST PIC X. 20 ENFORM-ERROR-HEADER-DEF.
ENFORM Servers Using an ENFORM Server 01 REPLY-END . * Record TERMINATE-INPUT-REPLY created on 03/05/82 at 09:44 05 TERMINATE-INPUT-REPLY. 10 TERMINATE-INPUT-REPLY-DEF. 15 ENFORM-SERVER-HEADER-DEF. 20 PW-HEADER-DEF. 25 REPLY-CODE PIC S9(4) COMP. 25 APPLICATION-CODE PIC XX. 25 FUNCTION-CODE PIC XX. 25 TRANS-CODE PIC XX. 88 INIT-INPUT Value is "SR". 88 RECORD-INPUT Value is "RR". 88 TERMINATE-INPUT Value is "TR". 25 TERM-ID PIC X(15). 25 LOG-REQUEST PIC X. 20 ENFORM-ERROR-HEADER-DEF.
ENFORM Servers Using an ENFORM Server 01 05 FILE-DATA. 05 ERR-INDEX PIC S9(4) COMP. 05 FILE-ERROR-NO PIC S9(4) COMP. 88 END-OF-FILE VALUE 1. 88 FILE-IS-BAD VALUE 59. 88 INVALID-KEY VALUE 46. 88 DUPLICATE-KEY VALUE 10. 88 NO-EXISTING-RECORD VALUE 11. 88 FILE-IS-FULL VALUE 45. 05 RECEIVE-FILE-STATUS. 10 STAT-1 PIC 9. 88 CLOSE-FROM-REQUESTOR VALUE 1 THRU 3. 10 STAT-2 PIC 9. 05 FILE-STAT. 10 STAT-KEY1 PIC 9. 88 NO-ERROR VALUE 0. 88 FILE-ERROR VALUES ARE 1 THRU 3. 10 STAT-KEY2 PIC 9. LOG-FILE-STATUS.
ENFORM Servers Using an ENFORM Server PROCEDURE DIVISION. DECLARATIVES. UA-PARTSUP-FILE SECTION. USE AFTER STANDARD ERROR PROCEDURE ON PARTSUP-FILE. UA-PARTSUP-FILE-PROC.
ENFORM Servers Using an ENFORM Server DISPLAY "$RECEIVE FILE ERROR STATUS = ", RECEIVE-FILE-STATUS. END DECLARATIVES. BEGIN-THE-PROGRAM. PERFORM START-YOUR-ENGINES. PERFORM READ-MAILBOX UNTIL CLOSE-FROM-REQUESTOR. PERFORM GARBAGE-COLLECTION. STOP RUN. START-YOUR-ENGINES. OPEN INPUT MESSAGE-IN. OPEN OUTPUT MESSAGE-OUT. OPEN INPUT PARTSUP-FILE EXCLUSIVE. GARBAGE-COLLECTION. CLOSE MESSAGE-IN. CLOSE MESSAGE-OUT. CLOSE PARTSUP-FILE. READ-MAILBOX.
ENFORM Servers Using an ENFORM Server TRANS-CODE-SR. *======================================================= * Initialize the header of the reply buffer. * The max number of records in the file = 100. * The size (in words) of the control block is 1. * Write the init reply. *======================================================= MOVE ENFORM-SERVER-HEADER-DEF OF MSG-INIT TO ENFORM-SERVER-HEADER-DEF OF REPLY-INIT. MOVE 100 TO MAX-RECORDS-IN-FILE OF REPLY-INIT. MOVE 1 TO CONTROL-BLOCK-WZ.
ENFORM Servers Using an ENFORM Server 1-PROCESS-REQUEST. *============================================================ * Based on the value of the position code in the message * buffer get the first (or the next) record to return to * the QP. *============================================================ IF FIRST-RCD OF MSG-RCD PERFORM 2-GET-FIRST-RECORD ELSE IF NEXT-RCD OF MSG-RCD PERFORM 2-GET-NEXT-RECORD ELSE PERFORM 9-INVALID-MSG. 2-GET-FIRST-RECORD.
ENFORM Servers Using an ENFORM Server 9-FORMAT-REPLY. *============================================================ * Return the part number, the supplier number, and the * part cost. Return the occurrence number of suppnum in * the control block Also, set the number of bytes actually * read to the number of bytes in the record. *============================================================ MOVE MOVE MOVE MOVE MOVE PARTNUM OF FROM-SUP TO PARTNUM OF REPLY-RCD. SUPPNUM OF SUP-DATA(I) TO SUPPNUM OF REPLY-RCD.
Appendix A Syntax Summary ENFORM syntax is summarized in this appendix. For specific details of syntax, refer to the language elements, statement, clause and command sections.
Syntax Summary Language Elements Logical Expression: [NOT] condition [NOT] condition˚...
Syntax Summary Statements 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 , ...
Syntax Summary Statements 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 058058 Tandem Computers Incorporated ,...; ,...
Syntax Summary Statements LIST [ UNIQUE ] BY by-item BY DESC by-item target-item ASCD target-item DESC target-item user-var-name := target-item CUM [ OVER ALL ] OVER by-item CUM PCT [ OVER ALL ] OVER by-item PCT TOTAL SUBTOTAL SUBTOTAL OVER by-item NOHEAD NOPRINT CENTER string-literal ‚... HEADING AS display-format display-format ASAS DATE TIME display-format ,... FORM [ n ] SKIP [ n ] [ / ] ‚...
Syntax Summary Statements PARAM { param-name [ INTERNAL internal-format ] }, ...[ ; ] ON SET OFF ,...
Syntax Summary Clauses Clauses AFTER CHANGE [ ON ] by-item PRINT print-list [ CENTER ] field-name { ASCD DESC } report-item report-item report-item AS [ nonrepeatable-edit-descriptors ] repeatable-edit-descriptors AS " "[" [ decorations‚... ] [ modifiers‚...] "]" repeatable-edit-descriptors " " "[" [ decorations‚... ] [ modifiers‚...] "]" ( nonrepeatable-edit-descriptors repeatable-edit-descriptors ) AS " report-item is either a by-item or an target-item.
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.
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.
Syntax Summary Clauses BEFORE CHANGE [ ON ] by-item PRINT print-list [ CENTER ] { BYBY DESC } field-name target-item { by-item }CENTER‚ CENTER ALL target-item FOOTING CUM ALL [ OVER OVER by-item ] print-list [ CENTER ] FORM [ number ] target-item { by-item } HEADING "heading-string" INTERNAL internal-format JULIAN-DATE ( year , month , day ) A–10 target-item { by-item }NOHEAD NOHEAD ALL 058058 Tandem Computers Incorporated
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 number
Syntax Summary Clauses SKIP [ number ] SPACE [ number ] SUBFOOTING print-list [ CENTER ] SUBTITLE print-list [ CENTER ] target-item SUBTOTAL by-item [ OVER OVER ALL ] SUPPRESS [ WHERE ] logical-expression A–12 058058 Tandem Computers Incorporated
Syntax Summary Clauses 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 058058 Tandem Computers Incorporated A–13
Syntax Summary Commands Commands ?ASSIGN record-name generic-file-name ‚ physical-filename TO ] {‚ 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, ...
Syntax Summary ENFORM Procedures ?SHOW OPEN LINK CONTROL LIMITS ASSIGN [ record-name ] user-variable-name record-name param-name ?SOURCE edit-filename [ ( section-name, ...
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 ( ctlb
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 (SERVER-related failure on name) Record-name.KEY or KEY OF record-name is not allowed when the data for recordname is from an ENFORM server (process file).
Error Messages !!! Error and *** Warning Type Messages !!! 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. Self-explanatory. !!! ERROR [67] Field type incompatibility Data types being compared must both be numeric or alphabetic. !!! ERROR [68] Illegal LINK field Misspelled qualified field name or attempted to use a subscripted field where not allowed.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [72] Invalid occurrence number Attempted to subscript past the end of a table. !!! ERROR [73] Too many or too few parameters Wrong number of parameters for JULIAN-DATE, TIMESTAMP-TIME, or TIMESTAMP-DATE clauses. !!! ERROR [74] Too many PARAM declarations Number of parameters for the current ENFORM session exceeds 32. Clear some with the CLOSE statement. !!! ERROR [75] Invalid occurrence specification.
Error Messages !!! Error and *** Warning Type Messages *** WARNING [80] Section name not found Misspelled or nonexistent section in the Edit file. !!! ERROR [81] The preceding text contains a syntactically incorrect element Check the preceding line. If ok, check the next few preceding lines. *** WARNING [82] Value is being truncated to one character The value for the Option Variable must be a single ASCII character.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [89] Too many expressions in target list A LIST or FIND statement contains too many Arithmetic Expression or Logical Expression clauses. !!! ERROR [90] All field names referenced in a qualification aggregate must belong to the same record All fields in the expression being aggregated, the over-item, and the embedded WHERE clause must belong to the same record. *** WARNING [91] No report will be listed.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [95] Missing dictionary Wrong subvolume or dictionary does not exist. !!! ERROR [96] Invalid dictionary subvolume name Internal error. !!! ERROR [98] Insufficient memory available to OPEN record description Internal error. !!! ERROR [99] Multiply defined SECTION name Section name may appear only once in a ?COMPILE, ?RUN, or ?SOURCE command.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [104] Output line would exceed buffer space. Divide the output line in the LIST statement using SKIP or FORM clauses. !!! ERROR [105] SUBTOTAL, TOTAL, CUM, and PCT only modify numeric items. Cannot use alphanumeric string items. Numeric strings are allowed. !!! ERROR [106] Field or expression must be numeric. Self-explanatory.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [113] An aggregate may not be used in this context with PCT Only the aggregates SUM and COUNT can be used with PCT and they must be used alone (not in an expression). !!! ERROR [114] Incorrect reply length (SERVER-related failure on name) ENFORM server (process file) returned a reply with an unexpected length to the query processor. One way to get this error is to specify an odd data record byte size.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [138] Invalid time specified The data being formatted with an AS TIME clause is not a valid time. !!! ERROR [143] Data type not supported A field within a DDL record description is described with a data type that is not supported by ENFORM. (For example, ENFORM does not support COMPLEX, REAL, or LOGICAL data types.) !!! ERROR [166] String literal must be terminated with a quotation mark Closing quotation mark is missing.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [172] Item on left side of assign operator must be a field in the FIND record The output-field-name in a FIND statement cannot be a field from an input record or the name of the FIND record itself. !!! ERROR [173] Value must be a single ASCII character, not "^" or "-" This is a restriction on the value for the Option Variable @NEWLINE.
Error Messages !!! Error and *** Warning Type Messages !!! ERROR [178] Record on right side of link optional is linked back to record on left Within your query specifications, a link exists that illegally links the record description specified on the right side of a LINK OPTIONAL statement back to the record description specified on the left side of the LINK OPTIONAL statement. Refer to the ENFORM Reference Manual for more information about links and the LINK OPTIONAL statement.
Error Messages *** File Error Type Messages !!! ERROR (SORT failure) sort-error-number [ *** FILE ERROR #file-errornumber ] [ on name ] An error occurred in the SORT process. For an explanation of the sort-error-number, refer to the Sort/Merge Reference Manual. Invalid response from Query Processor The query compiler/report writer process has received an invalid response from the query processor. This message usually indicates an error in the ENFORM software. Inform your system manager.
Error Messages *** File Error Type Messages *** FILE ERROR (Dictionary file access failure) #file-error-number on name Refer to the Data Definition Language (DDL) Reference Manual. *** FILE ERROR (Illegal ENFORM execution file) on name The file must be a compiled query file created with the ?COMPILE command. *** FILE ERROR (Illegal list device) on name Listing device is misspelled or does not exist.
Error Messages *** File Error Type Messages *** FILE ERROR (PURGE failure) on name There was a problem purging the physical file. *** FILE ERROR (READ failure) #file-error-number on name ENFORM could not read the physical file named. *** FILE ERROR (RENAME failure) on name There was a problem renaming the physical file. *** FILE ERROR (SERVER-related failure) # number on name There was a failure related to the use of an ENFORM server (process file).
Error Messages *** File Error Type Messages *** FILE ERROR (Unable to position ENFORM message table) #file-error-number on name ENFORM is unable to use the message table file. The session continues but all messages contain “???” instead of text. *** FILE ERROR (Unable to read ENFORM message table) #file-error-number on name ENFORM is unable to use the message table file. The session continues but all messages contain “???” instead of text.
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 must not be empty The Edit file specified on the BUILDMK command is empty. Specify the correct Edit file and re-issue the BUILDMK command. *** ERROR First parameter in command line must be an edit file name The first parameter specified for the BUILDMK command must be the name of an Edit file containing the Edit version of the message table.
Error Messages BUILDMK Error Messages *** ERROR In a reserved word redefinition, the old reserved word is missing Supply the old reserved word. *** ERROR Invalid edit file name was specified An invalid Edit file name was specified in the BUILDMK command. Correct the Edit file name and re-issue the BUILDMK command. *** ERROR Invalid key-sequenced file name was specified An invalid name was specified for the key-sequenced file parameter of the BUILDMK command.
Error Messages BUILDMK Error Messages *** ERROR ?HELP must appear in columns 1-5 and all other columns must be blank The characters ?HELP must appear in columns 1 thru 5 of the first line of the ?HELP section. All other columns on this line must contain blanks. *** ERROR ?HELP subsection must contain at least one subsection Self explanatory.
Error Messages BUILDMK Error Messages *** FILE ERROR (EDITREAD sequence error) on name The indicated error occurred on the specified file during the execution of BUILDMK. *** FILE ERROR (EDITREAD text file format error) on name The indicated error occurred on the specified file during the execution of BUILDMK. *** FILE ERROR (EDITREADINIT I/O error) on name The indicated error occurred on the specified file during the execution of BUILDMK.
Appendix C Sample Data Base All of the examples in this guide, use the sample relational data base in this appendix. Refer to the Data Definition Language (DDL) Programming Manual for a more complete description of the structure of a data base. This sample data base has two subsections: order entry records and employee records. The order entry records contain information on the parts in stock and orders for parts.
Sample Data Base Figure C-1.
Sample Data Base The dictionary for the sample data base describes the records. It serves as a template to ENFORM for retrieval of records. Figure C-2 is a source listing of the dictionary. Figure C-2. Dictionary Source Listing of Sample Relational Data Base (Page 1 of 3) ?DICT ! ?FUP ddlfup! DEF custnum PIC "9(4)" HEADING "Customer/Number". DEF partnum PIC "9(4)" HEADING "Part/Number". DEF empnum PIC "9(4)". *===================== order entry records ======================= RECORD order. FILE IS "$mkt.
Sample Data Base Figure C-2. Dictionary Source Listing of Sample Relational Data Base (Page 2 of 3) RECORD odetail. FILE IS "$mkt.sample.odetail" 02 primkey. 05 ordernum; PIC "999". 05 partnum; TYPE *. 02 quantity; PIC "999". KEY IS primkey. END RECORD parts. FILE IS "$mkt.sample.parts" 02 partnum; TYPE *. 02 partname; PIC "X(18)". 02 inventory; PIC "999S". 02 location; PIC "XXX". 02 price; PIC "999999V99". KEY IS partnum. KEY "pn" IS partname. END RECORD supplier. FILE IS "$mkt.sample.
Sample Data Base Figure C-2. Dictionary Source Listing of Sample Relational Data Base (Page 3 of 3) *===================== employee records ========================== RECORD region. FILE IS "$mkt.sample.region" KEY-SEQUENCED. 02 regnum; PIC "99". 02 regname; PIC "X(12)". 02 location; PIC "X(14)". 02 manager; PIC "9999". KEY IS regnum. KEY "rn" IS regname. END RECORD branch. FILE IS "$mkt.sample.branch" 02 primkey. 05 regnum; PIC "99". 05 branchnum; PIC "99". 02 branchname; PIC "X(14)".
Sample Data Base Figure C-3.
Sample Data Base Figure C-3. Listing of Records in Sample Relational Data Base (Page 2 of 5) FROMSUP Records Part Number ------ SUPPNUM ------- PARTCOST -------- 212 244 1403 2001 2002 1 1 1 1 1 92000.00 87000.00 22000.00 1500.00 1000.00 ... ... 6401 6401 6402 6402 6603 7102 7301 2 3 2 3 2 10 1 ... 1200.00 1100.00 1100.00 2600.00 2600.00 6000.00 2400.
Sample Data Base Figure C-3. Listing of Records in Sample Relational Data Base (Page 3 of 5) PARTS Records: Part Number -----212 244 1403 2001 2002 ... 5502 5504 5505 6201 6301 6302 6401 6402 6603 7102 7301 PARTNAME -----------------SYSTEM 192KB CORE SYSTEM 192KB SEMI PROC 96KB SEMI DECIMAL ARITH ENSCRIBE MICRO ... LP 300 LPM LP 900 LPM LP 1500 LPM SYNC CONTROLLER ASYNC CONTROLLER ASYNC EXTENSION TERM CRT CH AR TERM CRT PAGE TERM HARD COPY CABINET LARGE POWER MODULE INVENTORY --------7 3 21 -100 200 ...
Sample Data Base Figure C-3.
Sample Data Base Figure C-3. Listing of Records in Sample Relational Data Base (Page 5 of 5) EMPLOYEE Records: EMPNUM -----1 23 29 32 C–10 EMPNAME ----------------ROGER GREEN JERRY HOWARD JACK RAYMOND THOMAS RUDLOFF ... ... 201 202 203 204 205 206 207 JIM HERMAN LARRY CLARK KATHRYN DAY TOM HALL GEORGE FORSTER DAVE FISHER MARK FOLEY ... ... REGNUM ------ BRANCHNUM --------- 99 2 1 5 1 1 1 3 ... ... 1 1 1 1 1 2 2 1 1 1 1 2 1 1 ... ...
Appendix D Example ENFORM Programs This appendix contains complete programs illustrating various features of the ENFORM language. All of the programs use the sample relational data base shown in Appendix C. The following example illustrates two ways of specifying a linking relationship between record descriptions. The first program contains a LINK statement; the second program contains a WHERE clause. They produce identical reports.
Example ENFORM Programs The following program uses the CENTER clause to center ordernum. Notice that the formatted width “999”, as specified in the dictionary, is used for centering instead of the value of a field for the report line. The AS clause formats orderdate, using the mask format and symbol substitution modifier to substitute X for the 9 symbol. ?DICTIONARY $mkt.
Example ENFORM Programs A new report item is created with the arithmetic expression (price * quantity). A subtotal is printed for the new item, assuming OVER order.ordernum. The CUM OVER clause prints the cumulative values of the arithmetic expression for each group. The WHERE clause restricts the records that contribute to the report. ?DICTIONARY $mkt.dictry SET @SUBTOTAL-LABEL TO "SUBTOTAL"; OPEN order, odetail, parts; LINK order TO odetail VIA ordernum, parts TO odetail VIA partnum; LIST BY order.
Example ENFORM Programs Report: ORDERNUM -------66 Part Number ------ QTY --- PRICE --------- PRICE * QTY ----------- 0 1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 6 7 7 244 403 001 403 102 302 101 102 103 101 502 504 201 301 302 401 402 102 301 1 3 5 8 3 3 1 6 2 1 8 3 1 4 5 6 22 1 2 87000.00 22000.00 1500.00 9600.00 4800.00 2800.00 8000.00 14500.00 24500.00 7400.00 11500.00 21000.00 5800.00 2900.00 4300.00 1500.00 1500.00 68000.05 2400.06 87,000. 66,000. 7,500. 76,800. 14,400. 8,400. 8,000. 87,000. 49,000.
Example ENFORM Programs The following program shows different ways of formatting dates. Notice that the JULIAN-DATE clause is used to convert the date to internal format before using the AS DATE clause. Deldate uses the default heading; the dates converted by the JULIAN-DATE clause use the HEADING clause. The CENTER clause centers the day of the week. The WHERE clause restricts the records that contribute to the report. ?DICTIONARY $mkt.
Example ENFORM Programs The TITLE and SUBTITLE clauses print information at the top of the report. The subtitle is centered within the report. The AT START PRINT, AT END PRINT, BEFORE CHANGE, and AFTER CHANGE clauses print information within the report. ?DICTIONARY $mkt.dictry SET @SUBTOTAL-LABEL TO "SUBTOTAL"; OPEN order, odetail, parts; LINK order TO odetail VIA ordernum; LINK parts TO odetail VIA partnum; LIST BY order.ordernum, parts.
Example ENFORM Programs Report: SUMMARY OF ORDERS 12/05/79 RUN AT - 02:33:15 PM BEGIN ========= ORDERNUM -------- Part Number ------ QTY --- PRICE --------- PRICE * QTY ----------- === AFTER CHANGE === 66 0 244 1 1 403 3 2 001 5 2 403 8 3 102 3 3 302 3 ... ... ... 87000.00 22000.00 1500.00 9600.00 4800.00 2800.00 ... 87,000.00 66,000.00 7,500.00 76,800.00 14,400.00 8,400.00 ... 22 1 2 1500.00 68000.05 2400.06 33,000.00 68,000.05 4,800.12 ----------720,200.
Example ENFORM Programs The following program creates two user variables, invcount and counter. These user variables are both assigned values in the LIST statement. Three record descriptions are linked together, creating new logical records. The BY clause groups the records on the value of ordernum. Notice that ordernum and parnum require qualification, because they appear in more than one record description. The AS clause uses the mask format to print partnum in two columns.
Example ENFORM Programs Report: ORDERNUM -------66 Part Number ------ 0 1 2 2 3 ... 6 6 6 6 6 7 7 122 1 2 2 3 3 4 5 7 7 244 403 001 403 102 ... 201 301 302 401 402 102 301 403 002 403 103 201 103 103 102 301 QTY --- INV ----- 1 3 5 8 3 ... 1 4 5 6 22 1 2 10 10 30 20 3 40 3 7 8 3 21 -100 12 12 ... -16 -21 34 54 -32 20 32 21 200 12 -4 6 7 8 20 32 INV + QTY + 1 (OMIT NEGATIVES) ---------------5 25 21 16 ...
Example ENFORM Programs The SUPPRESS clause limits the printing of records for all items out of stock, but does not limit these records from contributing to the totals. In this example the inventory total is negative. ?DICTIONARY $mkt.dictry OPEN parts; LIST location, price AS MZZZZZZ.
Example ENFORM Programs The following program resets the Option Variable @SUBTOTAL-LABEL. The new value appears in place of the default value asterisk (*). Three record descriptions are linked together, creating new logical records. The BY clause groups the records on the value of ordernum. Notice that ordernum and partnum require qualification, because they appear in more than one record description. The AS clause uses the mask format to print partnum with a hyphen.
Example ENFORM Programs Report: ORDERNUM -------51 Part Number ------ QTY --- PRICE --------- PRICE * QTY ----------- 1-403 2-001 2-002 2-003 2-403 3-103 3-302 4-103 5-103 5-505 6-301 6-302 6-402 7-102 4 4 4 4 16 5 1 11 1 1 2 2 8 1 22000.00 1500.00 1000.00 500.00 9600.00 10500.00 2800.00 24500.00 8000.00 42000.00 2900.00 4300.00 1500.00 68000.05 88,000. 6,000. 4,000. 2,000. 153,600. 52,500. 2,800. 269,500. 8,000. 42,000. 5,800. 8,600. 12,000. 68,000. ----------722,800. 269,500.
Example ENFORM Programs A new report item is created with the arithmetic expression, (price * quantity). A subtotal is printed for the new item, assuming OVER order.ordernum. The user variables, sumval and cntval, are assigned values. The NOPRINT clause suppresses the printing of these items. The WHERE clause restricts the report to records where ordernum is over 60. The AT END PRINT clause prints information at the end of the report. The SKIP clause indicates a new line. ?DICTIONARY $mkt.
Example ENFORM Programs Report: ORDERNUM -------66 Customer Number -------- Part Number QTY ------ --- PRICE --------- 3210 3210 3210 3210 ... 3210 0-244, 1 1-403, 3 2-001, 5 2-403, 8 ... ... 7-301, 2 87000.00 22000.00 1500.00 9600.00 ... 2400.06 5635 5635 5635 ... 5635 5635 5635 1-403, 10 2-002, 10 2-403, 30 ... ... 5-103, 3 7-102, 7 7-301, 8 22000.00 1000.00 9600.00 ... 8000.00 68000.05 2400.06 SUBTOTAL 122 SUBTOTAL PRICE * QTY ----------87,000. 66,000. 7,500. 76,800. ... 4,800.
Example ENFORM Programs The following program creates a user-aggregate called total-new . Used with the argument “salary OVER job”, total-new adds a 10 percent increase to each original salary over 30000 and a 7 percent increase to all other salaries. The LIST statement totals the original salaries by job category and juxtaposes these with the new subtotals. ?DICTIONARY $mkt.dictry OPEN employee; DECLARE total-new (x) = (IF x > 30000 THEN total-new + x * 1.1 ELSE total-new + x * 1.
Appendix E Changing the Message Table Text ENFORM retrieves error message text, help message text, and reserved word redefinitions from a special key-sequenced file, called the ENFORM message table. Tandem supplies a default version of the message table in ENFORMMK, a keysequenced file that contains the ENFORM message and help text. ENFORM allows you to modify the message table so that you can: Redefine the ENFORM reserved words, system variable names, option variable names, and command names.
Changing The Message Table Text How to Change the Message Table Guidelines for Creating a Message Table for the Current Session When you create a new message table for the current ENFORM session, ENFORM allows you to include only a ?VOCABULARY section (ENFORM uses your reserved words with the standard messages and help text), only ?MESSAGES and ?HELP sections (ENFORM uses your messages and help text with the standard reserved words), or ?VOCABULARY, ?MESSAGES, and ?HELP sections (ENFORM uses your message
Changing The Message Table Text How to Change the Message Table Figure E-1. Creating a Message Table for the Current Session 1. Create an Edit file version of the message table that contains the desired text. :EDIT newemt ! *ADD 1 * 1 ?VOCABULARY * 2 MITTELWERT=AVG, ORDNUNG=BY, ZEIGE=LIST, * 3 UEBER=OVER, WOBEI=WHERE, MITTIG=CENTER, * 4 ALLE=ALL, BIS=THRU, FORMAT=AS, EROEFFNE=OPEN * ... ... 2. Purge any existing file with the same name as the name you selected for the keysequenced version.
Changing The Message Table Text How to Change the Message Table Guidelines For Replacing the Default Message Table You can change the message table for all ENFORM sessions by replacing the default message table, ENFORMMK. The new message table can either contain only ?MESSAGES and ?HELP sections (ENFORM uses the new messages and help text with the standard reserved words) or ?VOCABULARY, ?MESSAGES, and ?HELP sections (ENFORM uses the new reserved words, messages and help text).
Changing The Message Table Text How to Change the Message Table The example shown in Figure E-2 illustrates the preceding steps. Figure E-2. Replacing the Default Message Table 1. Specify the volume and subvolume on which the default message table resides in the Command Interpreter VOLUME command. :VOLUME mysyst.mysyst 2. Make a Backup Copy of ENFORMMT and ENFORMMK. :FUP DUP ENFORMMT, backupmt :FUP DUP ENFORMMK, backupmk 3. Edit ENFORMMT and make the desired changes to the message table text.
Changing The Message Table Text How to Change the Message Table Required Format of the Edit File When you create an Edit file version of the message table, the content of the file must conform to a prescribed format. You can create an Edit file that contains: Only a ?VOCABULARY section. You cannot use the key-sequenced version of such an Edit file to replace the default message table; however, you can use the key-sequenced version of this file as the message table for the current ENFORM session.
Changing The Message Table Text How to Change the Message Table 7. If you redefine the name of an option variable or a system variable, do not include the symbol @ as part of either new-element-name or old-element-name. When you specify the new name during an ENFORM session, you must include the symbol @. 8. If you redefine the name of an ENFORM command, do not include the symbol ? as part of either new-element-name or old-element-name.
Changing The Message Table Text How to Change the Message Table Refer to the ENFORM Reference Manual for the names of system variables, option variables, and commands. Table E-1 shows the ENFORM reserved words. Table E-1.
Changing The Message Table Text How to Change the Message Table If you either create a new ?MESSAGES section or modify the ?MESSAGES section of the Edit file version of the default message table, the ?MESSAGES section must conform to the following rules: 1. You must not include a ?MESSAGES section without including a ?HELP section. 2. In the Edit file, enter the ?MESSAGES section after the ?VOCABULARY section (if present) and before the ?HELP section. 3.
Changing The Message Table Text How to Change the Message Table If you either create a new ?HELP section or modify the ?HELP section in the Edit file version of the default message table, the ?HELP section must conform to the following rules: E–10 1. You must not include a ?HELP section without including a ?MESSAGES section. 2. In the Edit file, enter the ?HELP section after both the ?VOCABULARY section (if present) and the ?MESSAGES section. 3.
Changing The Message Table Text How to Change the Message Table Figure E-5 shows a diagram of the ?HELP section. Figure E-5. Diagram of the ?HELP Section ?HELP (text . . . ?HELP . . . ?HELP (test . . . ?HELP displayed when ?HELP is entered) AGGREGATE ARITHMETIC EXPRESSION displayed when ?HELP ARITHMETIC EXPRESSION is entered) ... You can obtain a copy of the current help text by duplicating ENFORMMT, the Edit file version of the default message table.
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 Front End. The ENFORM process which compiles ENFORM programs, and prints reports. See Compiler/Report Writer. Generic File. A file used to store some class of ENFORM output. Group Field. A collection of one or more fields that can be accessed with a single name. Group Name. Name of one or more fields that can be accessed with a single name. Home Terminal. The terminal from which the ENFORM command is entered. Link.
Glossary Record Occurrence. The actual stored values associated with a record. Record Type. A record's structure including field names and data types. Relational Data Base. A data base in which records are related through fields with common formats and comparable values. Repeating Group. A data base field that contains more than one data value. Report. The printed output of an ENFORM query using an ENFORM LIST statement. Request-qualification.
Glossary Unnormalized. Data that has been described such that more than one value exists for a field position in a record. User Aggregate. A user declared aggregate; a user-defined function that returns a value. See Aggregate. User Variable. A user declared element that can be used to store numeric or string literals, field values, or the results of arithmetic or aggregate calculations. ?OUT File. The physical device specified in the ?OUT command.
Index A Access to an ENFORM server 7-15/16 AFTER CHANGE clause described 3-41 example 3-44, D-6 syntax A-7 where values printed 3-43/44 Aggregate example 3-25/26, D-11, D-14/15 in a FIND file 3-28 printed in a report 3-25/26 syntax A-1 Alphanumeric fields 2-1 Altering cache size 5-10/11 Alternate keys adding 5-7/8 and search statistics 5-3 described 2-3/4 files loading 2-8/9 removing levels of indexing 5-5/6 removing 5-8/9 search path 5-6 Arithmetic expressions changing the default display format 3-54 defau
Index syntax A-9 with user created time format 3-58 ASCD clause described 3-31 multiple 3-32 syntax A-7 Assigning record descriptions 3-4 Assignment syntax 3-25/26 AT END PRINT clause described 3-41 example 3-45, D-6 syntax A-9 to override AT END statement 3-45 AT END statement cancelling, resetting, or overriding 3-45 described 3-41 example 3-45 syntax A-3 AT START PRINT clause described 3-41 example 3-45, D-6 syntax A-9 to override AT START statement 3-45 AT START statement cancelling, resetting, or over
Index BY clause described 3-31 examples 3-31, D-1 multiple 3-32 syntax A-10 BY DESC clause described 3-31 example 3-32 multiple 3-32 syntax A-10 By-items and a CUM clause 3-38/39 and subtotals 3-33/34 and the AFTER CHANGE clause 3-43/44 and the BEFORE CHANGE clause 3-43/44 and the PCT clause 3-35/36 creating 3-31 defined 1-8 C Cache size 5-10/11 Calculating percentage values 3-33 running totals 3-33 subtotals 3-33/34 totals 3-33, 3-35 CENTER clause examples 3-50, D-2/3 syntax A-10 to center all elements 3-
Index AT END PRINT 3-41, 3-45 AT START PRINT 3-41, 3-45 BEFORE CHANGE 3-41 BY 3-31 BY DESC 3-31 CENTER 3-49 CUM 3-33, 3-38/39 DESC 3-31 FOOTING 3-41, 3-46 FORM 3-49, 3-51/52 HEADING 3-49, 3-51/52 JULIAN-DATE CONVERSION 3-56/57 NOHEAD 3-49, 3-52/53 NOPRINT 3-49, 3-52/53 PCT 3-33, 3-35/36 SKIP 3-49, 3-53/54 SPACE 3-49, 3-53/54 SUBFOOTING 3-41, 3-46 SUBTITLE 3-41, 3-47/48 SUBTOTAL 3-33, 3-36/37 TAB 3-49, 3-54 TITLE 3-41, 3-47/48 TOTAL 3-33, 3-35 WHERE 3-8/9, 3-30, 5-12/13 Clearing links 3-15/16 CLOSE statemen
Index Command Interpreter ASSIGN command 5-10/11, 7-15/16 ENFORM command 4-1 FC command 4-3/4 Commands ?ASSIGN 5-10/11 ?HELP 3-59 Command Interpreter ASSIGN 5-10/12, 7-15/16 ENFORM 4-1 FC 4-3/4 ENFORM ?ASSIGN 3-2, 3-4 ?COMPILE 4-1, 4-6/7 ?DICTIONARY 3-2, 3-8/9 ?EDIT 4-4/5 ?EXECUTE 4-6/7 ?EXIT 4-2/3, 4-6/7 ?RUN 4-2/3, 4-5/6 ?SECTION 4-5/6 ?SHOW 2-7, 3-8/9 ?SOURCE 4-6/7 Compiled query file and the ?COMPILE command 4-7/8 and the host language interface 1-6, 6-1/2, 6-12, 6-15 in noninteractive mode 4-1 Compile
Index Condition code settings ENFORMRECEIVE procedure 6-8 ENFORMSTART procedure 6-6/7 Conditional operators and linking 3-15/16 and STRATEGY COST 5-4/5 evaluation by query processor 5-12/13 Conjunctive normal form 3-12/13 Connecting relationship defined 3-7/8 specifying 3-8/9, 3-15/16 Conserving space in the internal table 3-41 Controlling extent sizes of target file 5-10/11 Converting a date to internal format 3-54 Copying record descriptions 3-2/3 Creating an ENFORM server 7-1/3 data base files 2-8/9 Ctl
Index Data categories and linking 3-7/8 described 2-1, 2-5/6 Data Definition Language and the data dictionary 2-6/7 COBOL, FORTRAN, and TAL source code 2-8/9 creating file creation source code 2-5/6 default block size 5-5/6 defining the data base 1-3, 2-5/6 example 2-5/6, 3-28 FILE IS clause 2-5/6, 3-4 function 2-5/6 guidelines for defining data 2-6/7 message header format for an ENFORM server 7-7/8 RECORD statement 2-5/6 sample dictionary source code C-3 SEQUENCE IS clause 2-6/7, 3-7/8, 5-8/9 source file
Index headings 3-40/41 horizontal spacing 3-39/40 internal format of a user element 3-6/7 margins 3-39/40 overflow character 3-55/56 page length 3-39/40 page numbers 3-39/40 report formats 3-39/40 sorting order 3-39/40 Defining data base elements 2-5/6 Defining report layout 3-49 Definition pairs E-7/8 DELINK statement described 3-8/9 for clearing links 3-15/16 syntax A-3 DESC clause described 3-31 multiple 3-32 syntax A-10 Description, (record) See Record description Determining extent sizes of target fil
Index Disc environment adding alternate keys 5-7/8 altering cache size 5-10/11 changing the location of work files 5-10/11 controlling size of target file 5-10/11 removing alternate keys 5-8/9 removing levels of indexing 5-5/6 sorting an already sorted file 5-8/9 spreading input/output demands 5-10/11 Display format changing 3-55/56 default 3-40/41 Double exception report 3-20/21 Duplicating record descriptions 3-2/3 E Edit descriptors 3-55/56 Edit file creating 4-4/5 identifying statements within 4-4/5 re
Index AT END PRINT 3-41, 3-45 AT START PRINT 3-41, 3-45 BEFORE CHANGE 3-41 BY 3-31 BY DESC 3-31 CENTER 3-49 CUM 3-33, 3-38/39 DESC 3-31 FOOTING 3-41, 3-46 FORM 3-49, 3-51/52 HEADING 3-49 3-51/52 JULIAN-DATE CONVERSION 3-56/57 NOHEAD 3-49, 3-52/53 NOPRINT 3-49, 3-52/53 PCT 3-33, 3-35/36 SKIP 3-49, 3-53/54 SPACE 3-49 3-53/54 SUBFOOTING 3-41, 3-46 SUBTITLE 3-41, 3-47/48 SUBTOTAL 3-33, 3-36/37 TAB 3-49, 3-54 TITLE 3-41, 3-47/48 TOTAL 3-33, 3-35 WHERE 3-30, 5-12/13 commands ?ASSIGN 3-2, 5-10/11 ?ATTACH 5-11/12
Index interactive mode 4-3/4 message table E-1 noninteractive mode 4-1 procedures 1-6, 6-1/2 processing environment 1-3 prompt 4-3/4 query compiler/report writer 1-3 query processor 1-5/6 report format defaults 3-39/40 search statistics and block size 5-7/8 described 5-1 search strategy 5-12/13 server 1-7, 7-1 statements AT END 3-41, 3-45 AT START 3-41, 3-45 CLOSE 3-8/9, 3-15/16 DECLARE 3-2, 3-6/7 DELINK 3-8/9, 3-15/16 DICTIONARY 3-2, 3-8/9, 3-15/16 FIND 3-24, 3-26/27, 4-7/8 FOOTING 3-41, 3-46 LINK 3-2/3,
Index message dialogue 7-1/3 message header format 7-7/8 performance considerations 7-17/18 query processor messages INITIATE-INPUT-REPLY 7-10 INITIATE-INPUT-REQUEST 7-9 RECORD-INPUT-REPLY 7-12/13 RECORD-INPUT-REQUEST 7-10/11 TERMINATE-INPUT-REPLY 7-15 TERMINATE-INPUT-REQUEST 7-14 reasons for using 7-1/3 restrictions and conditions 7-15/16 starting 7-6 STARTUP message 7-6 terminating 7-6 using 7-16/17 writing 7-1/3 ENFORM [QP] TRAP error messages B-13 ENFORMFINISH procedure described 6-11 syntax 6-11, A-15
Index ENFORMRECEIVE 6-9 ENFORMSTART 6-7 initialization B-1 Errors during statement execution reporting 4-3/4 Establishing a link for current query 3-15/16 Establishing the query environment 3-2 Evaluation of WHERE clause 3-12/13, 5-12/13 of logical expressions 5-12/13 of user variables in LIST statement 3-26/27 Examining session-wide links 3-15/16 Exception report 3-19/20 Executing a query in interactive mode 4-3/4 in noninteractive mode 4-1 using the ?RUN command 4-5/6 using the ?SOURCE command 4-6/7 Exec
Index FIND file and STRATEGY COST 5-5/6 and the host language interface 6-1/2, 6-12, 6 15 and the query processor 1-5/6 as an intermediate file 3-29 described 3-26/27 diagram with by-items 3-32 restricting information selected 3-30 sharing 5-13/14 sorting and grouping information 3-31 FIND statement and the ?COMPILE command 4-7/8 described 3-24 example 3-28, D-14/15 in an edit file 4-7/8 syntax A-4 used to normalize data 3-29 First normal form 2-4/5 FOOTING clause described 3-41 syntax A-10 temporarily ove
Index G Generating a subtotal 3-33/34 Generic files 5-10/11 Getting help 3-59 Grand total 3-35 Grouped percentage values 3-36/37 Grouping information 3-31 Guidelines compiling source code 4-7/8 defining data 2-6/8 for changing the message table E-1 linking 3-7/8 query creation 3-1 using FIND statement 3-26/27 using FUP to create data base files 2-8/9 using LIST statement 3-24 writing an ENFORM server 7-3/4 H HEADING clause examples 3-51/52, D-2/3 multiple line 3-51/52 syntax A-10 Headings centering 3-50 de
Index ENFORMFINISH 6-11 ENFORMRECEIVE 6-8 ENFORMSTART 6-3/4 TAL example 6-15 FORTRAN example 6-19 I Identification line 5-3 Identifying a collection of statements or commands 4-5/6 record descriptions 3-2/3 the dictionary 3-2 IF/THEN/ELSE expression A-1, D-8/9 Improving query performance adding or removing alternate keys 5-8/9 altering cache size 5-10/11 changing the disc environment 5-5/6 changing the nondisc environment 5-11/12 specifying where work files are built 5-10/11 Including all values in a link
Index ENFORMRECEIVE 6-8 ENFORMSTART 6-3/4 Intermediate file See FIND file INTERNAL clause A-10 Internal report specifications 1-5/6 Internal table and print list information 3-41 assigned record descriptions 3-4 clearing links 3-15/16 conserving space 3-41 examining 2-6/8 overflow 3-41 user elements 3-6/7 Interprocess communication 7-4 Interprocess messages between ENFORM and an ENFORM server 7-4 J Join strategy and STRATEGY COST 5-4/5 defined 5-1/2 JULIAN-DATE CONVERSION clause and the AS DATE clause 3-56
Index L LEVEL READ column 5-1/2 Levels of indexing 5-5/6 of normalization 2-5/6 READ 5-1/2 Line length default 3-39/40 LINK statement and OPEN AS COPY OF 3-2/3 and WHERE clause 3-12/13 combining links 3-16/17 described 3-8/9 example 3-9, D-1 function 3-8/9 syntax A-4 using 3-8/9, 3-10 Link, multiple 3-16/17 Linking and record occurrences 2-2 and STRATEGY COST 5-4/5 defined 3-7/8 displaying links in effect 3-15/16 for the current query 3-15/16 key fields 5-3 process described 3-8/9 session-wide 3-8/9 LIST s
Index Logical reads 5-3 Logical record description defined 3-7/8 M Major to minor sort sequence 3-32 Margins, default 3-39/40 Message header format 7-7/8 Message protocol 7-7/8 Message text E-1 Messages passed to and from an ENFORM server 7-3/4 Multiple links 3-16/17 MUMPS files 7-3/4 N Network traffic, reducing 5-12/13 NOHEAD clause described 3-49 example 3-52/53 syntax A-10 Non-contributing record occurrences 3-12/13 Nondisc environment process placement 5-11/12 reducing network traffic 5-12/13 sharing q
Index Numeric elements, calculating a percentage value 3-35 a subtotal 3-33/34 a total 3-35 Numeric fields 2-1 O Obtaining the current date 3-56/57 Obtaining the current time 3-58 OPEN AS COPY OF statement 3-2/3 OPEN statement described 3-2 effect of 3-2/3 syntax A-5 to identify record descriptions 3-2/3 Opening a record description 3-2 an ENFORM server 7-3/4 Optimizing the efficiency of a query 5-1 Option Variables @DISPLAY-COUNT 3-6/7 @MARGIN 3-6/7 @PRIMARY-EXTENT-SIZE 5-11/12 @SECONDARY-EXTENT-SIZE 5-11
Index PARAM statement and the host language interface 6-12 in a compiled query file 4-2/3, 4-7/8 syntax A-6 Parameters, passing 4-2/3, 4-7/8 Passing parameters to a host language program 6-15 to compiled query files 4-2/3, 4-7/8 PCT clause examples 3-35/36 syntax A-11 using 3-35/36 with the SUBTOTAL clause 3-36/37 with the TOTAL clause 3-36/37 Percentages calculating 3-35/36 obtaining subtotals 3-36/37 obtaining totals 3-36/37 Performance ENFORM server considerations 7-17/18 query improvement disc environm
Index Processing environment 1-3 Producing a report 3-24 Producing dictionary reports 2-7/8 Producing search statistics 5-1 Protecting a query from changes 4-7/8 Providing documentation within a report 3-40/41 Providing records to a host language program 6-8 Q Qualification 5-13/14, 7-17/18 Query and the host language interface 6-1/2 changing the wording to improve performance 5-12/13 clearing links 3-8/9 defined 1-8 defining user elements for 3-6/7 developing 3-1 establishing links 3-7/8 establishing the
Index forcing the search strategy 5-12/13 in the ENFORM processing environment 1-3, 1-5/6 logical reads 5-3 placement 5-11/12 reading files in parallel 5-1/2 search statistics 5-1 sequence in which files are read 5-1/2 sharing 5-11/12 Query specification defined 1-8 description 1-4 R Reading an Edit file with ENFORM 7-1/3 with the ?EDIT command 4-4/5 with the ?SOURCE command 4-6/7 Record description assigning to different physical file 3-4 defining 2-5/6 examining 2-6/7 linking 3-7/8 making a copy of 3-2/3
Index by adding alternate keys 5-7/8 by removing alternate keys 5-8/9 problems with shortpool 5-11/12 query response time 5-5/6 Repeating field values defined 2-1 Repeating group defined 2-1 eliminating 2-3/4 Report calculating a subtotal 3-33/34 a total 3-35 percentage value 3-35/36 running total 3-38/39 centering elements of 3-50 changing the default display format 3-54 containing an aggregate 3-25/26 default format 3-39/40 defining layout 3-49 diagram of format 3-42 examples 3-25/26, 3-32, D-2/3 footing
Index Reserved words changing E-1 list of E-7/8 Running total 3-38/39 S Sample search statistics 5-1 Search algorithms 1-5/6 statistics example 5-1 FILE NAME column 5-1/2 Identification line 5-3 LEVEL READ column 5-1/2 obtaining 5-1 POSITIONS column 5-3 RECORDS READ column 5-3 STRATEGY COST line 5-4/5 strategy 1-5/6, 5-12/13 Secondary extent size of target file 5-10/11 Selecting information 3-24 Server query processor advantages of sharing 5-11/12 placement 5-11/12 Server, ENFORM See ENFORM server Session
Index statements AT END 3-45 AT START 3-45 DECLARE 3-6/7 DICTIONARY 3-2 FOOTING 3-41, 3-46 LINK 3-8/9 SUBFOOTING 3-41, 3-46 SUBTITLE 3-41, 3-47/48 TITLE 3-47/48 SET statement described 3-2 syntax A-6 to set option variables 3-6/7 Setting option variables 3-6/7 Setting the default edit file 4-4/5 Sharing query processors 5-11/12 Shortpool 5-11/12 Significance of STRATEGY COST values 5-4/5 Simplifying the data structure 2-3/4 SKIP clause described 3-49 example 3-53/54, D-13/14 syntax A-12 Sorting avoiding so
Index Spreading input/output demands 5-10/11 Statements AT END 3-41, 3-45 AT START 3-41, 3-45 CLOSE 3-8/9, 3-15/16 DECLARE 3-2, 3-6/7 DELINK 3-8/9, 3-15/16 DICTIONARY 3-2, 3-8/9, 3-15/16 FIND 3-24, 3-26/27, 4-7/8 FOOTING 3-41, 3-46 LINK 3-2/3, 3-8/9 LIST 3-24, 3-39/40 OPEN 3-2/3 SET 3-2, 3-6/7 SUBFOOTING 3-41, 3-46 SUBTITLE 3-41, 3-47/48 TITLE 3-41, 3-47/48 Steps to create a query 3-1 STRATEGY COST and FIND files 5-12/13 described 5-4/5 String literals 3-41 SUBFOOTING clause described 3-41 syntax A-12 temp
Index OVER syntax 3-33/34 syntax A-11 Subtotal string 3-33/34 SUPPRESS clause A-12, D-9/10 Suppressing the printing of duplicate items in a report 3-31 Suppressing a column heading 3-52/53 System variables @DATE 3-56/57 @TIME 3-58 T TAB clause described 3-49 examples 3-54 syntax A-13 TAL and the host language interface 6-3/4 data definition source code 2-5/6 ENFORMFINISH procedure 6-11 ENFORMRECEIVE procedure 6-8 ENFORMSTART procedure 6-3/4 program example 6-15/17 Tandem text editor 4-4/5 Target file contr
Index Target records and a host language program 1-6 and the query compiler/report writer 1-5/6 and the query processor 1-5/6 defined 1-8 linking 3-7/8 returning zero 3-30 unexpectedly large amount 3-7/8 Temporary work files See Target file TERMINATE-INPUT-REPLY message 7-15 TERMINATE-INPUT-REQUEST message 7-14 Terminating ENFORMRECEIVE procedure 6-8 host language interface 6-11 session in interactive mode when entering source code directly 4-4/5 when entering source code indirectly 4-7 session in noninter
Index U User elements cancelling 3-6/7 defining 3-6/7 establishing the default heading 3-6/7 the display format 3-6/7 the internal format 3-6/7 providing an initial value 3-6/7 User tables defining 3-6/7 providing an initial value 3-6/7 User variable assigning result of arithmetic calculations 3-33 default display format 3-40/41 default heading 3-40/41 default value 3-30 defining 3-6/7 examples D-7/8, D-12/13 in a WHERE clause 3-30 initial value 3-26/27, 3-30 providing an initial value 3-6/7 User variables
Index conjunctive normal format 3-12/13 converted 3-12/13 described 3-8/9 evaluation process 5-12/13 example 3-15/16, D-1 non-contributing record occurrences 3-12/13 syntax A-13 to establish link for current query 3-15/16 used to reduce physical file accesses 5-12/13 used to restrict information selected 3-30 Writing an ENFORM server 7-1/3 Special Characters !!! ERROR AND ***WARNING messages B-1, B-3 ***FILE ERROR type error messages B-19 ?ASSIGN command described 3-2 effect 3-5 syntax A-14 to assign recor
Index uses 4-2/3, 4-7/8 ?HELP command 3-59, A-14 ?HELP section described E-1, E-8/9 syntax E-10/11 ?MESSAGES section described E-1, E-8/9 syntax E-8/9 ?OUT command A-14 ?RUN command and the default edit file 4-5/6 example 4-5/6 in a compiled query file 4-2/3 syntax A-14 when entering source code indirectly 4-5/6 ?SECTION command and the ?RUN command 4-6/7 examples 4-5/7 in an edit file 4-4/5 omitting from the ?RUN command 4-6/7 syntax A-14 ?SHOW command described 3-8/9 syntax A-15 to examine a record descr
Index @LINENO A-13 @LINES A-11 @MARGIN 3-6/7, A-11 @NEWLINE A-11 @NONPRINT-REPLACE A-11 @OVERFLOW A-11 @PAGENO A-13 @PAGES A-11 @PRIMARY-EXTENT-SIZE 5-11/12, A-11 @READS A-11 @SECONDARY-EXTENT-SIZE 5-11/12, A-11 @SPACE A-11 @STATS 5-1, A-11 @SUBTOTAL-LABEL D-2/3 @SUMMARY-ONLY A-11 @TARGET-RECORDS 5-11/12, A-11 @TIME A-13 @TIME system variable 3-58 @UNDERLINE A-11 @VSPACE 3-53/54, A-11 @WARN A-11 @WIDTH A-11 058058 Tandem Computers Incorporated Index–33