DataEase Reference Manual
-
Upload
sarametandrei -
Category
Documents
-
view
219 -
download
0
Transcript of DataEase Reference Manual
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 1/395
VOLUME 3DataBase Query Language Guide
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 2/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 3/395
This menu tree shows
where the various DataEase
options are located. Record
Entry, QBE-Quick Reports,
and Database Maintenance
are discussed in Volume I.
Form Definition and
Relationships, MenuDefinition, and System
Administration are discussed
in Volume 2.
DQL Advanced Processing is
discussed in Volume 3.
DataEase Main Menu
1. Form Definition and
Relationships
2. Record Entry
3. QBE-Quick Reports
4. DQL Advanced Processing
5. Menu Definition
6. Database Maintenance
7. System Administration
Form Definition Menu
1. Define a Form
2. View or Modify a Form
3. Define Relationships
4. Delete a Form
5. Reorganize a Form
Records Menu
Please select a form.
Enter a number from to 5
0; NONE1: SYSTEM2: STORES3: CALL LIST
4: PRODUCTS5: EMPLOYEES
The
DataEase MenuDefinition FormDisplays
Maintenance Menu
1 Database Status2. Backup Database
3. Restore Database
4. DOS Functions
5. Lock Database
6. Unlock Database
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 4/395
DataEase International Inc.echnical Support Policy
ataEase International provides free technical support for all registered
ataEase licensees in the U.S. (support in other countries is provided bylocal distributor). To register, simply fill out and send in the enclosed
istration card. Technical support for unregistered callers is limited to
days from the date of purchase. DataEase International reserves the
ht to limit the number of calls and the call length.
he DataEase Hotline number is 1-203-374-2825. Our hours are Mondayough Thursday, 9AM to 8PM, and Friday, 9AM to 6PM EST. Pleaseve your DataEase serial number ready when you call. This number is
ated on your system diskette and on the DataEase Sign On screen.
OU MUST BE REGISTERED TO RECEIVE FREE TECHNICALUPPORT
opyright and Trademarks
taEase® and GrafTalk® are registered trademarks of DataEasernational, Inc.
BM® is a registered trademark of International Business Machinesrporation.
e following companies hold trademarks on product names (printed in
c) which are mentioned in the DataEase documentation:
hton-Tate: dBASE II® dBASE III® dBASE III PLUS.®ultiMate® dBASE IV ®
rland International: Paradox™
tus Development Corporation: Lotus 1-2-3™ Symphony '
croPro International: WordStar®
rdPerfect Corporation: WordPerfect®
s manual supports DataEase Release 4.2 and higher.
o part of this publication may be reproduced, stored in a retrieval
tem, or transmitted in any form or by any means: electronic,
chanical, photocopying, recording, or otherwise, without the priortten permission of the publisher.
Copyright 1988, 1989, 1 990 DataEa.se International
Cambridge Drive, Trumbull, CT 06613) 374-8000
rights reserved.
nted in the U.S.A.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 5/395
DataBaseg^^-mx^v'^.^-^.^'j^^^ »?-^' -.'. s^^^ j-s-jj, '
:. . ,v.:--'.i^y^x<mre -
REFERENCE MANUAL
Volume 3DataBase Query Language
Guide
=^ DataBase
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 6/395
U A r A E A S E R E E E R E N C E MANUAL
Table of Contents
Introduction to DQL Advanced Processing
NTERACTIVE MODE 1-1
DIT MODE 1-2
WHAT'S A QUERY? 1-2
AMPLE QUERY AND REPORT OUTPUT 1-2
DQL PROCEDURES 1-3
Types of Procedures 1-3
Conditional Processing 1-3
THE BASIC DQL VOCABULARY 1-4
HOWTO USE THIS BOOK 1-5
What To Read First 1-5
TYPOGRAPHICAL CONVENTIONS 1-6
Defining, Modifying, and Running Procedures
QUICK SUMMARYOF THE DQL MENU OPTIONS 2-3
RUN PROCEDURE 2-5
TART NEW PROCEDURE 2-6
DEFINE DATA-ENTRY FORM 2-7
What Is a Data-entry Form? 2-7
How to Display the Data-entry Form 2-8
Creating the Data-entry Forni 2-9
Using the Data-entry Form 2-10
Saving the Data-entry Form 2-12
Modifying the Data-entry Form 2-13
DEFINE QUERY 2-14
The DataEase Query Language 2-14
Interactive Mode 2-15
Changing Modes 2-15
High Level and Low Level 2-18
Edit Mode 2-19
Modify Query 2-20
How to Switch Modes 2-21
SAVE PROCEDURE 2-22
LOAD PROCEDURE 2-24
DELETE PROCEDURE 2-26
PRINT PROCEDURE DEFINITION 2-27
Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 7/395
TABLE OF CONTENTS
3 Define Query: A Low Level Example
THE PURPOSE OF THE QUERY; A REPORTWHICH RECORDS TO SELECTCREATING THE QUERY
4 Define Query: A High Level Example
HIGH LEVEL DQL COMMANDSPROCEDURE 1 : POST ORDERS
Query for the Post Orders Procedure
Explanation of the Query
Saving the Procedure ,
PROCEDURE 2: CALCULATE DISCOUNTQuery for the Calculate Discount Procedure
Explanation of the Query
PROCEDURE 3: PRINT INVOICES
Query for the Print Invoices Procedure
Explanation of the Query
THE CONTROL PROCEDURE: MAILORDERQuery for Mail Order Control Procedure
Explanation of the Control Procedure
Summary (Putting It All Together)
5 Define Format/Print Style: Designing Report Output
DEFINE FORMATQUICK SUMMARYOF THE FORMAT MENU OPTIONSFORMAT TYPES
Columnar Format
Field per Line Format
Record Entry Format
Template Format
GrafTalk Chart Format
Mailing Labels Format
Export FormatsCUSTOM FORMAT
Formatting Commands
Required Formatting Commands
Group Level Formatting Commands
Page Level Formatting Commands
The .call Command
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 8/395
DATAEASE REFERENCE MANUAL
EDITING FORMATS 5-58
Editing Function Keys 5-58
Adding and Modifying Fields 5-60
Saving a Format 5-64
Printer Control Commands 5-65
DEHNE PRINT STYLE 5-70
The Print Style Specification 5-70
Defining the Report Destination 5-71
Print Style Modification 5-75
Saving/Modifying 5-79
Examples 5-80
DQL Lexicon
NTRODUCTION 6-1
DQL LEXICON TYPOGRAPHICAL CONVENTIONS 6-2
Syntax Diagrams 6-2
Margin Notes 6-2
Typesize 6-2
Database Forms Used in the Examples 6-2
Punctuation Symbols 6-3
Math Symbols 6-3
Wildcard Symbols 6-3
Comparison Symbols 6-3
i Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 9/395
TABLE OF CONTENTS
List of Figures
1 Introduction to DQL Advanced Processing
Figure1-1
- Query that Lists U.S. States in Alphabetical Order andthe Report Output
2 Defining, Modifying, and Running Procedures
Figure 2-1 -The DQL Menu
Figure 2-2 - Data-entry Form Used to Specify a Single State
Figure 2-3 - Interactive Mode Screen
Figure 2-4 —Procedure Definition (no Data-entry Form)
3 Define Query: A Low Level Example
Figure 3-1 —Low Level Example Database Forms
Figure 3-2 —Account Balance Report
Figure 3-3 —Sort Commands
Figure 3-4 —Alphabetized Account Balance Report
4 Define Query: A High Level Example
Figure 4-1 - High Level Example DataBase Forms
Figure 4-2 —Calculation Of Annual Variable
Figure 4-3 —Christmas Order Invoice
5 Define Format/Print Style: Designing Report Output
Figure 5-1 —Sample Report Showing Formatting Commands
Figure 5-2 ~ Sample Query, Format, and Report Output
Figure 5-3 —Sample Formatting Commands Used to Createa Custom Format
Figure 5-4 - Basic Format
Figure 5-5 —Pairing Group Formatting Commands
Figure 5-6 —Report Field Definition Screen
Figure 5-7 —Report Field Formula in Window
Figure 5-8 - Print Style Specification Screen
6 DQL Lexicon
Figure 6-1 - Forms and Relationship Levels
Figure 6-2 —Sample Report Showing Use of Formatting Commands
Figure 6-3 - Forms and Relationship Levels
Figure 6-4 —Order Entry Form Used for Transaction Processing
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 10/395
DATABASE REFERENCE MANUAL
Chapter 1
ntroduction to
DQL Advanced Processing
he DataEase Query Language (DQL) extends the data
processing and reporting capabiHties of DataEase far
beyond those described for Quick Reports in Volume 1 . In
dition to giving you full control over all aspects of querying,
port design, and formatting output, DQL Advanced Processing
s you:
• Design custom applications that input, manipulate, and retrieve
information in multiple database forms.
• Use the DQL Relational Operators to find. list, modify, sort,
group, and summarize data in related forms.
• Call and chain together menus, input forms, reports, data
imports, - even other programs - and link all these actions
into a single automated Control procedure.
• Use global variables to pass values among procedures.
• Create state-of-the-art transaction processing applications that
automatically enter new records, post information from one
form to another, and perform batch updates in multiple forms.
If you're a new user, werecommend thai you first
read this Introduction andthen go through the examplein Chapter 3 to gain a basic
familiarity with the process ofdefining queries.
Experienced users will findthat the example in Chapter 4introduces most of the DQLvocahulaiy and demonstrateshow to construct a DQLControl procedure.
All users will find the DQLLexicon an easy-to-use. rapid
resource for locating the
correct command syntax forany query problem.
NTERACTIVE MODE
lthough DQL Advanced Processing uses the DQL to manipulate
nd retrieve information from a database, you don't have to spend
me memorizing the query language to use its power. To perform
en the most complicated procedures, all you have to do is makelections from a series of menus.
InteractiveMode,
DataEase activates a built-in editor that
ompts you at each step, lists all valid responses, and prevents
ou from making syntax errors or spelling mistakes. Because all
dvanced Processing is supported by context-sensitive prompts,
ven new users can easily create applications and generate complexports with a minimum of training.
DQL Advanced Processing
features menu or commanddriven query definition,
interactive prompts, and anautomatic syntax checker.
1 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 11/395
INTRODUCTION TODQL ADVANCED PROCESSINC;
EDIT MODE
As you gain experience, you may choose to work in Edit Mode -
the rapid command-driven alternative mode preferred by DataBase
power users. In Edit Mode you enter DQL statements directly,
without the assistance of menus, prompts, or the syntax checker.
WHAT'S A QUERY?
A query is a group of statements that tell DataBase how to
manipulate the information in a database. A query can:
• Ask a question (e.g., which state has the most customers?)
• Add, delete, or modify data
• Call other programs
The DataBase Query Language is the group of words and symbolsthat tell DataBase how to process data. The printed output from a
query is often called a report. Figure 1-1 shows a report that
incorporates a basic query and part of its report output.
SAMPLE QUERY AND REPORT OUTPUT
U.S. STATE REPORT
Query Report Output
for STATES;list recordsSTATE NAME In Order
.
end
AlabamaAlaskaArizonaArkansasCaliforniaColoradoConnecticutDelawareFloridaGeorgia
A query can ask a question,
add. delete, or modify da
and/or call other procedureand external programs.
printed output generatedquery is called a report.
Wyoming
Figure 1-1 —Query that Lists U.S. States in Alphabetical Order
and the Report Output from the Query
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 12/395
DATABASE REFERENCE MANUAL
DQL PROCEDURES
n addition to asking questions, you can use a query to update ormodify data, as well as list information stored in the database like
he example shown above. When the DQL is used to manipulateata, the query becomes part of a procedure. A DQL Procedureonsists of several elements:
• Query - this tells DataEase what information to process.
• Format - this tells DataEase how to arrange the output.
• Print Style Speciflcation - this tells DataEase where to sendthe output. If the output is sent to a printer, the Print Style also
specifies the page dimensions and any special printer
characteristics needed to generate the hard copy.
• Data-entry Form - optionally lets you enter additional
information to be used in processing just before running the
procedure.
Types of Procedures
here are two basic types of DQL Procedures: Processingrocedures and Control procedures.
A Processing procedure is used to directly manipulate data - to
dd, delete, modify, list, and sort data either for the purpose ofpdating the information stored in database forms or for
enerating printed reports.
A Control procedure does not directly manipulate data. Instead, angle Control procedure can be used to link any number of otherrocedures together (like the macros used in many of today'srograms). This makes it possible to automate the whole series ofansactions that occur in accounting, billing, inventory control,
rder-processing, and retail point-of-sale systems where data is
osted from one form to another and records are continuouslypdated.
There are m'o types of DQLProcedures: Processingprocedures and Controlprocedures. Processingprocedures manipulate data.
Control procedures link
procedures together. You
can use conditional actions in
both types of procedures.
onditional Processing
addition to processing data and linking transactions, the DQLcludes a complete set of procedural commands (including case,..then, and while...do) that let you use conditional processing in
oth types of procedures (e.g., if today is the last day of the week,n the weekly summary procedure and backup the database).
-3 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 13/395
INTRODUCTION TO DQL ADVANCED PROCESSING
THE BASIC DQL VOCABULARY
The basic terminology that is used to create a DQL Procedure is
composed of eight key elements:
• Commands enter, delete, modify, and list records; call and
execute procedures or external programs; and generate output
either on the screen, on disk, or in a printed report. There are
three groups of DQL commands: Processing Commands,
Control Commands, and Procedural Commands.
• Operators refine commands; they tell DataBase how to
execute the various operations specified by the query's
commands (such as in what order to process records, what
statistics to generate, etc.). There are seven groups of DQLOperators: Comparison Operators, Sorting and Grouping
Operators, Statistical Operators. Relational Operators,
Conditional Statistical Operators, and Relational Statistical
Operators.
• Functions return a specified value in a different format.
The 58 DQL functions are divided into nine groups: Date,
Financial, If. Math. Scientific, Spell, Text, Time, and
Trigonometric.
• Keywords signal special operations, such as creating
temporary and global variables, accessing system variables,
performing conditional actions, or retrieving values from a
Data-entry form.
• Relationships link records in different forms. In a DQLprocedure, you can use both predefined and ad-hoc
relationships to access the information in a related form.
• Formatting Commands specify the layout of text and field
values for a printed report. Chapter 5 in this volume provides
detailed information on how to format a report.
• Symbols clarify, divide, and conclude various statements
specified in a query.
• Values are the actual data that is processed by the procedure.
A value can be any number, text or numeric character string.
Most values in a query are field values from the specified
forms.
All these terms are individually defined in detail in the DQLLexicon, the dictionary-style reference section at the back of this
volume.
The basic DQL vocabulary
composed of eight elements:
commands, operators,functions. keyv.'ords.
relationships, report
formatting commands,symbols, and values.
Many powerful DQL feature
including all the functions,
relational statistical
operators, and report
formatting options; can a
be used with Quick Reports
to enhance their output
capabilities.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 14/395
DATABASE REFERENCE MANUAL
HOWTO USE THIS BOOK
is book is designed to be used as both a learning tool and a
mprehensive reference manual. Following this Introduction,
information is organized in five sections as follows:
hapter 2. Defining, Modifying, and Running Proceduresovides a detailed explanation of how to create or modify a DQLocedure including: modes and levels, prompting, and function keyignments.
hapter 3. Define Query: A Low Level Example is a simple,
p-by-step example that explains how to create a query in Lowvel Interactive Mode that can retrieve information from a pair of
ated forms.
hapter 4. Define Query: A High Level Example is a detailed
ample that demonstrates how to create a custom application using
gh Level DQL commands to link several Processing procedures
o a single automated Control procedure.
hapter 5. Define Format/Print Style provides completedelines for designing report output with numerous examples of
ault and special report formats that show you how to control the
pearance of your reports.
hapter 6. The DQL Lexicon is a dictionary-style reference
tion that defines every command, function, and feature of the
taBase Query Language. The terms are listed in alphabetical
er, with punctuation and other symbols presented first.
What To Read First
you're a new user, we recommend that you first read the
taBase Tutorial and then Chapter 3 in this manual to gain a basic
miliarity with the process of defining forms and queries.
ore experienced users will find that the High Level example in
apter 4 introduces most of the DQL vocabulary in the process ^^ ' ' ''''' '' ' ''^ ' ''''' ' ''
building a Control procedure to automate the order-fulfillmentDatuEase Tutoncl.
tem for a hypothetical mail-order catalog company.
users will find the DQL Lexicon an easy-to-use, rapid resource
locating the correct command syntax for any query problem andailed information on the use of each command (with examples).
Volumes
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 15/395
INTRODUCTION TO DQL ADVANCED PROCESSING
TYPOGRAPHICAL CONVENTIONS
In the Text
The narrative text is printed in Roman type (this paragraph is
printed in Roman type). The names of forms are printed in
UPPERCASE type (CUSTOMERS. INVOICES). The names of
fields are printed in SMALL CAPITALS (LAST NAME. ACCOUNT
BALANCE). DQL terms are printed in lowercase bold type (for,
list records, all, data-entry, etc.). When the value in a field (rather
than the name of the field) is meant, it is not capitalized (e.g., the
customers names).
Queries and report output are printed in Helvetica type as shown
below:
Query Report Output
for STATES ;Alabama
list records Alaska
STATE NAME in order
.
Arizona
end Arkansas
Wyoming
The notes printed in the margins contain important information on
DQL syntax, menu options, and function key assignments. These
notes can also be used as a quick way to browse through the text.
On the Screen
In Interactive Mode, DataEase displays DQL terms in lowercase
letters. The names of forms and fields are automatically entered in
the case that was used in defining the form. When you are creating
a queryin Edit Mode, however, you can use upper or lowercase for
any part of the query.
When you create a query, DataEase adds certain spacing and
indenting automatically. You can use different indenting and
spacing if you like. DataEase doesn't care how commands are
spaced as long as the syntax is correct.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 16/395
DATAEASE REFERENCE MANUAL
Chapter 2
Defining, Modifying, andRunning Procedures
hen you select DQL Advanced Processing (Option 4)
from the DataBase Main Menu, DataBase displays the
DQL menu.
ocedures
1. Run ProcedureZ. Start Neu Procedure
3. Define Data-entry Fopm^iijam-niaar5. Define Fornat6. Define Print Style7. Saue Procedure8. Load Procedure9. Delete Procedure10. Print Procedure Definition
^=[] to [E = Bi = lili™ = \:iMtMll = gjg]
SC ^ij F9 3 C:\DEASE\TUTORIftL\ Database 1 4/17/89 10:12 an
Figure 2- 1 -- The DQL Menu
he DQL menu is the starting point for all actions that utilize the
ataBase Query Language. It's the primary tool that let's you
fine, modify, save, and run (execute) DQL procedures.
he DQL menu is similar to the QBE - Quick Reports menuscussed in Volume 1 , Chapter 3. There are ten options on the
DQL menu. Of these, eight are named and function like their
ounterparts on the QBE - Quick Reports menu. The two different
ptions on the DQL menu are Define Data-entry Form (Option 3)
nd Define Query (Option 4).
The DQL menu is the starting
point for defining, modifying,
running, loading, saving, anddeleting procedures and fordefining the Data-entry form.
Format, and Print Style for a
procedure.
-1 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 17/395
DEFINING, MODIFYING, AND RUNNING PROCEDURES
The Define Data-entry Form option on the DQL menu has no
counterpart on the QBE - Quick Reports menu. It is just one of the
many features that make DQL Advanced Processing far morepowerful and versatile than Quick Reports.
The Data-entry form is a special data input form you create that lets
you generate different information each time you run a procedure.
For example, if you have a procedure that lists all the employees in
your company, you can define a Data-entry form with just one field
called DEPARTMENT. Then, just before running the procedure, you
can enter the name of any department on the Data-entry form.
When you run the procedure, DataEase lists only the employees for
the specified department.
For convenience, DataEase lets you redisplay the Data-entry form
each time the procedure is executed. This lets you run the
procedure as often as you want, using different input each time.
Using this technique you can easily generate a separate report for
each department in the company simply by entering the name of
each department, one-at-a-time, on the Data-entry form.
Although you define and save a Data-entry form like a regular
Record Entry form, the information entered on a Data-entry form is
only used to process the current procedure - it's never stored in the
database. Think of it as a blackboard on which you enter the
specific data you want DataEase to process. After the procedure
runs, DataEase erases the blackboard and you can then specify
different data before running the procedure again.
The Data-entry form is aspecial data input form youcreate that lets you generate
different information each
time you run a procedure.
DataEase provides three w
to input information in aprocedure: the Data-entry
form and the DQL input anrecord entry commands.Each of these commands is
compared with the Data-entry
form later in this section aneach has a separate entiy
the DQL Le.xicon.
The Define Query option on the DQL menu replaces two options
on the QBE - Quick Reports menu: Define Record Selection (option
3) and Define List Fields (option 4).
The query is the set of instructions that tells DataEase where to find
the data to process and what to do with that data. It is composed of
a series of statements that use the DQL vocabulary and syntax to
communicate these instructions. In order to process any information
in a database, a query must tell DataEase three things:
• What form (or forms) contain the data to process.
• Which records to process in each form.
• What actions to perform using the selected records.
The query is the set ofinstructions that tells
DataEase where to find the
data to process and what t
do with that data. A querymust tell DataEase three
things: what form (or forms)contain the data to process:
which records to process in
each form: and what actions
to perform using the selected
records.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 18/395
DATABASE REFERENCE MANUAL
QUICK SUMMARYOF THE DQL MENU OPTIONS
. Run ProcedureRun Procedure processes the procedure loaded in the computer's
memory. If there is no procedure in memory, DataBase prompts
ou to select one froma
menuthat lists all the procedures available
n the database.
. Start New Proceduretart New Procedure removes a previously loaded procedure from
memory. Use this option when you want to create a new procedure,
r you want to remove the procedure that's currently in memory.
. Define Data-entry FormDefine Data-entry Form lets you define a special input form to be
used at the start of a particular procedure. A Data-entry form is
defined and filled in just like a Record Entry form. It's most often
used to produce different output each time the procedure is run.
Once you have defined and saved the Data-entry Form as part of
procedure, this menu option changes to Modify Data-entry Form.
4. Define QueryDefine Query gives you access to the DataBase Query Language.
Using the DQL, you create a query that can either ask a question,
manipulate data, generate output, or chain together any number of
eparate data management operations. When you select DefineQuery, you can use either Interactive Mode or Edit Mode to define
he query. Once you have defined and saved the query as part of a
procedure, this menu option changes to Modify Query.
5. Define FormatDefine Format lets you control the appearance of report output.
You can select one of nine predefined report formats, modify an
existing format, or create a custom format on the screen. If you
skip this step, DataBase automatically creates a columnar report
using field names as columnheadings.
Onceyou have defined and
saved the format as part of a procedure, this menu option changes
to Modify Format. Chapter 5 in this volume provides detailed
information on how to format printed reports.
DataBase has nine predefined
report formats includini^:
columnar, field per line,
record-entry, template, export,
custom, mailing label,
GrafTalk. and CrossView.
2-3 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 19/395
DEFINING. MODIFYING. AND RUNNING PROCEDURES
6. Define Print Style
Define Print Style lets you control the type style, page size, and
destination of the report output. The output can be sent to the
screen, a printer, or a disk file. The default destination is the
screen. Once you have defined and saved the Print Style as part
of a procedure, this menu option changes to Modify Print Style.
7. Save ProcedureSave Procedure lets you permanently save a procedure as part of
the database. When you select this option, DataEase prompts you
to name the procedure. If the procedure is already named,
DataEase asks whether you want to replace the original version
with the current procedure or give the current procedure a different
name (saving both).
8. Load ProcedureLoad Procedure lets you load a previously created procedure into
memory to either view it, modify it, or run it. DataEase displays a
list of all the existing procedures in the database. Specify the
procedure you want to load by entering its name or the
corresponding number from the list.
9. Delete ProcedureDelete Procedure lets you permanently delete (erase) a procedure.
DataEase displays a list of all the existing procedures in the
database. Specify the procedure you want to delete by entering its
name or the corresponding number from the list. You are asked to
verify that you want to delete the procedure before it is removed
from the disk.
10. Print Procedure Definition
Print Procedure Definition creates printed documentation for the w , , • ,. . , , , , \.. . . , p ,
You can quicklv and easilyprocedure. It includes the query detmition, the report tormat, and generate a printed conv othe layout and field characteristics of the Data-entry form, if one ///// definition of any DQLhas been created for the procedure. Procedure.
NOTE: Detailed e.xplanations of all these options except
Define Format and Define Print Style begin on the
ne.xt page. For the explanation of these two options,
refer to Chapter 5 in this volume.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 20/395
DATABASE REFERENCE MANUAL
Run Procedure
How To Execute a Procedure
he Run Procedure option processes the procedure currently loaded „ „ j ,
^ ,,- , , • Run Procedure executes thethe computer s memory. If there is no procedure m memory, procedure that's currently in
ataEase displays a list of all the procedures in the current database memory.
r you to select the one you want to run.
When you select Run Procedure, DataEase prompts:
Please select the procedure to run:
nd displays the names of all the Quick Reports and DQLrocedures in the database in a window menu on the right side
f the screen.
When you press RETURN, DataEase may display a special input
creen (such as a Data-entry form) depending on how the procedure
defined. These input screens are labelled for easy reference. For
e explanation of how to use any of them, see the corresponding
ction in this volume.
While executing a procedure, DataEase displays the following
message in the upper right comer of the screen:
Running procedure PROCEDURE NAME
When the procedure is finished, the DQL menu reappears. If you
want to abort the procedure before it is finished, press ESC.
NOTE: You can select a DQL Procedure (or any menu item)
hy typing its number, moving the hii>hlight cursor, or
typing the name of the procedure. As you are typing
the name. DataEase highlights the first unique
match. Press RETURN to select the highlighted
item.
2-5 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 21/395
DEFINING, MODIFYING. AND RUNNING PROCEDURES
Start New Procedure
How to Start a New Procedure
The Stan New Procedure option removes the procedure currently
in the computer's memory so you can define, load, or run a
different procedure. Once a procedure has been loaded into
memory, you must use this option before you can define another
procedure.
When you select Start New Procedure, DataBase displays the
message:
New Procedure Started
in the upper right comer of the screen. DataBase removes the
procedure that's currently in memory (if any), and the Define
Data-entry Form option is highlighted. You can select this option
to define a Data-entry form or choose any other option that you
want.
NOTE: You must select the Start New Procedure option
before you can run any procedure that includes a
.call command.
Start New Procedure remo
the procedure that's currentlin memorv.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 22/395
DATAEASE REFERENCE MANUAL
Define Data-Entry Form
What Is a Data-entry Form?
The Data-entry form is a special type of form that lets you enter
varying information each time you run a procedure. The Data-entry
form is part of the procedure, just like the query definition and the
eport format. You can create only one Data-entry form for each
procedure. However, you can use the DQL input or record entry
commands to allow muhiple input forms for a procedure.
The infomiation entered on the Data-entry form is often used to
elect the records processed by a query. For example, if you have a
query that lists customers in all 50 states, you can specify the nameof just one state on the Data-entry form and limit the resulting
eport to customers in the specified state. Figure 2-2 shows a
Data-entry form that lets you specify a particular state
ach time you run this procedure.
The Data-entry form is aspecial form that lets youinput varyini^ informationeach lime you run a procedure.
orn: R 9 C 62
Data Entry Forn For Current Balance Report
Run procedure for CUSTOMERS uho Hue in State:
4«iiii;ni«a EsciaBii Fzama F3Bin FsBiiiB F6i3°Hn FTtiiaiwa fbii:hki Fiaiiiaiii:
Figure 2-2 - Data-entry Form Used to Specify a Single State
When the procedure runs, it uses the information entered in the
STATE field on the Data-entry form and lists the customers for only
he specified state.
-7 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 23/395
DEFINING. MODIFYING. AND RUNNING PROCEDLRES
Define Data-Entry Form
How To Display the Data-entry Form
To create the Data-entry form, select Define Data-entry Form(option 3) from the DQL menu. DataBase asks:
After running the procedure, display data-entry form again?
• Answer no if you only want to run the procedure once
(rather than several times using different input information
each time). If you answer no, when you run the procedure, the
Data-entry form appears on the screen once at the start of the
procedure and you enter the specific data to be used in
processing the query. When the procedure ends, DataBase
returns to the DQL menu.
• Answer yes if you want to run the procedure more than once
before performing any other task. If you answer yes, each time
the procedure is completed, the Data-entry form reappears and
you can enter different data to be used in processing the query
as many times as you want. When you finish running the
procedure, press ESC when the Data-entry form reappears to
return to the DQL menu.
Select Define Data-entry
Form to create the Data-en
form.
If you tell DataBase to dis
the Data-entry form whenprocedure finishes executing
you can run the procedureover and over, using differe
data each time.
NOTE: The Data-entry form is used to input data at the start
of a procedure. In addition, the DQL input
command can he used to input data at any point
during a procedure. For more information about the
input command, see the DQL Lexicon.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 24/395
DATABASE REFERENCE MANLIAL
Define Data-entry Form
Creating the Data-entry Form
Regardless of how you choose to display the Data-entry form,
DataBase displays a blank screen on which you define the
Data-entry form. In general, you define the Data-entry form theame way you do a Record Entry form. However, because thenformation on the Data-entry form is not stored in the database (as
Record Entry information is), the Data-entry form ra/wor contain:
• Indexed fields
• Unique fields
• Sequenced fields
• Virtual fields
• Fields with security level options
• Subforms
all other aspects, defining the Data-entry form is exactly theame as defining a Record Entry form. You type in the form text,
nd you press FIO FIELD to define fields on the form.
You can also use the F5 COPY key to create a Data-entry form byopying an existing Record Entry form or copying individual fieldsom the Dictionary form. See Volume 2, Chapter 2. Formefinition and Relationships, for more information on how tofine a form.
A Data-entry form is definedexactly like a Record Entry
form.
To save time, you can use the
F5 COPY key to create aData-entiy Form hy copvini;
an existing Record Entry form.
9Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 25/395
DEFINING. MODIFYING, AND RUNNING PROCEDURES
Define Data-entry Form
Using the Data-entry Form
When you run a procedure that has a Data-entry form, the values
you enter on the Data-entry form are used according to the
instructions in the query. Each time the procedure is run, DataBase
displays the Data-entry form, lets you type in data, and then uses
this data to process the query.
In addition to selecting the records to be processed by a query, a
Data-entry form can also be used to specify:
• Data to be entered or modified in one or more database forms
• Variables used in computations
• Data used in conditional processing
• Data to be printed in report output
The Data-entry farm canused to select, enter, modify
or delete records in the
database: input variables
in computations: insert da
the report output: and in
other ways that help automroutine data-entiy and rec
processing operations.
Using a Relationship to Specify Data-entry ValuesIf you define a relationship between a Data-entry form and another
database form, you can use a Lookup formula to automatically
transfer information from the database form to the Data-entry form.
For example, you can define a relationship between a form that
holds the sales tax rate for each state and a Data-entry form. Then,
when you enter the state to process, the sales tax rate for this state
can be transferred to the Data-entry form each time the procedure is
executed.
You can use a relationship
lookup data in a database
form and insert it in the
Data-entry form.
Specifying Data-entry Values in a QueryIn a query, you tell DataEase to use the field values on the
Data-entry form by placing the keyword data-entry before the
field name. For example, the query statement:
for CUSTOMERS with statelist records
data-entry state ;
tells DataEase to list only the customers who live in the state
specified in the STATE field on the Data-entry form.
The keyword data-entry
DataEase to use the specifi
value from the Data-entiy
form when processing the
query.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 26/395
DATABASE REFERENCE MANUAL
Define Data-entry Form
Alternatives to Using tlie Data-entry Form
The Data-entry form can only be used to input data at the start of a
rocedure. DataEase offers two other data-input methods in
ddition to the Data-entry form.
The DQL record entry command allows records to be entered into
Record Entry form at any point during a procedure. The recordsre directly entered into the database; they are not processed by the
uery.
he DQL input command also lets you use a Record Entry form tonput information. It may be used at any point during a procedure.he input statement provides all the facilities of Record Entry, and
lets the query process the records before they are entered into theatabase.
he differences between the three data input methods are
ummarized in the table below.
DataEase offers two datainput methods in addition to
the Data-entry form: the DQLinput and record entry
commands. For detailed
information on each, see the
DQL Lexicon.
Data InputMethod
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 27/395
DEFINING, MODIFYING, AND RUNNING PROCEDURES
Define Data-entry Form
Saving the Data-entry Form
After you finish creating the Data-entry form, press F2 SAVE to
save it. When you press F2, the Data-entry form is saved on disk
as part of the procedure.
The information entered into a Data-entry form, however, is never
saved on disk; it is only saved in the computer's temporary
memory. The information is erased whenever you start a newprocedure or load a different procedure into memory.
Recalling Data-entry ValuesWhen the Data-entry form reappears after the procedure is run, it is
completely blank. Press SH-F5 to recall the Data-entry informationthat was just used by the procedure. Press SH-F6 to recall only the
value for the field in which the cursor is located.
Press F2 SAVE to save the
Data-entry form on disk as
part of the procedure.
The Data-entry formdefinition can he saved ondisk: Data-entry values ar
never saved.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 28/395
DATAEASE REFERENCE MANUAL
Modify Data-entry Form
Modifying the Data-entry Form
After the Data-entry form is created and saved, the DQL menuption Define Data-entry Form changes to Modify Data-entry
Form. When you select this option to view or change the
Data-entry form, DataBase first asks:
Delete the Data-entry Form?
• Answer no to view or modify the Data-entry form.
• Answer yes if you want to delete the existing form and/or
define a new Data-entry form. The form is deleted and the
DQL menu remains on the screen.
f you answer no, DataBase asks:
After running the procedure, display data-entry form again?
Answer no or yes depending on whether you plan to run the
rocedure again using different data-entry input each time.
When the Data-entry form is displayed, you can modify it just the
way you modify a Record Entry form. Remember, however, if you
dd or delete fields on the Data-entry form, you must also modify
he query to reflect those changes.
Modify Data-entry Form is
used to modify or delete the
Data-entty form itself.
You modify the Data-entry
form just the way you modifya Record Entry form. If youadd or delete fields on the
Data-entry form, you mustalso modify the query to
reflect those changes.
2-13 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 29/395
DEFINING, MODIFYING. AND RUNNING PROCEDURES
Define Query
The DataEase Query Language (DQL)
The DataEase Query Language (DQL) is a powerful group of
commands that let you ask questions or tell DataEase how to
manipulate the information stored in your database. These questions
and sets of instructions are called queries or procedures.
A query can be simple and direct (e.g., how many of our customers
live in Connecticut?), or it can be more complex (How many units
of a particular catalog item were sold in December? What was the
total value of these sales, and what percentage of that total was
purchased by customers from New England?). The answer (which
is often a list of items that meet all the criteria of the query) is
called a report.
But DataEase can do more than answer tough questions A moresophisticated use of the DQL Advanced Processing capabilities
might be a set of instructions that tells DataEase: when the user
named Carol signs on to the database named DAILY after 5:00
P.M., run the procedure that posts the day's transactions into
several related database forms, print the corresponding invoices andshipping labels, and generate a list of inventory items that have to
be reordered.
The DataEase QueryLanguage is used to define
questions and sets ofinstructions called queries
DQL procedures.
DQL OutputMany DQL procedures generate output. For example, when you
run a procedure that contains a list records command, DataEase
processes the query and generates output - a list of records selected
by the query. Output can be displayed on the screen, printed, or
saved as a file. A visible form of output, particularly when printed
on paper, is commonly called a report. Chapter 5 in this volumeprovides detailed information on how to format report output.
Some procedures create output that is tiot visible. A query that
modifies records in the database, for example, may or may not
display the modified result. There are also procedures that do notgenerate any output. For example, a query that deletes a group of
records does not generate output.
DQL output that is saved in a disk file can be converted by one of
the DataEase export formats for use by other programs such as
WordPerfect and Lotus 1-2-3.
The output from a DQLProcedure can he sent to
of three destinations: the
computer screen, a printer,
a file saved on disk. Visible
output printed on paper is
called a report.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 30/395
DATAEASE REFERENCE MANUAL
Define Query
Interactive Mode
When you select Define Query. DataBase automatically enters
teractive Mode. In this mode, DataEase prompts you through
ach step of creating a query; it lists all the valid responses for each
rompt, offering only syntactically appropriate commands or values
nd eliminating needless typing.
Interactive Mode, you choose the appropriate forms, fields,
ommands, functions, and operators to create a query from a series
f menus that appear on screen. Figure 2-3 shows one menu that
ppears in Interactive Mode.
R 4 C
ecify the iteMs to be listed.lect field nane
3 This is a Processing procedure
Spouse 3: Street 4: City 5: State b: ZipCUSTOMERS
h CURRENT Balancerecords
sea
«lll lilj RSr iaaii Fi rilSra FS W^lll OUERV LEUEL [^^1 MODE IliUJJ-.IJIUia
Figure 2-3 - Interactive Mode Screen
//( Interactive Mode.DQLautomatically checks the
syntax and spelling in a query.
This lets you concentrate onthe business at hand rather
than programming details.
Changing l\/lodes
addition to Interactive Mode, DataEase provides an Edit Modeat lets you enter DQL query statements without the assistance of
nteractive prompts and menus.
To switch from Interactive Mode into Edit Mode, you simply movee cursor toward the left or the top of the screen. To switch from
dit Mode to Interactive Mode, press Fl INTERACTIVE.
Move the cursor up or towardthe left side of the screen to
change from Interactive Modeinto Edit Mode. Press FlINTERACTIVE to changefrom Edit Mode to Interactive
Mode.
-15 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 31/395
DEFINING. MODIFYING, AND RUNNING PROCEDURES
Define Query
Interactive Mode Prompts and Menus
Throughout the process of creating a query, DataBase displays
prompt messages near the top of the screen that tell you what action
you are trying to accomplish, such as:
Specify the items to be listed.
Select field name
0: NONE 1 : CUSTOMER NAME 2: ADDRESS 3: CITY 4: STATE 5: ZIP F1 MORE
Beneath the prompt, DataBase displays a numbered line menu of all
the valid responses to this prompt; in this case, it displays a list of
all the field names defined in your database form (e.g., CUSTOMERNAME, ADDRESS, STATE, ZIP). If there are too many choices to fit
on one line, press Fl MORE to display the rest of the choices in a
window on the right side of the screen.
When you choose a value from the menu, it is automatically
inserted into the query at the current cursor location.
How To Bypass Interactive Mode l\1enus
For each prompt, DataBase displays a numbered list of valid
choices. In many cases, the first choice listed is 0: NONE. If you
don't want any of the menu items shown, enter to select NONE.Alternatively, you can press TAB to bypass the current menuchoices and access the next menu.
Some prompts ask you to enter information (text or a numeric
value) instead of simply selecting a menu item. To bypass such a
prompt, always press TAB.
When you're prompted to enter a constant value, is treated as a
valid numeric response (instead of 0: NONE). For this reason, werecommend that you use TAB (instead of 0) whenever you want to
skip a menu choice.
When all available choicesdon't fit on a single line mpress Fl MORE to open awindow menu of choices.
Many prompts cause a serie
of menus to appear. If the
choice you want is not on
first menu, you can skip to
next menu by pressing TAB
To cycle through all the min Interactive Mode, press
TAB once for each menu ywant to bypass.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 32/395
DATABASE REFERENCE MANUAL
Define Query
Typing DQL Commands in Interactive Mode
ou can type letters, words, and punctuationsymbols in Interactive
Mode instead of waiting for a prompt. For example, you can type a
micolon or a period where such punctuation is required, instead
repeatedly pressing TAB until the menu that offers that
unctuation symbol appears.
you type DQL words or symbols ahead of the prompting,
ataBase immediately displays the appropriate prompt.
When typing commands in Interactive Mode, never type numbersnless prompted to do so; DataBase treats a number as a menulection in Interactive Mode.
OTE: When you type ahead of the prompting, you must
type complete words and symbols and insert the
required spaces yourself. DataBase does not
complete a word for you even if it is uniquely
spelled.
If you're familiar with theDQL. you can always type
ahead of the prompts in
Interactive Mode. However,never type numbers unless
prompted to do so: DataBasetreats a number as a menuselection in Interactive Mode.
17 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 33/395
DEFINING, MODIFYING. AND RUNNING PROCEDURES
Define Query
High Level and Low Level
Interactive Mode is divided into two levels: a low level for basic
querying, and a high level that lets you perform sophisticated
transactions and chain together multiple database management
procedures. Press F9 LEVEL to change from one level to the other.
Low Level lets you retrieve information from the database, but not
add, modify, or delete records. Low Level also lets you use the
Data-entry form, current system values (such as current time) and
the DQL relational operators. The DQL relational operators
let you retrieve information from related forms in the database.
High Level gives you access to the full power of the DataEase
Query Language, including mathematical operations, 58 built-in
functions, and procedural and non-procedural commands that let
you create complex reports and sophisticated transactions. In High
Level, DataEase can automatically add, delete, and modify records;
post information into multiple forms; and handle point-of-sale
processing, billing, inventory recordkeeping, and other automated
transaction processing requirements.
When you select Define Query on the DQL menu, DataEase
automatically enters Low Level Interactive Mode and displays the
DQL for command in the upper left comer of the screen. If you
want to erase this default command and restart the query in High
Level Interactive Mode, follow these steps:
1
.
Press HOME to move the cursor to the upper left comer of
the screen. DataEase switches from Interactive Mode into
Edit Mode (explained on the next page).
2. Press F7 DEL to delete the for command.
3. Press F9 LEVEL to switch into High Level.
4. Press Fl INTERACTIVE to return to Interactive Mode.
You can now define a High Level query with the help of
DataEase's Interactive menus.
Interactive Mode is divided
into Low Level and HighLevel. Press F9 LEVEL to
change from one level to
another.
Low Level lets you askquestions and report the
ansM'ers. but you cannot ad
modify, or delete records frothe database. High Level let
you link together procedures
and build powerful customapplications.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 34/395
DATAEASE REFERENCE MANUAL
Define Query
Edit Mode
When you select Modify Query from the DQL menu, DataBase
utomatically enters Edit Mode. In Edit Mode, you type the query
rectly on a blank screen. DataBase does not prompt you with
menu choices. Edit Mode can be much quicker than Interactive
Mode when you are familiar with the DQL and know exactly what
ou want to do.
dit Mode can be used to create a query or modify a previously
efined query. In Edit Mode, you can freely move the cursor
round the screen and type specific DQL statements more rapidly
han selecting choices from the Interactive Mode menus. For this
eason, many experienced users work mainly in Edit Mode andwitch to Interactive Mode to quickly select form and field names if
hey want help from the prompts.
To create a query in Edit Mode, first select Define Query from the
DQL menu. When the first prompt appears, simply move the cursor
oward the left side of the screen. The prompt disappears and
DataBase switches into Edit Mode. Now you can just start typing
n the query on the blank screen. If you can't recall the correct
DQL syntax, press Fl INTERACTIVE to switch into Interactive
Mode and bring the prompts up to help you.
dit Mode is also used to correct mistakes, add comments, or copy
locks of text. If you make an error or want to change a query
while working in Interactive Mode, just move the cursor up or left
o switch into Edit Mode. In Edit Mode you can backspace, type
ver mistakes, add comments, and use the function keys F3 CUT,F5 COPY, F6 PASTE, F7 DEL LINE, and F8 INS LINE exactly as
ou do in Form Definition. To return to Interactive Mode, press
l INTERACTIVE, and the prompting resumes immediately.
Syntax Errors
DataBase helps you create queries by preventing you from saving a
uery that contains a syntax error. DataBase checks the entire
uery and places the cursor on the first syntax error it detects. All
yntax errors must be corrected before a query can be saved.
Edit Mode is used to create a
query, nwdify a query, addcomments, or correct errors
made while working in
Interactive Mode.
Move tlie cursor up or towardtlie left side oftlie screen to
change from Interactive Modeinto Edit Mode. Press
El INTERACTIX'E to cliange
from Edit Mode to Interactive
Mode.
You can annotate your queries
in Edit Mode. See Commentsin the DQL Lexicon for anexplanation oflww to addcomments to a query.
If you press F2 SAVE to save aquery that contains an error.
DataEase automatically
switches to Interactive Modeand positions the cursor on the
first error.
2-19 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 35/395
DEFINING. MODIFYING. AND RUNNING PROCEDURES
Modify Query
Modifying a Query in Edit Mode
After you define a query. Option 4 on the DQL menu changes from
Define Query to Modify Query. When you select Modify Queiy,
DataEase begins in Edit Mode when the query displays on the
screen.
In Edit Mode you can make any changes you want using the
appropriate keys to insert, delete, and alter text (including the
function keys F3 CUT. F5 COPY. F6 PASTE. F7 DEL LINE, and
F8 INS LINE). If you need prompting, move the cursor to the
problem and press Fl INTERACTIVE to switch to Interactive
Mode.
When you finish modifying the query, press F2 SAVE to save the
modified query and return to the DQL menu.
Copying From One Query to AnotherDataEase lets you define up to 2,000 procedures per database.
As your list of procedures grows, you may find it convenient to
copy part or all of a query and use it in another query. DataEaseprovides two ways to do this:
• For convenience, DataEase lets you copy all or part of an
existing query and use it as a starting point for a new query oras an addition to another existing query. While the first query
is displayed, use F5 COPY to copy all or part of it, and then
exit this procedure. DataEase prompts:
Do you want to Paste Block in another Query?
Answer yes to this prompt. Now load an existing procedure or
start a new procedure, and select Modify Quer\' (or Define
Query). Then use F6 PASTE to paste the copy of the first
query into the second query.
OR
• Select Save Procedure and save the existing query under a newname. This lets you keep the original procedure intact as well
as use the new ly named copy as the starting point for defining a
new procedure.
In Edit Mode \ou can use
CUT. F5 COPY. F6 PASTE.F7 DEL LINE, and F8 INSLINE to insert, delete, andalter text.
For convenience, DataEaselets you copy all or part ofe.xisting query and use it asstarting point for a new queor as an addition to another
existing query.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 36/395
DATABASE REFERENCE MANUAL
Modify Query
How to Switch Modes
o switch from Interactive Mode to Edit Mode, simply move the
rsor toward either the top or the left side of the screen.
When you switch from Interactive Mode to Edit Mode, the
teractive prompts and menus are removed from the screen.
Edit Mode, you can easily make corrections or type in the
hole query without waiting for menu choices to appear.
o switch from Edit Mode to Interactive Mode, press Fl
NTERACTIVE.
When you switch from Edit Mode to Interactive Mode, DataEase
splays the appropriate menufor
the current cursorposition in the
uery.
Move the cursor up or towardthe left side of the screen to
chanf>e from Interactive Modeinto Edit Mode. Press FlINTERACTIVE to change
from Edit Mode to Interactive
Mode.
-21 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 37/395
DEFINING. MODIFYING. .AND R L N N I N G PROCEDURES
Save Procedure
Saving a Query In Memory
While you are working on a query, you can press F2 SAVE to save
what you have entered up till now. The following actions take place:
1
.
DataEase scans the query to be sure it is correct.
2. If there are any errors in the quer\'. DataEase returns
you to Interactive Mode w ith the cursor placed on the
first error it detects.
Press F2 SAVE to save a qin memory.
3. If there are no errors, DataEase returns to the DQLmenu from Low Level. In High Level. DataEase
places the cursor at the end of your work ready for
additional input.
When you press F2 SAVE, DataEase saves the query in memory: it
does not create a disk file. The query remains in your computer's
temporary memory until you start a new procedure, load a newprocedure, delete the procedure, or exit from the DQL menu. Tosave the query on disk, use the Save Procedure option on the DQLmenu as explained on the next page.
Automatic Syntax ScanIf you're in Interactive Mode. DataEase automatically scans the
query for errors and returns you to the DQL menu when youanswer the last appropriate prompt.
In Low Level Interactive Mode, when DataEase prompts:
Any more items to be listed?
if you press TAB (or select NONE), DataEase automatically scans
the query.
In High Level Interactive Mode, when DataEase prompts:
Select the desired action
if you press TAB (or select NONE), DataEase automatically scans
the query.
The Automatic Syntax Scan
feature checks the quetyforerrors and returns you to th
DQL menu as soon as youindicate that there are nomore list items (in Low Level
or no more actions (in HighLevel).
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 38/395
DATAEASE REFERENCE MANUAL
Save Procedure
Saving a Procedure On Disk
To permanently save the query on disk, select Save ProcedureSave Procedure saves aoption 7) on the DQL menu. DataEase prompts: procedure on disk. The nameof a procedure can he up la 20
Please enter the procedure name: characters in length.
The procedure name can be up to 20 characters long. It can be anyname you like, but all procedures and forms in the same database
must have unique names. After you specify the name and press the
RETURN key. DataEase saves the procedure on disk.
When you select Save Procedure, if the procedure was previously
aved, DataEase asks:
Do you want to save the modified procedure under anothername?
you answer yes, DataEase asks:
Please enter the new procedure name:
After you enter a new procedure name, the modified procedure is
aved under the new name. DataEase also retains the original
unmodified) procedure under the original name.
you answer no, DataEase saves the modified procedure under the
riginal name. The original procedure is deleted.
NOTE: When using DataEase on a Local Area Network,
if you attempt to save a procedure while any other
user is viewing or running it, DataEase displays a
Resource Conflict message. See Volume 2. Chapter
4, System Administration, for more information about
Multi-User operations.
'23 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 39/395
DEFINING, MODIFYING, AND RUNNING PROCEDURES
Load Procedure
Loading a Procedure into Memory
In order to view, modify, or run a previously defined procedure, Load Procedure loads a
you must load the procedure into your computer's temporary previously defined procedure
memory. '^ '' ' computer's memory.
To load a procedure, select Load Procedure (Option 8) on the DQLmenu. DataEase asks:
Please select the procedure to load:
DataEase displays the names of all the previously saved Quick
Reports and DQL Procedures in the current database in a windowmenu on the right side of the screen. You can load either a Quick
Report or a DQL Procedure.
DataEase displays the DQL menu. The DQL menu options that
begin with the word Define are changed from Define to Modify
for each part of the procedure that was previously defined (i.e..
Data-entry Form, Query, Format, Print Style).
Once a procedure is loaded you can choose any of the menuoptions to modify the procedure, including Modify Data-entry
Form, Modify Query, Modify Format, or Modify Print Style.
If you load a Quick Report from the DQL menu, DataEase asks:
Convert this QBE (Quick Report) into a DQL Procedure?
Answer yes to convert the Quick Report to a DQL Procedure. If
you answer no to this question, DataEase immediately exits from
DQL Processing and displays the QBE - Quick Reports menu.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 40/395
DATABASE REFERENCE MANUAL
Load Procedure
Converting a Quick Report into a DQL Procedure
Many powerful DQL features, including any of the functions or
lational statistical operators, can be added to a Quick Report
sing the Report Field Definition screen to enhance its output
apabilities.
n addition, DataBase lets you convert a Quick Report into a DQLrocedure with a single keystroke. Once it is converted, you can
se the procedure just like a procedure created with the Define
Query option on the DQL menu.
To convert a Quick Report into a DQL Procedure, either:
•Select Load Procedure (Option 8) on the DQL menu andspecify the name of the Quick Report.
OR
• With a Quick Report in memory, press the F9 DQL key.
Using either method, answer yes to the question:
Convert current QBE (Quick Report) into a DQL Procedure?
The DQL menu appears and the Quick Report definition is
onverted to a DQL query. The query can then be edited throughhe DQL menu Modify Query option.
NOTE: When you save a converted Quick Report as a DQLProcedure, the Quick Report is forfeited. To retain
both versions on disk, save the DQL Procedure
under a different name than the Quick Report. Also,
once you convert a Quick Report into a DQLProcedure, you cannot reverse the process to change
it hack into a Quick Report. See Volume 1 , Chapter
3, for complete information on Quick Reports.
You can create a DQLProcedure independently or
by converting a Quick Reportinto a DQL query. Forinformation on how to define aQuick Report, see Volume I
Chapter 3. Query By Example- Quick Reports.
The Query By E.xample formatused in Quick Reports can
automatically he convertedinto a DQL Procedure with a
sin,^le keystroke. This is a
good way to learn how to use
the DQL - convert a simple
Quick Report into a DQLProcedure and then view the
query.
2-25 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 41/395
DEFINING. MODIFYING. AND RUNNING PROCEDURES
Delete Procedure
Permanently Removing a Procedure
To permanently remove a procedure from the database, first select
Delete Procedure (option 9) on the DQL menu and then select the
procedure you want to delete from the windovv menu. DataEase
asks:
Please select the procedure to be deleted:
When you select a procedure to be deleted, DataEase prompts:
Are you sure you want to delete it?
If you answer no. the request is cancelled. If you answer yes. theprocedure is permanently removed from the database and cannot be
recovered.
Delete Procedure permanentlyremoves a procedure fromdatabase.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 42/395
DATABASE REFERENCE MANUAL
rint Procedure Definition
Printing the Definition of a Procedure
he Procedure Definition is a printed summary of the procedure
at is similar to the summary created by pressing SH-F9 PRINTForm Definition. The definition is composed of the following
our items:
1 . A copy of the query.
Print Procedure Definitionprints a summary of the
procedure that's currently in
memory, inchuUng the query,
the Data-entry form, the
format, and field descriptions.
2. A copy of the Data-entry form if one is defined for the
procedure.
3. A copy of the format as it would appear printed on an
80-column printer.
4. A description of each field included in the format.
The field description includes the Field Name, Type,
Length, and a yes or no answer indicating whether
leading and trailing spaces in the field are to be
removed when the output is displayed.
o print the definition of the procedure currently in memory, select
rint Procedure Definition (option 10) on the DQL menu. Whenou select this option. DataBase automatically sends the output to
e default printer. At the end of the output, DataBase lists the
mount of memory it requires to store the procedure definition.
An example of a printed Procedure Definition is shown in
igure 2-4 on the next page.
NOTE: The Print Procedure Definition cannot he used to
display the Procedure Definition on the screen.
If you select this option and there is no correctly
configured printer connected to the computer,DataBase displays an error message and cancels
the print command.
-27 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 43/395
DEFINING. MODIFYING. AND RUNNING PROCEDURES
Print Procedure Definition
Procedure Definition - Example
QUERY
for CUSTOMERSlist records
FIRST NAME ;
LAST NAME ;
ADDRESS
;
CITY ;
STATE :
ZIP .
end
FORMAT1 10 20 30 40 50 60 70 80
. —+ —+ —+. —+- —+. —+. —+—-+- —+—+ —+ —+ —+-+- —+- —
.Items
Name
Address
.end
- —+ —+—+ —+ —+—+—+—+—+- —+- —+- —+- —+- —+- —+- —1 10 20 30 40 50 60 70 80
FIELD DESCRIPTIONS
Mo
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 44/395
DATAEASE REFERENCE MANUAL
Chapter 3
Define Query:A Low Level Example
I
o demonstrate how to create a query in Low Level
Interactive Mode, we have defined two forms named
I
CUSTOMERS and INVOICES as shown in Figure 3-i. The
forms share a predefined relationship based on the linking
CUSTOMER # fiel d. Both forms store the same information in this
field: a unique number assigned to each customer.
CUSTOMERS
Field Names
1. CUSTOMER NAMEr ADDRESSo. CITY . STATE
. ZIP
. ACCOUNT BALANCE.. CUSTOMER #
Primary Form
INVOICES
Field Names
\ INVOICE #. DATE
^. CUSTOMER* . PART#
. DESCRIPTION
. QUANTITY,. COST EACH8. ORDER TOTAL
Secondary Form
Figure 3- 1 - Low Level Example Database Forms
The CUSTOMERS form is said to have a one-to-many relationship
to the INVOICES form. This means that for any one record in the
CUSTOMERS form, there may be many related records in the
INVOICES form (all the invoices that have the same CUSTOMER #).
The INVOICES form is said to have a many-lo-one relationship to
the CUSTOMERS form. This means there may be many records in
the INVOICES form related to any one record in the
CUSTOMERS form.
Starling on this page is astep-hy-step example that
demonstrates how to create
a query in Low Level
Interactive Mode.
As you read through this
example, you don't have to
actually perform the
keystrokes mentioned in the
text. Just mentally follow the
prompts, referring to the DQLLexicon for an explanation ofany terms yon don'
understand.
If you want to perform the
keystrokes, you have to first
define the forms and fields.
For information on how to
create forms, see Volume I
Chapter 2. Form Definition
and Relationships.
The example is based on the
forms shown in Figure .?-/.
The fields are numbered onthe DalaEase menus in this
example exactly as they're
numbered in this figure.
3-1 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 45/395
DEFINE QUERY: A LOW LEVEL EXAMPLE
THE PURPOSE OF THE QUERY: A REPORT
In this example, we want to generate a report that displays:
• The customers' names listed in alphabetical order.
• The date of each customer's most recent purchase.
• The balance each customer owes us.
The customers' names and account balance data are stored in the
CUSTOMERS form; the date of each purchase is stored in the
INVOICES form. To generate the report, we have to create a query
that tells DataEase to combine information from these two forms
and display the output as a screen report. Figure 3-2 is a sample of
the type of report output we want (although it hasn't yet been
alphabetized).
Sample Report Output
CUSTOMER NAME DATE OF PURCHASE ACCOUNT BALANCE
Jensen, DaveGomez, LouisFisher, JayCooper, MaryDavis, PamIvers, ClarkAdams, SamBaker, FredEvans, RickHill, Brenda
12/30/8912/20/8912/10/8912/24/8912/22/8912/18/8912/15/8912/27/8912/31/8912/19/89
$210.00S195.00;;350.00S725.00S175.00;;675.ooS595.00;;240.ooS865.00S525.00
Figure 3-2 —Account Balance Report
Figure 3-2 represents the type of report we want to generate, but it
includes only the customers who purchased something in
December. In our report, we want to know the date of each
customer's most recent purchase, regardless of which month it was.
WHICH RECORDS TO SELECT
As we create the query, we're also going to add selection criteria to
limit the report to only those customers who owe us more than
$500. In a query, the selection criteria tell DataEase which records
to select for processing. We want DataEase to select only the
Selection criteria tell
DataEase to select somerather than all the records
form when processing a qu
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 46/395
DATAEASE REFERENCE MANUAL
records in the CUSTOMERS form that have a value greater than
500 in the ACCOUNT BALANCE field.
In creating any query, we must tell DataBase at least three things:
• What form (or forms) contains the required data.
• Which records to process in each form.
• What action to perform on the selected records (in this
example, we want to list the information in those records in ourreport).
CREATING THE QUERY
To begin creating the query for the Account Balance report, select
Define Query (Option 4) from the DQL menu. DataBase switchesto Interactive Mode and displays the word for in the upper left
hand comer of the screen. The word for is a DQL command thatis always the first word in a Low Level query.
The for command tells DataBase from which form to gather
information for the report. If information is gathered from morethan one form, the first form specified in the query is called the
Primary form, and the other forms are Secondary forms.
The for command tells DataBase to select records in a particular
form and perform all the specified actions on each of those records.
After all the actions are performed for the first record, the nextrecord is read, and all the actions are performed again. Thiscontinues until all the records in the form have been processed.
Now, let's begin to create the query. On the screen, the promptline reads:
Select form name
The menu line lists the available forms from which you can pick:
1: SYSTEM 2: CUSTOMERS 3; INVOICES 4: INVENTORY F1 MORE
The DQL command for is
always the first word in a LowLevel query.
The for command tells
DataBase to select records in
a particular form and performall the specifed actions on
each of those records.
The first form named in aqueiy is called the Primary
form. A form related to the
query's Primary form is called
a Secondary form. A formrelated to a Secondaiy form is
called a Tertiary form, etc.
NOTE: These are the only forms used in the Low Level
example. The menu choices that appear in this first
example are valid only if you are defining a LowLevel query. In High Level, there are manyadditional prompts and commands.
3-3 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 47/395
DEFINE QUERY: A LOW LEVEL EXAMPLE
The form you select from this first menu is the Primary form for
the query. The Primary form should be the form that holds the key
data you want to view or manipulate. You can also access data in
forms that are related to the Primary form, as you'll see later in this
example.
The Primary form for this query is the form that contains the
customers' names, so select CUSTOMERS. DataBase adds the
form name after the for command. The query now reads:
for CUSTOMERS
Next, DataBase prompts:
Any record selection criteria?
and offers two choices:
The Primary form is the formthat holds the key data youwant to view or manipulate.
0: NONE 1 : with
DataBase is asking if you want it to use all the records in the
Primary form, or use certain criteria to select only some of them.
We only want to see some of the records - the records for
customers who have an account balance greater than S500.
You tell DataBase that you want to include selection criteria by
inserting the keyword with in the query. Select with to indicate
that you want to select only some records from the CUSTOMERSform.
Thequery reads:
for CUSTOMERSwith
DataBase displays another prompt:
Select field name
0: NONE 1 : CUSTOMER NAME 2: ADDRESS 3: CITY 4: STATE 5: ZIP F1 MORE
Now DataBase is asking for the name of the field on which the
selection criteria is based. We want DataBase to select only thosecustomers who owe us more than $500. In DQL, this criterion is
specified by the following statement:
The keyword with tells
DataBase that you want to
specify selection criteria.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 48/395
DATABASE REFERENCE MANUALACCOUNT BALANCE > 500
To insert this selection criterion into the query, first pressFl MORE to see the rest of the fields in the CUSTOMERS form.Now select account balance. The query reads:
for CUSTOMERSwith account balance
Now DataEase prompts:
Select a comparison operator or not'
2:> 3:< 4: <= 5: 6: between 7: not
DataEase is now asking us to specify exactly what selection criteria
we want to use to select records. Since we only want records forcustomers who have an account balance greater than $500,select > (the greater than symbol). The query reads:
for CUSTOMERSwith account balance >
DataEase displays another prompt:
Specify comparison value
Select field name
There are seven DQLComparison Operators:= {equals). > (greater than}.
< (less than), <= (less than orequal to). >= (greater than orequal to), between, and not.
We don't want to compare the current balance to a field value. Wewant to compare it to a numeric constant (500). Press TAB (or 0:
NONE) three times to skip the next three prompts until the
following prompt appears:
Specify a constant value
Enter a numeric string without punctuation. To skip hit TAB
Now DataEase is asking us to finish the selection criteria bycomparing the account balance to a specified numeric value.We want to see a list of customers who have an account balancegreater than S500. so type 500 and then press the Spacebar.
The query now reads:
for CUSTOMERSwith account balance > 500
After entering a constant valueyou must insert a space beforeyou make any additional menuselections or add any furtherstatements or punctuation to
the query. When typing acurrency value in a query, donot include the dollar sign.
3-5Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 49/395
DEFINE QUERY: A LOW LEVEL EXAMPLE
Next, DataBase asks if you want to specify any additional selection
criteria:
Any more criteria?
0: NONE 1 : and 2: or
To specify more selection criteria (such as only those whopurchased something last month) we'd select and and follow the
same procedure to specify the additional criteria. However, since
we don't want to specify further criteria, press TAB (or select
NONE). DataBase displays a different prompt:
Specify the items to be listed.
Select field name
0: NONE 1 : CUSTOMER NAME 2: ADDRESS 3: CITY 4: STATE 5: ZIP F1 MORE
Beneath the menu, the query reads:
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list records
Notice that when you selected NONE, DataBase automatically
added a semicolon (;) after the account balance value and inserted
the phrase list records on the following line. The list records
command is the only processing option available in Low Level -
you cannot enter, delete, or modify records in a Low Level query.
The list records command tells DataBase we're ready to list the
items we want to appear in the report output. Since we want an
alphabetical list of our customers, the first item we want in the
report output is the field customer name. Select customer nameand press RBTURN; DataBase inserts the fieldname customername on the next line after list records.
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list records
CUSTOMER NAME
The keywords and and or aused to combine different s
of selection criteria.
In Low Level, when you tell
DataBase there are no moreselection criteria, it
automatically places asemicolon at the end of the
statement and inserts the list
records command on the ne
line in the query.
The semicolon is a DQLsynta.x requirement: it marksthe end of the for statement
which specifies the queiy's
Primary form. You must inse
a semicolon at the end of th
for statement and after eachitem specified in the list
records section of the query.
The list records command t
DataBase which items to
display in the report output
each record processed by th
queiy. The most common ty
of list item is the name of afield.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 50/395
DATABASE REFERENCE MANUAL
Now, DataBase displays another prompt:
Specify the items to be listed.
Select records in groups or in a specific order?
0: NONE 1: in order 2: in reverse 3: in groups 4: in groups with group-totals
DataEase is asking in what order to list the customers' names. If wechoose NONE, DataEase lists the customers in the order in whichtheir records were entered into the database. If we choose one ofthe other options, DataEase lists the customers according to the
chosen option (explained below):
• in order sorts the records in ascending alphabetical order
(putting Adams ahead of Coolidge).
• in reverse sorts in descending alphabetical order (putting
Washington before Lincoln).
• in groups sorts the records in ascending order into groups that
have the same value in the specified field (for example, all the
Democratic presidents could be listed together as a group with
their names arranged in alphabetical order, followed by all the
Republican presidents).
• in groups with group-totals sorts records into groups and lets
you generate statistical totals for each group, such as the total
numbers of Democratic and Republican presidents.
For our alphabetized report, select in order.
The query reads:
for CUSTOMERSwith ACCOUNT BALANCE > 500
;
list recordsCUSTOMER NAME in order
The DQL Sorting andGroiipini> Operators can heused on any type of field: in
order sorts records in
sequence from least to
greatest value (least recent to
most recent, earliest to latest,
lowest choice number to
highest, etc): in reverse sorts
in the opposite sequence.
Refer to the DQL Lexicon fora more detailed explanation ofeach of these operators.
3-7 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 51/395
DEFINE Q L E R 'I- : A LOW LEVEL EXAMPLE
Although in this example we only need to sort our customers in
alphabetical order, sorting operators can be combined. If. for
example, we want to group the customers by state and also sort
their names in alphabetical order, we use:
STATE in groups ;
CUSTOMER NAME in Order :
When combining sorting commands in a query, items sorted in
groups are listed before items sorted in order. Figure 3-3 shows
a portion of two separate queries: the customers sorted in order by
name in Query 1 on the left, and the combined alphabetical sorting
and grouping by state in Query 2 on the right.
In a query, always list items
groups before in order.
Query 1 Query 2
CUSTOMER NAME in order STATE in groups :
CUSTOMER NAME in order
Report Outputs
Adams, SamBaker, FredCooper, MaryDavis, PamEvans, RickFisher, Jay
Gomez, LouisHill, BrendaIvers, ClarkJensen, Dave
AlabamaAdams, SamIvers, Clark
AlaskaCooper, MaryJensen, Dave
Arizona
Baker, FredEvans, RickFisher, JayGomez, Louis
Fiaure 3-3 - Sort Commands
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 52/395
DATAEASE REFERENCE MANUAL
Returning now to our example, the query reads:
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list recordsCUSTOMER NAME in order
DataBase prompts:
Any more items to be listed?
and offers two choices:
0:NONE 1: ;
If you select NONE, DataBase automatically inserts a period after
the in order statement and scans the query. If no errors are
detected, the query is saved in memory and you are returned to the
DQL menu.
If your query is not finished select ; (semicolon). A semicolon is
inserted after the in order statement and you can continue to list
more items.
For now, select the semicolon; the cursor moves to the next line
and we again see the prompt:
Specify the items to be listed.
Select field name
DataBase is now asking if we want to list any other items in the
report. We want to list the most recent date each customer placed
an order, but that information doesn't appear on the menu because
it's not in the CUSTOMERS form (it's in the INVOICES form).
However, because the INVOICES form is related to the Primary
form CUSTOMERS, we can access any information we need on
the INVOICES form.
//( Low Level, when you tell
DiitaEase there are no moreitems to he listed, it
automatically inserts a period
and then scans the query fin-
syntax errors.
3-9 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 53/395
DEFINE QUERY: A LOW LEVEL EXAMPLE
To get the order date information, we have to tell DataEase to use
the INVOICES form. So instead of selecting any of the displayed
fields, press TAB twice to skip this menu and the next. DataEase
generates a different prompt:
Select a relational operator
Beneath this prompt, DataEase displays a menu of seven operators.
0: NONE 1 : all 2: any 3: count of 4: highest of 5: lowest of 6: sum of F1 MORE
These relational operators let you retrieve information from a form
related to the Primary form (similar to pressing FIO MULTI whenyou define list fields in a Quick Report). Each option is fully
explained in the DQL Lexicon.
The information we want to retrieve is the most recent invoice for
each record selected from the CUSTOMERS form. BecauseDataEase treats dates as a series of progressive numbers, the most
recent date is the highest number in the sequence of DATE values.
So, to tell DataEase to f ind the most recently dated invoice for each
customer, first select the highest of relational operator. The query
reads:
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list recordsCUSTOMER NAME in Order
;
highest of
This tells DataEase:
Read all the records in the related form (which we're about to
specify) and report the highest value in the field (which we're also
going to specify) among those records. The next few prompts will
ask us to specify the name of the related form and the field from
which we want the highest value (most recent date) reported.
The DQL Relational
Operators (all. any, counthighest of, lowest of sumand mean of) let you access
information in related forms.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 54/395
DATABASE REFERENCE MANUAL
First DataEase asks us to specify the related form:
Specify the items to be listed.
Select a predefined relationship?
and offers a menu listing the related forms in the database:
0: NONE 1: INVOICES
The information we want is in the INVOICES form, so select
INVOICES. The form name is added to the query:
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list recordsCUSTOMER NAME in order ;
highest of INVOICES
Next. DataEase prompts:
Specify the items to be listed.
Specify any additional relationship criteria?
0: NONE 1 : with
Primary form.
DataEase is now asking if we want to specify additional criteria to Selection criteria can he used
determine which records to select in the related form. We want ' •^'^'^^'' '^' ''^^ ' 'elated
DataEase to read all the related INVOICES records and find the ^p' ^.Z Z'l ' ' '^
most recent invoice for each selected customer. Therefore, select
NONE or press TAB. DataEase prompts:
Specify the items to be listed.
Select field name
0: NONE 1: INVOICE # 2: DATE 3: CUSTOMER # 4: PART # F1 MORE
Now DataEase is asking us to specify which field on the
INVOICES form to look at for the highest value. Select date. Thefield name is added to the query which now reads:
3-11 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 55/395
DEFINE QUERY: A LOW LEVEL EXAMPLE
for CUSTOMERSwith ACCOUNT BALANCE > 500 ;
list recordsCUSTOMER NAME in order ;
highest of INVOICES date
DataBase next asks if we want the records sorted by the values in
the DATE field:
Select records in groups or in a specific order?
We want to list the most recent invoice date, not sort the records in
chronological order, so press TAB to skip this menu. Keep
pressing TAB to bypass the menu choices until DataBase prompts:
Any more items to be listed?
and displays two choices:
0:NONE1:
We want one more i tem: the account balance owed by each
customer, so select ; (semicolon).
Since we bypassed further choices from the INVOICES form, the
next prompt refers us to the CUSTOMERS form again:
Select field name
0:NONE 1 :CUSTOMER NAME 2:ADDRESS 3:CITY 4:STATE 5:ZIP F1 MORE
In order to include the account balance information in the report,
press Fl MORE and select account balance again.
After this press TAB in answer to each prompt until you reach:
Any more items to be listed?
Note that usini> afield in tf
selection criteria doesn'
insert it in the report: you
have to specify list itemsseparately.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 56/395
DATAEASE REFERENCE MANUAL
Now press TAB again and note what happens. In a Low Level I Low Level, when you tell
Interactive Query, when you indicate there are no more items to beDataBase there are no more
listed DataEase knows the query is completed. The final query 'Z:2,^i^-ns:ns a period,looks like this. scans the query for syntax
errors, saves the query infor CUSTOMERS memory, and returns you towith ACCOUNT
BALANCE > 500; the DQL menu.
list recordsCUSTOMER NAME in order ;
highest of INVOICES date;
ACCOUNT BALANCE .
After an automatic syntax scan, DataEase inserts a final period to
end the query; then it saves the query in memory and returns you to
the DQL menu.
On the DQL menu. Option 4 has been changed from Define Queryto Modify Query. You can now define a custom report format
(Option 5) or run the procedure immediately using the defaultreport format. Select Run Procedure. DataEase displays the outputon the screen in columnar format. After editing the columnheadings (as explained in Chapter 5), the output in the defauhreport format might look as shown in Figure 3-4 below:
Report Output
CUSTOMER NAME LAST INVOICE DATE ACCOUNT BALANCE
Adams, Sam 12/15/89 $595.00Cooper, Mary 12/24/89 S725.00Evans, Rick 12/31/89 S865.00Hill, Brenda 12/19/89 ;525.00Ivers, Clark 12/18/89 $675.00
Figure 3-4--Alphabetized Account Balance Report
As you see, the selected customers (those who owe more than
$500) are listed in alphabetical order with the date of their last
order and the balance they owe listed in columnar format.
NOTE: DataEase can only keep one report in memory at atime. If you want to use this report again, before
beginning another report, select Save Procedure
(Option 7) on the DQL menu.
^13 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 57/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 58/395
DATABASE REFERENCE MANUAL
Chapter 4
Define Query:A High Level Example
hile Low Level queries let you retrieve information from
one or more forms in a database. High Level gives you
access to the full power of the DataBase Query
Language, including Global and Temporary Variables,
35 Procedure Commands, and 58 Math and Text Manipulation
Functions. In High Level, DataEase can create two types of
procedures:
• A Processing procedure can enter, delete, list, and modify
records; and create screen, disk, or printed output.
• A Control procedure cannot itself access records or create
output, but it can link any number of Processing and/or other
Control procedures together in an automated chaining process.
In addition, a Control procedure can invoke many operations
shown on DataEase menus such as Record Entry, RunProcedure, Backup Database, Install an Application, etc.
HIGH LEVEL DQL COMMANDS
In High Level there are a total of 35 DQL commands available (see
list at right). These commands are divided into three groups:
• Processing Commands (numbered 1-9) can be used in a
Processing procedure, but cannot be used in a Control
procedure.
• Procedural Commands (numbered 10-23) can be used in any
procedure.
• Control Commands (numbered 24-35) can be used in a Control
procedure, but cannot be used in a Processing procedure.
NOTE: There is no need to memorize these restrictions.
DataEase automatically prohibits the use of an
ineligible command in a procedure, hi Interactive
Mode, ineligible commands do not appear in the list
of commands available.
Window Menu List
Of High Level Commands
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 59/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
In this example, we'll create a High Level query that retrieves data
from related forms like the preceding Low Level query but also
enters new records, modifies existing records, and calculates newinformation based on the existing data.
In our example, the Down East Company - a New England-based
mail-order business - is developing a single Control procedure to
automate its whole order processing system, including adding newcustomer records, maintaining inventory records, calculating
customer discounts, and generating invoices, shipping labels,
out-of-stock notices, etc. We'll use the following set of forms
from the Down East database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 60/395
DATABASE REFERENCE MANUAL
PROCEDURE 1 : Post Orders
The POST ORDERS procedure posts new order information fromthe ORDER ENTRY form (Primary form) into two related
Secondary forms: the customer information is posted into the
CUSTOMERS form and the order information is posted into the
INVENTORYform.
Query for the Post Orders Procedure
The query for the POST ORDERS procedure is shown below:
for ORDER ENTRYwith POSTED = NO ;
if CUSTOMER # = blank thenenter a record in CUSTOMERScopy ail from ORDER ENTRY .
end
for LINE ITEMSmodify records in INVENTORY
QTY ON HAND = QTY ON HAND -
LINE ITEMS QTY ORDERED .
endend
Explanation of the Query
Now, let's examine this query one statement at a time:
for ORDER ENTRYwith POSTED = NO ;
The Primary form for this report is the ORDER ENTRY formbecause it contains the data we want to post into the two otherforms. The ORDER ENTRY form contains a yes/no field namedPOSTED that is assigned a default value of no each time a record is
entered. This field value is changed to yes when a record getsposted by the procedure. Since we only want to post the recordsthat have not already been posted, the selection criteria on the
second line reads: posted = NO :
The next line in the query reads:
if CUSTOMER # = blank then
^3 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 61/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
The first two lines of the query tell DataEase which records to
select from the ORDER ENTRY form. The third line tells
DataEase specifically which records to post into the
CUSTOMERS form.
Since a customer is always assigned a customer # the first time he
or she places an order, if an ORDER ENTRY record has noCUSTOMER # (specified by the DQL keyword blank), it must be an
order from a new customer.
For each new customer, we want DataEase to enter a new record in
the CUSTOMERS form. This is known as a conditional action.
The instructions that follow the if statement are only executed for
records that meet the specified condition (only the records that have
a blank value in the customer # field).
The next two lines in this part of the query tell DataEase what to do
if the customer # is blank.
enter a record in CUSTOMERScopy all from ORDER ENTRY .
The first line is very straightforward. It tells DataEase to enter a
new record in the CUSTOMERS form. The second line tells
DataEase what information to enter in the new CUSTOMERSrecord.
For a new customer, the operator manually enters all the customer
information in the ORDER ENTRY form when the order is
received. This line tells DataEase to copy that information into
the CUSTOMERS form. The CUSTOMERS form automatically
derives a customer # for the new record using a sequence from
Field Derivation Formula.
The copy all from command is the last action to be performed on
the records selected from the Primary form, so it is followed by a
period. In addition, an end command is inserted to terminate the
preceding if command.
This part of the query reads:
for ORDER ENTRYwith posted = NO ;
if CUSTOMER # = blank thenenter a record in CUSTOMERScopy all from ORDER ENTRY .
end
blank is a DQL keyword tha
means no value .
If a query reads CUSTOMER= blank , the field contains
null value. A null value is
undetermined value, not azero.
An end command marks th
end of all actions initiated
the preceding if command.
In High Level, a period ends
a statement: it does not enthe query.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 62/395
DATABASE REFERENCE MANUAL
This completes the first half of the query. It tells DataEase which
form to select records from (ORDER ENTRY), what records to
post (if CUSTOMER # = blank), what information to post (copy all
from ORDER ENTRY), and in which form to post the information
(CUSTOMERS).
The second half of this query tells DataEase to modify the
INVENTORY form by subtracting the ordered LINE ITEMSfrom the INVENTORY quantity on hand fields.
First, let's look at this section of the query as a unit.
for LINE ITEMSmodify records in INVENTORY
QTY ON HAND := QTY ON HAND -
LINE ITEMS QTY ORDERED .
endend
Now, let's look at this part of the query one statement at a time.
for LINE ITEMS
First, notice that this line contains a second for command. Unlike a
Low Level query, a High Level query can contain more than one
for command. This second for command tells DataEase that wewant to select records from a form other than the Primary form.
The Secondary form we now want to select records from is the
LINE ITEMS form. The LINE ITEMS form has a predefined
relationship to the ORDER ENTRY form based on the order #
field. Since no selection criteria are specified with this for
command, DataEase selects all the records in the LINE ITEMSform that are related to the records processed in the first part ofthe query when it processes the second part of the query.
The next line in the query reads:
modify records in INVENTORY
This line is straightforward. It tells DataEase to use these LINE
ITEMS records to modify the records in the INVENTORY form.The next two lines of the query read:
QTY ON HAND := QTY ON HAND -
LINE ITEMS QTY ORDERED .
These two lines tell DataEase how to modify the records in the
INVENTORY form: As each LINE ITEMS record is processed.
A High Level query can havemore than one for command.A Low Level query can haveonly one for command.
A semicolon is only required
after afar command if it
refers to the query's Primaryform.
When you use the modifyrecords command for a formother than the queiy's
Primary form, the keyword in
must precede the form name.
In the modify records
command, field names areseparated hy the special
symbol := which is called anassignment operator. This
symbol tells DataEase to
modify the field to the left ofthe symbol by assigning it the
value specified to the right ofthe symbol.
4-5 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 63/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
subtract the value in the qty ordered field on each LINE ITEMSrecord from the value in the qty on hand field in the
INVENTORY record for that item. In other words, reduce the
INVENTORY qty-on-hand by the amount that was ordered.
The second part of the query is completed by adding two end
commands:
for LINE ITEMSmodify records in INVENTORY
qty on hand := QTY QN HAND -
LINE ITEMS QTY ORDERED .
endend
To satisfy the DQL syntax requirements, a query must contain one
end command for each for command. The end command after the
first part of the query completes the preceding if statement, not the
first for statement. Therefore two end commands are required after
the modify records part of the query, one for each for command.
The complete query for the POST ORDERS procedure reads:
for ORDER ENTRYwith POSTED = NO ;
if CUSTOMER # = blank thenenter a record in CUSTOMERScopy all from ORDER ENTRY .
end
for LINE ITEMSmodify records in INVENTORYQTY ON HAND := QTY QN HAND -
LINE ITEMS QTY ORDERED .
endend
This fulfills the procedure's two-part objective:
• The first half of the query tells DataEase to select the ORDERENTRY records that haven't already been posted and post the
new customer information into the CUSTOMERS fomi.
• The second half of the query tells DataEase to select the related
LINE ITEMS records and modify the INVENTORY form by
subtracting the quantity ordered from the quantity on hand.
There must he one endcommand for each for, if,
while, and case command in
the query.
The second part of this queryis nested within the first. T
means that all the actions
initiated hy the second forcommand are performed foreach record selected hy the
first for command. Forfurther explanation, see
nested actions in the DQLLe.xicon at the hack of this
volume.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 64/395
DATABASE REFERENCE MANUAL
Saving the Procedure
If you are creating this procedure as you read, before proceeding to
the next section, select Save Procedure (Option 7) on the DQLmenu.
DataBase prompts:
Please enter the procedure name:
In response, type: POST ORDERS and press RETURN. DataBasesaves the procedure on dist; and returns you to the DQL menu.
After the procedure is saved on disk, you can later execute it byany of the following methods:
1. Select Load Procedure (Option 8) on the DQL menuand then select the procedure name from the list of
procedures DataBase displays. Binally, select RunProcedure (OpUon 1).
OR
2. With no procedure loaded in memory, first select RunProcedure and then select Post Orders from the list of
procedures DataBase displays.
OR
3. Specify the name of the procedure in a run procedure
command within a Control Procedure query or on a
custom menu.
Next, we'll create a procedure that determines the discount given to
each customer who places an order from the Down East Christmas
catalog.
4-7 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 65/395
DEFINE QLERY; A HIGH LEVEL EXAMPLE
PROCEDURE 2: Calculate Discount
The second procedure is based on the fact that the Down East
Compan\ grants a Christmas discount to each customer based on
the amount the customer purchases from the company throughout
the year. The object of the procedure is to calculate the following
for each customer:
• The total dollar amount ordered since the start of the year.
• The total dollar amount of the customer's order from the
company's Christmas catalog.
• The total dollar amount of the discount on each customer's
Christmas catalog order.
Once each of these totals is determined, we use a variable (an
expression that represents a varying value) to store the calculated
result. This lets us use the values as often as we want without
having to repeat the formulas used to derive them.
The query for the CALCULATE DISCOUNT procedure must tell
DataBase to do all of the following:
1. Create three separate variables: one to store each
customer's Christmas order total, one to store each
customer's annual purchase total, and one to store each
customer's discount total.
2. Process the unposted ORDER ENTRY recordscalculating the sum of the Christmas order total for
each customer.
A variable is an expression
that represents a value used
during the processing of a
query. DataBase uses rviv)
r)'pes of variables: temporaryand global. A temporaryvariable can only hold a valu
during the current procedure;
a global variable can pass
value from one procedure to
another. In all other respects,
the two types of variables
function identically.
3. Set up discounts based on annual purchase totals with
the discounts expressed as a dollar amount to be
subtracted from the Christmas order total.
4. Process the related LINE ITEMS records, calculating
the sum of all the orders made by each customer since
the start of the year.
5. Modify the ORDER ENTRY records, entering each
customer's discount in the discount field.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 66/395
DATAEASE REFERENCE MANUAL
Query for the Calculate Discount Procedure
The full query for the CALCULATE DISCOUNT procedure reads as
follows:
define temp Christmas Numberdefine temp annual Numberdefine temp discount Number
for ORDER ENTRYwith POSTED = NO
;
assign temp Christmas := sum of LINE ITEMS (unit cost '
QTY ORDERED) .
assign temp annual := sum of ORDER ENTRY named•YTD with (DATE between 01/01/88 to current date andcustomer # = ORDER ENTRY customer #)
sum of LINE ITEMS (unit cost * qty ordered) .
case (temp annual)value < 300 :
assign temp discount := temp Christmas * 0.10 .
value between 300 to 1000 :
assign temp discount := temp Christmas * 0.15 .
others :
assign temp discount := temp Christmas * 0.20 .
end
modify recordsdiscount := temp discount .
end
Explanation of the Query
Notice first that this query does not start with a for command.When using variables in a query, you should define the variablesat the start. This makes it ea,sy to find (and change) the variablesif necessary, and it also makes the query easier to follow.
^ Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 67/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
Now, let's look at this query one statement at a time.
The first hne in the query creates and names a temporary variable
to hold the Christmas order total for each customer:
define temp Christmas Number
.
This first line has five elements:
• The DQL define command. This tells DataEase to create a
variable.
• The keyword temp. This tells DataEase the variable is a
temporary variable, not a global variable.
• The name of the variable (Christmas ). The name of a variable
must be enclosed in quotes when it is first specified
in a query.
• The type of the variable (a Number). A variable can be a
number, a text expression, or any other DataEase field type
except Choice, Dollar, or Yes/No.
• A period. The denne command must always end with a period.
The first three lines of the query are similar in purpose:
define temp Christmas Number
.
define temp annual Number
.
define temp discount Number
.
These statements create three temporary variables: one to store
each customer's Christmas order total, one to store each customer's
ANNUAL purchase total, and one to store each customer's discount
total.
The next part of the query tells DataEase which records to select in
the Primary form:
for ORDER ENTRYwith posted = NO ;
As in the previous procedure, the first group of recordswe
want
DataEase to select are the unposted ORDER ENTRY records.
These records contain the orders from the Christmas catalog.
To define a variable you muspecify the variable' s nameand type. You can use anyname you like, but the namemust be enclosed in quotes.
After specifying the type,
insert a space followed by aperiod. The define commandis always followed by a
period, not a semicolon.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 68/395
DATABASE REFERENCE MANUAL
The next part of the query tells DataBase how to calculate the
Christmas order total for each customer (the value we want to
assign to the Christmas variable):
assign temp Christmas := sum of LINE ITEMS (unit cost*
QTY ORDERED) .
First, the above statement introduces the DQL assign command:
assign temp Christmas :=
This statement tells DataBase to assign Christmas a value.
DataBase automatically inserts the assignment operator symbol (:-)
after the name of the variable. This operator tells DataBase that the
value of the variable is determined by the expression on the right of
the symbol (it functions very much like an equals sign). Theremainder of this line reads:
sum of LINE ITEMS (unit cost * qty ordered) .
This part of the assign statement tells DataBase what value to
assign to the Christmas variable - the sum of the cost of all the
LINE ITBMS related to this order.
In other words, as each ORDBR ENTRY record is processed, the
DQL sum of relational operator tells DataBase to find the related
LINE ITEMS records with the same order # as the record that is
currently being processed (the Christmas catalog order). DataBase
then multiplies the unit cost by the qty ordered, totals the result,
and stores the calculated total in the Christmas variable.
The whole query up to this point reads as follows:
define temp Christmas Numberdefine temp annual Numberdefine temp discount Number
for ORDER ENTRYwith posted = NO ;
assign temp Christmas := sum of LINE ITEMS (unit
cost * QTY ORDERED) .
The name of a variable is
only placed in quotes
when it is first defined.
No quotes are used after
the variable is defined.
The assign command is usedto assign a value to atemporary or global variable.
Like the define command, the
assign command must specify
the variable's name and is
followed by a period, not asemicolon.
The sum of relational
operator returns the total ofthe values in specified fields
on a related form.
In a query, values in a mathformula are enclosed in
parentheses to clarifif the
meaning and the sequence ofthe math operations.
Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 69/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
The next part of the query tells DataBase to calculate the annual
order total for each customer (the value we want to assign to the
ANNUAL variable).
Taking this section a step at a time, we begin with:
assign temp annual := sum of ORDER ENTRY named YTD
This statement tells DataBase to assign the annual variable a value
equal to the sum of the values in another group of ORDERENTRY records. This new group of records is distinguished by the
name YTD (YEAR TO DATE) and the following new selection
criteria:
DataBase automatically
inserts the assignmentoperator symbol (:=) after
name of the variable. This
operator tells DataBase that
the value of the variable is
determined by the expression
given to the right of the
symbol (it functions like anequal sign).
with (DATE between 01/01/88 to current date andcustomer # = ORDER ENTRY CUSTOMER #)
These new selection criteria tell DataBase to select a new group of
ORDER ENTRY records - those that have a date between the first
day of the year and today's date, and the same customer # as the
current ORDER ENTRY record being processed by the for
command.
This new group of ORDER ENTRY records is related to the
original group by an ad-hoc relationship. An ad-hoc relationship is
a relationship that's created to access a group of records during a
query - by inserting a relational operator and additional selection
criteria into the query, instead of predefining the relationship on the
Relationships form.
During a query, whenever you want to change the criteria that are
used to select records from a form, you must create a newrelationship. When you change selection criteria, you must assign
each distinct group of records a unique name using the DQLnamed operator.
The unique name lets DataBase distinguish different groups of
records selected from the same form. In the example above, the
second group of ORDER ENTRY records is assigned the name
YTD to distinguish it from the original group of unposted ORDERENTRY records selected by the for command.
Selection criteria used after
relational operator are alwayenclosed in parentheses.
An ad-hoc relationship is arelationship that's created
during a queiy (instead ofbeing predefined on aRelationship form duringForm Definition).
When you create an ad-hocrelationship, you must give
that relationship a name to
differentiate it from other
groups of records selected
from the same form.
The named operator is usedgive a relationship a unique
name. You can use any namyou like. The name must be
enclosed in quotes when it
first specified: thereafter noquotes are used.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 70/395
DATAtASE RbHERENCE MANUAL
The last line in this section reads:
sum of LINE ITEMS (unit cost * qtv ordered) .
As we explained for the Christmas variable, this statement tells
DataEase to total the cost of the LINE ITEMS ordered by the
customer whose ORDER ENTRY record is currently being
processed. But now. instead of totalling just this customer's
Christmas catalog order, as each ORDER ENTRY record in the
YTD' group is processed, DataEase totals all the related LINEITEMS records for that customer. In effect. DataEase totals all the
orders made by each customer since the start of the year and stores
the result in the annual variable (see Figure 4-2 below).
fld-HocRelationship
PredefinedRelat ionsh ip
ORDER ENTRY RECORDprocessed by the
for comand
ORDER ENTRY RECORDSuith sane CUSTOMER n
and D«TE belueen Bl^BVaaand CURRENT DATE
PredefinedRelat ionsh i p
Total the LINE ITEMS RECORDSrelated to each of the
ORDER ENTRY RECORDS at left
NOTE: The double arrouhead faces the Many side of the relationship
Figure 4-2-- Calculation Of Annual Variable
The whole query up to this point reads as follows:
define temp Christmas Numberdefine temp annual Number .
define temp discount Number
for ORDER ENTRYwith POSTED = NO ;
assign temp Christmas := sum of LINE ITEMS (unit cost*
QTY ordered) .
assign temp annual := sum of ORDER ENTRY named YTD with (date between 01/01/88 to current date andcustomer # = ORDER ENTRY customer #)
sum of LINE ITEMS (unit cost * qty ordered) .
4-13 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 71/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
In the next part of the query we want DataBase to divide the annual
purchase totals into three groups and assign a different discount to
the records in each group. This process is similar to the if
command that we used to select records in the POST ORDERSprocedure:
if CUSTOMER # = blank thenenter a record in CUSTOMERS
But, instead of specifying only one condition, we want DataEase to
evaluate each record against several values as shown below:
if ANNUAL < 300 then assign discount a := (10%)
if ANNUAL between 300 to 1000 then assignDISCOUNT B - (15%)
if ANNUAL >1 000 then assign discount c := (20%)
However, instead of specifying multiple if commands, we can use a
single case command (as shown below):
case (temp annual)value < 300 :
assign temp discount := temp Christmas * 0.10 .
value between 300 to 1000 :
assign temp discount := temp Christmas ' 0.15 .
others :
assign temp discount := temp Christmas * 0.20 .
end
In effect, the case command w orks like a series of nested if
commands. It consists of the word case followed by an object
enclosed in parentheses. This object can be a field, a constant
value, an expression, or a variable. The object is tested against
one or more value statements each of which specifies a comparison
value. The comparison value may be a constant value, an
expression, a variable, or a range of values.
Each value statement is followed by one or more action statements.
As in the if command, these actions are conditional - DataEase
performs the actions that follow the first value statement in whichthe comparison is true for the current record being processed.
The case command must include a closing end command. It mayalso include an others statement. If none of the preceding value
statements are true. DataEase automatically executes the actions
following the others statement.
The DQL case commandevahiates a series ofconditions and executes
different actions based onresult of this evaluation.
Like the if command, the la
statement in a case commanmust he followed by an endcommand.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 72/395
DATABASE REFERENCE MANUAL
In our example, the object we want DataBase to test is the valuestored in the annual variable. The action we want DataBase to
take is to modify the value stored in the Christmas variable by theappropriate discount rate.
Now. let's look again at the case in question:
case (temp annual)value < 300 :
assign temp discount := temp Christmas * 0.10 .
value between 300 to 1000 :
assign temp discount := temp Christmas * 0.15 .
others :
assign temp discount := temp Christmas * 0.20 .
end
The first value statement is true for customers whose annualpurchases total less than S300. These customers are assigned a
10%discount
on their Christmas catalog order total. The secondvalue statement is true for customers whose annual purchases are
between $300 and $1000. These customers are assigned a 15%discount on their Christmas order. All other customers are assigneda 20% discount on their Christmas order.
To generate the net total for each Christmas order invoice, we mustsubtract each customer's discount from his order total. But so far
we haven't slored the discount amount for each customer in this
procedure, we've just calculated it.
The final part of this query stores the discount amount for eachcustomer, so we can use this amount later to generate an invoice.
modify recordsDISCOUNT := temp discount ,
end
These three lines tell DataBase: as the unposted ORDER ENTRYrecords are processed, modify each record by posting the valuecalculated for the discount variable into the discount field on the
ORDER ENTRY form.
4-15Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 73/395
DEFINE QUERY; A HIGH LEVEL EXAMPLE
The completed query for the CALCULATE DISCOUNT procedure
reads as follows:
define temp Christmas Number
.
define temp annual Number
.
define temp discount Number
,
for ORDER ENTRYwith posted = NO ;
assign temp Christmas := sum of LINE ITEMS (unit cost *
qty ordered) .
assign temp annual := sum of ORDER ENTRY named YTD witfi (DATE between 01/01/88 to current date andcustomer # = ORDER ENTRY customer #)
sum of LINE ITEMS (unit cost * qty ordered) .
case (temp annual)
value < 300:
assign temp discount := temp Christmas * 0.10 .
value between 300 to 1000 :
assign temp discount := temp Christmas * 0.15 .
others :
assign temp discount ;= temp Christmas * 0.20 .
end
modify records If no form name is specifieddiscount := temp discount . a modify records command.
snd DataBase modifies records
the Primary form.If you're creating this query as you read, press F2 SAVE. Then
select Save Procedure (Option 7) on the DQL menu to save the
procedure on disk. When DataEase asks you to name the
procedure, enter CALCULATE DISCOUNT.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 74/395
DATAEASE REFERENCE MANUAL
PROCEDURE 3: Print Invoices
The PRINT INVOICES procedure tells DataEase what information
to pr int on each customer's Christmas order invoice as shown in
Figure 4-3.
DOUN EfiST
Rockport,(see) 485
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 75/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 76/395
DATABASE REFERENCE MANUAL
Explanation of the Query
Now, let's review this query line by line.
for ORDER ENTRY
The for command selects the query's Primary form - the ORDERENTRY form.
with POSTED = NO ;
The with operator introduces the record selection criteria: process
only records with the value no in the posted field.
list records
The list records command tells DataBase what items we want to
appear in the output. These items (called list items) follow
the list records command. In this report there are two types of list
items: fields from the Primary and/or Secondary forms and values
that are calculated during the query but do not actually appear on
any database forms.
order # in groups ;
This tells DataBase to group LINE ITEMS records with the sameorder # together and to arrange the groups in ascending order.
DATE ;
CUSTOMER # ;
NAME ;
ADDRESSCITY :
STATE ;
ZIP ;
DISCOUNT ;
Each of these eight lines specifies a field on the ORDER ENTRYform. Here, we are telling DataBase to include the value in each of
these fields in the report output.
A semicolon follows each list
item except the last in a list
records command.
4-19 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 77/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
all LINE ITEMS part # ;
all LINE ITEMS description;
all LINE ITEMS unit cost ;
all LINE ITEMS oty ordered;
Each of these four lines specifies a field on the LINE ITEMS form.
The relational operator all tel ls DataEase to find every LINE
ITEMS record that has the same order # as the ORDER ENTRYrecord that's currently being processed (it finds all the LINEITEMS related to the Christmas catalog order).
all LINE ITEMS (unit cost * oty ordered);
This line tells DataEase to multiply the unit cost by the quantity
ordered for each item ordered from the Christmas catalog and list
this total in the report. This information is displayed in the Line
Total Column on the invoice.
sum of LINE ITEMS (unit cost*
qty ordered);
This line tells DataEase to calculate the sum of the costs of all the
LINE ITEMS ordered from the Christmas catalog and list this
calculated total in the report. This information is displayed as the
Overall Line Total on the invoice.
The relational operator all
tells DataEase to find each
related record: the relationaloperator any tells DataEase
find the first related record.
These operators can he usedto access information in both
predefined and ad-hocrelationships.
sum of LINE ITEMS (unit COST * qty ordered)- discount .
This line tells DataEase to calculate the same sum as the previous
list item and then subtract the value in the ORDER ENTRYdiscount field from this amount. The result is the net total for each
order, taking into account each customer's discount as calculated in
this procedure. This information is displayed as the Order Total on
the invoice.
modify recordsPOSTED ;= YES .
end
The last three lines tell DataEase: as each ORDER ENTRY record
is processed, change the value in the posted field from NO to YES.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 78/395
DATABASE REFERENCE MANUAL
THE CONTROL PROCEDURE: Mail Order
As we mentioned at the start of this volume, a Control procedure
can be used to manage almost every element of DataBase, including
combining menus, input forms, procedures, conditional actions, and
output into fully automated business applications.
A Control procedure can be used to:
• Execute any DataEase menu option from within the procedure.
In this respect. Control procedures are similar to the chain
menus available in previous DataEase versions. However,
Control procedures let you combine DQL conditional logic
with the chain menu processing capabilities.
• Link DQL Procedures together and execute them automatically.
• Pass values among procedures.
Now, we'll demonstrate how the Down East Company can link the
three preceding procedures together to automate their whole process
for entering and posting orders, calculating each customer's
discount, and printing the invoices. To do this, you create a newquery that combines the three Processing procedures into a Control
procedure.
The query for this Control procedure is listed immediately below.
Following the query, the purpose of each line in the Control
procedure is explained.
Control procedures function
similarly to chain menus in
previous DataEase versions.
However, they let youconditionally display forms,run reports, etc. DataEase
versions 4.0 or higher link thepower of transaction
processing with the
ease-of-use approachDataEase has alwayschampioned.
Query for Mail Order Control Procedure
The Control procedure query contains only ten lines:
if current date < 12/25/89 thenrecord entry ORDER ENTRY .
run procedure POST ORDERS .
run procedure CALCULATE DISCOUNTrun procedure PRINT INVOICES .
else
message <Merry Christmas >|
There are only 300 shopping days left before |
we mail our next Christmas Catalog. windowend
The form name is enclosed in
quotes in a record entry
command. A period is
inserted after specifying the
form name.
The procedure name {like anytext constant used in a query)
is enclosed in quotes in a run
procedure command.A period is inserted after
specifying the procedure nam
4-21 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 79/395
DEFINE QLER\-: A HIGH LE\EL EXAMPLE
Explanation of the Control Procedure
The Control procedure starts with the if command w hich sets up a
conditional action:
if current date < 12/25/1989 then
This tells DataBase to execute all the actions between the if and the
else commands as long as the current date is before December 25th.
If the date is on or after 12/25/89. DataBase ignores the commands
between the if and else commands and resumes processing with the
first statement after the else command.
The Control procedure then introduces the first action:
record entry ORDER ENTRY .
The record entry command lets you enter records from within a
procedure. The entered data can then be processed byother
procedures specified in the Control procedure.
This command tells DataBase to perform one action: displa\ the
specified form. In this case it displays the ORDER ENTRY form
so the operator can enter orders.
The Order Entry form was defined so that DataEase automatically
generates the order # (a sequenced field) as each order is entered.
The name and address information for new customers is manually
entered by the operator. The name and address information for
previous customers is retrieved from the CUSTOMERS form when
the operator enters the customer # in the ORDER ENTRY form.
The third line of the Control procedure specifies:
run procedure POST ORDERS .
The run procedure command executes a procedure just as if you
selected the Run Procedure option on the DQL menu. WhenDataEase reaches the end of the procedure, it automatically
executes the next command in the Control procedure.
When the POST ORDERS procedure is run. DataEase creates a new
record in the CUSTOMERS form for each new customer, copying
the name and address information from the ORDER ENTRY' form.
The merchandise ordered from the Christmas catalog is posted in
the LINE ITEMS form and ordered items are subtracted from the
QTY ON HAND fields in the INVENTORY form.
The fourth line specifies:
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 80/395
DATABASE REFERENCE MANUAL
run procedure CALCULATE DISCOUNT .
This command executes the CALCULATE DISCOUNT procedure
that 1 ) calculates the total dollar amount ordered by a customerfrom the company's Christmas catalog, 2) calculates the total dollar
amount ordered by that customer since the beginning of the year,
and 3) calculates and posts a discount on the Christmas order based
on the customer's total annual purchases.
The fifth line in the Control procedure specifies:
run procedure PRINT INVOICES .
This command executes the final PRINT INVOICES procedure.
This procedure prints an invoice for each customer's Christmas
order by 1) retrieving and totalling the cost of all the ordered items
from the LINE ITEMS form and 2) applying the customer's
discount (as calculated in the previous procedure) to yield a net
amount.
The sixth line in the Control procedure contains the else command.The else command tells DataEase what action to perform if the
current date is on or after December 25th.
else
message <Merry Christmas >|There are only 300 shopping days left before
|
we mail our next Christmas Catalog. windowend
The next line contains the DQL message command. The messagecommand tells DataEase to display the text enclosed in quotation
marks. In the message text itself, the angle brackets < > tell
DataEase to display the text in red (a user-defined color choice),
each vertical line|
tells DataEa.se to insert a line break, and the
window command following the quotation tells DataEa.se to display
the message in a window in the center of the screen.
The last line in the Control procedure contains the end command. It
marks the end of the actions initiated by the if command. TheControl procedure does not require a second end command, as
there is no other command in the procedure that requires an end.
4-23 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 81/395
DEFINE QUERY: A HIGH LEVEL EXAMPLE
Summary (Putting It All Together)
In this example, when you select Run Procedure from the DQLmenu and specify the MAIL ORDER Control procedure (or specify
the MAIL ORDER option on a custom User menu). DataBase
displays the ORDER ENTRY form. You can then enter records in
the form using the standard DataBase Record Entry procedures.
Each time you press F5 FORM CLEAR, DataBase displays a newblank record just like normal record entry.
When you finish entering records and press ESC. DataBase
automatically executes each command in the Control procedure
until it reaches the end of the PRINT INVOICES procedure.
When the Control procedure is completed. DataBase automatically
returns to the form or menu from which the procedure wasoriginally called.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 82/395
DATAEASE REFERENCE MANUAL
Chapter 5
Define Format/Print Style:
Designing Report Output
I
QL procedures are often used to create report output for
I
printing and display. DataBase provides eight predefined
formats that let you easily produce reports. In addition, you
can create your own custom formats. All of the DQL fomiatting
options can also be used with Quick Reports to design or enhance
procedure output.
For more precise control of your output. DataEase also provides the
DQL output command. The output command can be used
anywhere in a query to specify the exact location of the output. Formore information on the output command, see the DQL Lexicon at
the back of this volume.
The format defines how data
is output. All the DQLformatting options can also he
used with Quick Reports to
design report output.
THE PURPOSE OF THE REPORT FORMAT
Although the query tells DataEase what field values and statistics to
include in a report, it doesn't specify how to physically lay out the
information. The forrtial tells DataEase how to arrange the output
to produce form letters, mailing labels, invoices, checks, tabular
reports, etc. Defining the format is complementary to Form
Definition. In Form Definition you define the format for data to be
input; the report format defines how the data is output.
A query tells DataEase whatinformation is required for areport. The format tells
DataEase how to lay out thai
data.
REPORT FORMAT ELEMENTS
A report format consists of three elements:
• Formatting Commands: Special commands that tell DataEase
how to layout the information requested in the query. There
are eight Formatting Commands: .header, .footer, .group
header, .items, .group trailer, .end, .page, and .call. All
formatting commands are preceded by a period, so they are
often called dot commands. A format must contain an .items
command and an .end command. The other commands are
optional. Dot commands must begin in column 1 of the format.
A DataEase format can store
up to 4000 characters andoccupy up to 16 screens. Theformat is composed of three
elements: FormattingCommands. Format Te.xt. andOutput Fields.
5-1 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 83/395
DEFINE FORMA T/P RINT STYLE: DESIGNING REPORT OUTPUT
• Format Text: Descriptive text such as the Titles, Headers,
Page Numbers, Boundary Lines, etc. You enter Format Text
in the format directly where you want the text to appear in the
output. Format text is an optional part of the format.
• Fields: Locations where the field values from the records
processed by the query actually appear in the report output.
To insert a field in a report format, move the cursor to the
position where you want the field values to appear. Then press
FIO FIELD and select the field from the menu DataBase
displays, or press RETURN and type in a new field formula.
Figure 5- 1 shows a sample report that uses many of the report
formatting commands. The text shown in the report (such as
Department Total) is Format Text, and the shaded rectangles
represent areas where the field values from each processed record
are displayed or statistically summarized.
Note that Figure 5-1 represents the report output (with annotated
formatting commands), iiol the report format. In the format, each
command must begin in column 1 on a separate line. Examples of
report formats appear in the reference pages throughout this section.
To insert afield in a report
format, move the cursor to t
location where you want the
field values to appear andpress FIO FIELD. WhenDataBase displays a menu,select the field from the menor type in a new field formula.
. header
.footer
DOUN EAST COMPANYMonthly Report
October 1989
Marketing Departnent *-
Departnent Total
Grand Total
-» Page Z
.group header
. itens
.group trailer
.end
Figure 5-1 - Sample Report Showing Formatting Commands
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 84/395
DATABASE REFERENCE MANUAL
HOWTHIS CHAPTER IS ORGANIZED
This chapter tells you how to select, create, and modify formats. It
includes numerous example formats with the query that generates
the format and the report output it produces (as in Figure 5-1). Thepredefined formats are presented first. They are followed by
detailed instructions that explain how to create a custom format or
edit a predefined format. It may be helpful to review the examplesin this section before trying to design your own custom reports.
PREDEFINED FORMATS
DataEase provides several predefined formals which you can use to
save time. These system-defined formats can be used as is or can
be edited to reflect personal tastes. In general, many users find that
the best way to format a report is to generate the report in a
predefined format and then modify it until they are satisfied with
the report's appearance.
DataEase has nine predefinedformats. Often, the easiest
way to produce a report is to
use a predefined format andthen modify it to meet yourrequirements.
CUSTOM FORMATS
Alternatively, you can create a custom format that lets you design a
report to your own specifications. In creating a custom format, youenter Formatting Commands that tell DataEase how you want your
report formatted. However, a report format can also include titles,
boundary lines, page numbers, field names, and other descriptive
information. When you are designing a custom report format, you
must position this information where you want it to appear in the
output.
Adding form text and placing fields in a format is almost identical
to designing a form in Form Definition. For example, if you want
a centered title at the top of the report, you type the title text at the
top center of the format exactly where you want it to appear.
Similarly, you position a field where you want it to appear bymoving the cursor to the appropriate position and pressing
FIO FIELD to insert the field in the format. After each field is
inserted, press F2 SAVE to save the field location as part of the
format.
The custom format lets youdesign a report to your ownspecification. It skives youcomplete control over the
appearance of a report.
5-3 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 85/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
DEFAULT REPORT FORMAT
If you don't define a format for a procedure, DataEase
automatically creates a default columnar format. The columnarformat displays each record on a separate line with fields laid out
one beside another in vertical columns. If you have specified
groupingin the query, DataEase automatically
prompts youfo r the
additional information it requires to properly format the output.
DataEase automatically
creates a columnar format i
you don't select a different
format option.
SAVING A FORMAT
To save a format, press F2 SAVE. This saves the format
temporarily in the computer's memory. To save the format
permanently, select Save Procedure on the DQL menu. This saves
the procedure and the format on disk.
Select Save Procedure fromthe DQL menu to save a
format on disk as a part of t
procedure.
MODIFYING A FORMATOnce you have saved a format, the Define Format option on the
DQL menu changes to Modify Format. You can modify a format
at any time. In order to modify a previously defined format, the
procedure has to be loaded into memory. If the procedure is not
currently in working memory, select Option 8. Load Procedure,
and then select the name of the procedure to load from the menu of
procedures displayed by DataEase. Once the procedure is loaded,
select Option 5, Modify Format.
When you modify an existing format, DataEase asks:
Do you want to keep the existing format?
Answer yes if you want to make changes to the existing format.
If you answer no. DataEase abandons the existing format entirely,
and you must redefine your format from the beginning.
TYPES OF REPORT FORMATS
When you selectDefine Format
from the
DQL menu(or
fromthe
QBE - Quick Reports menu), DataEase displays a menu of the nine
available report formats as summarized on the next page:
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 86/395
DATAEASE REFERENCE MANUAL
QUICK SUMMARY OF THE FORMAT MENU OPTIONS
1 : The columnar format displays one record on each line with
fields laid out one beside another (similar to Table View).
2: The field per line format displays one field on each line.
3: The record entry format uses a Record Entry form as the
report format (identical to Form View).
4: The template format uses an existing user-defined form as
the report format.
5: The GrafTalk format automatically sends the report data to
DataEase GrafTalk to produce a chart or graph. You must
have GrafTalk to successfully use this format.
6: The custom format lets you design a report to your ownspecifications.
7: The export formats prepare data for use in other programs.
They include WordPerfect, Mail-merge, MultiMate,
GrafTalk, Lotus 1-2-3/Symphony, DIP (Data Interchange
Pormat), and Pixed and Variable Length ASCIL
8: The mailing labels format is used to automatically format
output to be printed on multi-across mailing labels.
9: The CrossView format automatically sends the report data to
DataEase CrossView for statistical analysis.
If you select any format except custom. DataEase prompts you for
any additional information it requires and then displays the report
format. You can use the format as is or edit it (except the Lotusexport format, which cannot be edited). To use the unmodifiedformat, press P2 SAVE. To display the report in the chosenformat, select Run Procedure (Option 1) on the DQL menu. Eachformat is described in detail in the reference pages of this chapter,
except the CrossView format, which is described in an addendum at
the end of this volume.
If you select the custom fonmat, DataEase displays a blank screenon which you design your own format.
5-5
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 87/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Report Formatting
How to Define a Format: Overview
The format is defined after you write a DQL query (or select list
fields in Quick Reports). Follow the steps below to define a
format. See specific reference pages for more information on a
particular topic.
1
.
Select Define Format from the DQL or the QBE - Quick
Reports menu.
2. DataBase lists the available formats. Select the type of
format you want to use from the list.
3. Answer the questions DataBase asks. The questions vary
from format to format. See the reference pages on the
format you've chosen for more information on specific
questions.
4. DataBase displays the format. You can now edit the format
as desired, except for the Lotus 1-2-3 export format, which
cannot be edited.
5. Add format text by simply typing the text on the formatwhere you want it to appear. You can add titles, draw
borders, or add any desired text to a format.
6. Add fields to the format by positioning the cursor where you
want the field to appear and pressing FIO FIELD. WhenDataBase displays a menu, select the field you want to insert
in the format.
7. You can cut and paste fields and format text, just as you can
during Form Definition.
8. When the format is defined as you want, press F2 SAVE to
save the format in memory. To save the format permanently
on disk, you must select Save Procedure from the DQL menu(or Save Report from the QBE - Quick Reports menu).
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 88/395
DATABASE REFERENCE MANUAL
Report Formatting
How to Define a Format: Overview
To illustrate the processs of formatting a report, Figure 5-2 shows
the query, format, and output for a procedure that Hsts the state.
LAST NAME, and ACCOUNT BALANCE field values for each customer in
the CUSTOMERS form.
Query
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 89/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Columnar Format
The columnar format places each field in a separate vertical
column and uses the Field Names as the column headings in the
report. If the Field Name is longer than the field length, DataBase
splits the name onto two or more lines. If you don't like the wayDataBase splits the Field Names, you can edit the format.
The columnar formatprints
each fie Id in a separate
vertical cohimn and uses th
field names as the columnheadings.
Report WidthIn a columnar format. DataBase automatically assigns each column
a width equal to the Field Length, and then totals the width of all
the columns plus a varying number of spaces to determine the line
length required for the report. You need this much space on a line
to be able print the report correctly.
After making the calculation, DataBase displays the message:
Minimum line length for a columnar report is nnn
where nnn is the length of the line in characters. If the minimumlength is less than 80 characters. DataBase generates the format,
evenly spacing the fields across the report width. If the minimumlength exceeds 80 characters (the default screen width), DataBase
asks you to specify the width you want for the report and evenly
spaces the fields across the specified length.
DataBase always inserts 1-2 spaces at the beginning of the line,
from 1-4 spaces between each vertical column, and from 1-4 spaces
at the end of the line to evenly space the columns.
See the following page for an example.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 90/395
DATABASE REFERENCE MANUAL
Format Types
Columnar Format (cont.)
For example, assume we want to include each customer's first
NAME, LAST NAME, ADDRESS, CITY, STATE, and ZIP CODE in the report
output. The query contains the following six list items:
Field Name Field Length
FIRST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 91/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Columnar Format (cont.)
Automatic SpacingIf you specify a report width longer than the minimum required line
length, DataBase tries to evenly increase the spaces in the line. For
example, if you specify a line length of 150 characters, DataBase
assigns a width of 133 characters calculated as follows: 107 field
characters, 20 spaces between fields (4 between each column), 2
spaces at the beginning of the line, and 4 spaces at the end of the
line. The actual report width (133 characters) is less than the
specified width of 150 characters, because the maximumsystem-defined spacing is used.
The following two pages show examples of the query, format, and
output for two different columnar reports.
Volumes
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 92/395
DATAEASE REFERENCE MANUAL
Format Types
Columnar Format (cont.)
This page contains the default columnar format and part of the
report output for a query that asks DataBase to Hst the
CUSTOMERS records, showing the state, last name, andACCOUNT balance field values for each customer.
Query
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 93/395
FINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTP
Format Types
Columnar Format With Grouping and Statistics
Group Statistics
If you have specified grouping on any fields in the query, DataBase
prompts:
Do you want Group Headers and Group Trailers?
If you answer yes DataBase creates group headers and trailers for
each grouped field.
Group headers are group names. The field used to group the data
in the query is automatically included in the group header. Grouptrailers hold group statistical totals; they list group totals for
anyspecified statistics. You can also generate grand totals by
positioning a total field after the .end command. This position tells
DataBase to generate a grand total rather than a total for a specific
group.
Using the example on the previous page, we can group the records
by STATE and generate statistical totals for each state with the
following query:
The .group header and .grouptrailer commands are usedposition group-level statistics
in the report output.
Queryfor CUSTOMERS ;
list recordsSTATE in groups with group-totals ;
LAST NAME ;
ACCOUNT BALANCE : item sum .
end
FormatSTATE LAST NAME
.group header
.items
.group trailer
.end
ACCOUNT BALANCE
State Total
Grand Total
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 94/395
DATAEASE REFERENCE MANUAL
Format Types
Columnar Format With Grouping and Statistics (cont.)
In this example, the .group header text is the state field value.
The .group trailer text {Stale Total), which is }wl a field value, is
typed in the format directly where you want the text to appear in
the report output. Report boundary lines (===) are manuallyentered in the report format where you want them to appear in
the report output.
Report OutputSTATE LAST NAME
CT
FL
NJ
NY
BrownDavisState Total
McDonaldState Total
AdamsHill
State Total
AndersonCooper
EvansIvers
JenkinsState Total
ACCOUNT BALANCE
$250.00;;3oo.oo$550.00
$425.00$425.00
$595.00$525.00
$1,120.00
$350.00S725.00;;865.00;;675.oo$140.00
$2,755.00
Grand Total $4,840.00
In addition to group totals, this report format includes a
Grand Total statistic which appears after the .end formatting
command.
5-13 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 95/395
DEFINE FORMA T/P RINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Field per Line Format
The field per line format produces a report with one field on eachThe field per line format
line of the report. This format is used when printing a large pn/ifi one field on each line
number of fields that cannot fit across the width of a page. the report. A blank line is
When you select field per line. DataBase positions each output
field on a separate line. The name of the field appears at the left
margin and the field value begins in column position 40. The fields
in each record appear directly below one another. A single blank
line is inserted between records.
For example, suppose you want to include all the following fields
from an INVENTORY form in the report output. The query looks
as follows:
Queryfor INVENTORY ;
list recordsPART NUMBER
;
DESCRIPTION ;
STORAGE LOCATION ;
VENDOR CODE ;
VENDOR NAME ;
COST PER UNIT ;
QUANTITY ON HAND ;
REORDER LEVEL ;
LEAD TIME :
REORDER AMOUNT .
end
Format.items
PART NUMBERDESCRIPTIONSTORAGE LOCATIONVENDOR CODEVENDOR NAMECOST PER UNITQUANTITY ON HANDREORDER LEVELLEAD TIMEREORDER AMOUNT
inserted between records.
.end
Volumes
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 96/395
DATABASE REFERENCE MANUAL
Format Types
Field per Line Format (cont.)
Report OutputPART NUMBER
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 97/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Record Entry Format
The record entry format produces a report that duplicates the
layout of the specified Record Entry form.
When you select the record entry format. DataEase creates a
format with the same lasout as the Record Entr\' form. DataEase
automatically uses all fields from the form; you only have to
specify list fields if you want to group, sort, or generate statistics.
For example, suppose you want to include each customer's flll
NAME. ADDRESS. CITY. STATE, and ZIP CODE in your report output. Thequery looks as follows:
The record entry formal prints
the output using the layout ofthe specified Record Entry
form.
Queryfor CUSTOMERS
list recordsFULL NAME ;
ADDRESS ;
CITY;
STATE ;
ZIP .
end
Format.items nosplit
FULL NAMEADDRESSCITY m STATE
.end
Report Outputfull NAME John AdamsADDRESS 8 Smallwood DriveCITY Longbranch state NJ zip 07740
FULL NAME Lvnn AndersonADDRESS 30 Bainbridge AveCITY Commack state NY zip 11725
FULL name Pat BrownADDRESS 25 Evergreen CircleCITY Norwalk state CT zip 06851
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 98/395
DATABASE REFERENCE MANUAL
Format Types
Template Format
The template fomiat is used to create a generic format that can beshared among a variety of users to create standardized reports.
Even users whose databases are named and structured differently
can use report templates for common or roll-up reporting.
You define the template first in Form Definition. Define a template
just like any other form, except you enter report formatting
commands directly on the form (the formatting commands are
explained in the custom formats section). Type the form text andposition fields in the appropriate places on the form. Specify Field
Type, and Length, and skip all other field questions. Use generic
Field Names (such as name, id#, etc.) to make the format
compatible with as many different output requirements as possible.
You should create and store your template forms in a separate
database so you don't confuse them with your Record Entry forms.It's also important to keep track of the DOS filename for eachtemplate since you must use this name to specify the template.
When you select template. DataEase asks:
Name of the Template file:
Enter the template's DOS filename (including drive letter) andpress RETURN. DataEase then asks:
Match Template Fields to report fields by:
1 : By field order 2: By field name
If you select By field order, the report output is matched to the
template fields in the order the fields are listed in the query. If youselect By field name, the report output is matched to the template
fields by Field Name (name in the output is matched to the namefield
on the template, state is matched to the state field, etc.).
NOTE: If the template is in a directory other than the databasedirectory, you must use the DOS SUBST command to
substitute a drive letter for the name of the directory
where your templates reside. For example: SUBST Q:C:\DEASE\TPLATES. This is the only place whereDataEase does not let you enter a DOS PATH.
The template format is aspecially designed form that
can he used as a generic
format for a variety ofDQLProcedures and Quick Reports.
5-17 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 99/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Template Format (cont.)
To maximize flexibility, you can use the * and ? wild card symbols
in template Field Names to make it easier to match report output
Field Names (e.g., a template field named *# can be matched with
CUSTOMER #. INVOICE #. PART #, etC).
For example, assume we create a template with a field called
*NAME. We want to include each customer's full name, address,
CITY, STATE, and ZIP code in the report output. The query looks as
follows:
Query
for CUSTOMERS;
list recordsFULL NAME ;
ADDRESS ;
CITY ;
STATE ;
ZIP .
end
In this example, if we tell DataEase to match By field order, the
FULL NAME field data is assigned to the first field in the template.
If we tell DataEase to match By field name, the full name
information is matched to the first template field with a FieldName that contains the text string name. In either case, the
template format looks as follows:
Format.itemsNAMEaddressCITY
When using the template
format, iftwo or more fields
in the qiieiy match a single
field in the format, only the
first query field appears in
report output. Ifnw or morformat fields match one field
in the query, each format fiel
receives a matching value.
STATE ZIP
.end
The report output for this query appears on the next page.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 100/395
DATABASE REFERENCE MANUAL
Format Types
Template Format (cont.)
Report OutputNAME John AdamsADDRESS 8 Smallwood DriveCITY Longbranch state NJ zip 07740
NAME Lynn AndersonADDRESS 30 Bainbridge Ave.CITY Commack state NY zip 11725
NAME Pat BrownADDRESS 25 Evergreen CircleCITY Norwalk STATE CT zip 06851
The dotted line (...) that appears between one record and the next is
format text. It is typed in the format immediately above the .end
command.
5-19 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 101/395
EFINE FORMAT/PRINT STYLEiDESlGNING REPORT OUTPU
Format Types
GrafTalk Chart Format
The GrafTalk Chart format translates the output from a DQLProcedure into a chart or graph created by DataBase GrafTalk. our
companion business graphics product. To use this format,
DataEase and GrafTalk must be installed on the same computer in
directories located in the DOS PATH. When you run the
procedure, DataEase invokes GrafTalk and displays the output in a
business graphic format, such as a bar or pie chart. For example,assume we want to produce a chart that shows the ACCOUNTBALANCE information for each state. The query looks as follows:
The GrafTalk Chart formatlets you create a chart using
data generated hy a DQLProcedure or Quick Report.
Queryfor CUSTOMERS ;
list recordsSTATE in groups ;
ACCOUNT BALANCEend
sum
When you select the GrafTalk Chart format. DataEase displays
the Formatting screen. The format looks as follows:
FormatSTATE
.items
ACCOUNT
.end
.call GrafTalk /D %r %e
This format is explained as follows:
• GrafTalk puts the Field Names at the top of the format as
column headings for the chart.
•The .call command at the bottom of the format tells DataEase
to invoke GrafTalk after all the records selected by the query
have been processed.
• The /D parameter tells GrafTalk to draw a chart using the data
transferred from DataEase.
•The %r parameter specifies the GrafTalk chart filename
(the report filename with a DBG extension).
•The %e parameter specifies the DataEase data filename
(DAT extension).
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 102/395
DATABASE REFERENCE MANUAL
Format Types
GrafTalk Chart Format (cont.)
When the GrafTalk Chart formal is displayed on the screen, youcan edit the column headings within these restrictions:
1. GrafTalic uses the first eight characters of the field name as
the column name, which can include single embedded spaces
only. The first character of each column name must be a
letter.
2. Column names must be separated by two or more spaces.
3. The column name format line must remain above the .items
formatting command.
The first time you run the procedure, DataBase automatically
invokes GrafTalk so you can define the GrafTalk chart (unless youhave already created the chart —see the note below). In GrafTalkyou specify the details about the chart, for example, whether it is a
bar chart or a pie chart and whether it should display on the screenor be drawn on a plotter. Refer to the Graffalk manuals for
information on how to create charts.
NOTE: You can also create the chart in GrafTalk before
running the DQL Procedure. Be sure to give the
chart the same name as the DQL Procedure with a
.DBG e.xtension. Refer to the GrafTalk manuals forinformation on creating a GrafTalk chart.
To export data to GrafTalk to he used independent ofDataBase, use the GrafTalk export format (see the
Export section of this chapter for more information).
5-21 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 103/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
GrafTalk Chart Format (cont.)
DataBase automatically assigns a disk destination on the Print Stylescreen when you save a GrafTalk chart format. When the
procedure is run , the output is written to a file which is passed to
GrafTalk. DataBase automatically creates a unique DOS file name
for this file. If you wish, you can overwrite this filename on the
Print Style screen (be sure to include the drive letter if it is different
from the default data drive).
When the procedure is run. DataBase executes the .call command,invoking GrafTalk and providing both the GrafTalk chart (the %rparameter) and DataBase data filename (the %e parameter). After
the chart is created. GrafTalk automatically returns control to
DataBase.
To modify the GrafTalk chart definition, enter GrafTalk and use the
Restore Chart Utility to load the chart and make any changes you
wish. After you save the revised chart in GrafTalk. it is
automatically called by DataBase whenever you run the report.
It's not necessary to resave or modify the DataBase procedure in
any way to reflect the changes to the chart. Whenever you run this
report. GrafTalk recreates the chart with your new data.
When the procedure is run.
DataBase executes the .call
command, invoking GrafTalkand specifyini^ both the
GrafTalk chart andDataBase datafde names.
How to Create a GrafTalk Chart FormatThe steps to automatically create a GrafTalk chart format from
DataBase are summarized below.
1. Define your query as desired.
2. Select GrafTalk chart as the format.
3. Save the procedure using Option 7. Save Procedure, on the
DQL menu. You must save the procedure before going any
farther, because DataBase uses the name of the procedure
when it names the GrafTalk chart.
Whenever you run this
procedure. GrafTalkrecreates the chart with younew data.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 104/395
DATAEASE REFERENCE MANUAL
Format Types
GrafTalk Chart Format (cont.)
4. Select Option 2. Start New Procedure. This clears memoryto help DataEase run the procedure.
5. Select Option 1, Run Procedure, and select the procedure you
have just saved.
6. If the Print Style Screen displays, just press F2 SAVE. Donot change anything on this screen. GrafTalk uses the
values that have been automatically entered there by
DataEase.
7. In a few moments, the GrafTalk Main Menu displays.
Design your chart as desired, following the instructions in the
GrafTalk manuals on how to create a chart. Make sure you
specify whether you want your chart to display on the screen
(the default) or go to a printer, plotter, etc.
8. You do not have to enter data, since your data will comefrom DataEase automatically. However, you must use the
GrafTalk Select Data option to select the data to be included
in the chart. See theGrafTalk manuals for more information.
9. Use the GrafTalk Chart Utilities to save the chart. Do not
change the default name provided by DataEase. DataEase
uses this name to find the chart when the procedure is run.
Be sure to answer no to the save data'.' question, since
DataEase provides new data each time you use the chart.
10. From now on. when you run the procedure, the chart will
automatically display (or print). You will not have to use the
GrafTalk menus again.
5-23 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 105/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
GrafTalk Chart Format (cont.)
1 1. Any changes that youmake
to the data inyour form
willbe
automatically reflected in the chart the next time you run the
procedure.
12. If you want to make changes to the chart, you must edit the
chart in GrafTalk. Use the GrafTalk Restore Chart option to
restore the chart, and then make any desired changes. Thechanges will be reflected the next time you run the DQLProcedure.
NOTE: DataBase and GrafTalk each create uniquefilenames for the chart based on the DataBase report
name. Do not change this name and do not save the
current data with the chart. Simply Press B3 to save
the chart, then return to the GrafTalk Main Menuand e.xit. You automatically return to the menu fromwhich the DataBase procedure was run.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 106/395
DATAEASE REFERENCE MANUAL
Format Types
Mailing Labels Format
The mailing labels format lets you quickly generate mailing label
output that can be used with preformatted label sheets. It can also
be used for any multi-wide output report.
The mailing labels format produces output similar to the field per
line format. DataEase positions each output field on a separate
line. The Field Names are omitted from the format. Each field
value begins at the left margin. The fields in each record appear
directly below one another. A single blank line is inserted between
records.
When you select mailing labels, DataEase prompts:
The mailing labels formatgenerates output that can heused for mailing purposes with
or without preformatted label
sheets.
How many labels across?
Enter the number of records to be printed across (in a horizontal
direction). DataEase then asks?
How many columns per label?
Enter the number of characters in the widest field. When you've
answered both of these prompts, press F2 SAVE to save the format.
For example, suppose you want to print each customer's fullNAME, ADDRESS, CITY. STATE, and ZIP CODE on mailing labels that
come 3 across on preformatted sheets. We'll assume that the
widest field is 25 characters. The query looks like this:
Queryfor CUSTOMERS
list recordsFULL NAME ;
ADDRESSCITY
;
state;ZIP .
end
5-25 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 107/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 108/395
DATAEASE REFERENCE MANUAL
Format Types
Export Format
The export format creates a disk file to export data to another
program. It is often used to merge a DataBase data file with aword processed document such as a form letter, or to exportnumerical data from DataBase into a spreadsheet or businessgraphics program. DataBase provides eight export formats,including tho,se for Lotus 1-2-3, Lotus Symphony, WordPerfect,WordStar, MultiMate, and most other programs.
When you select export, DataBase asks:
What is the export format? :
and displays the available formats.
1 : Mail-merge - Export to a Wordstar document.
2: MultiMate - Bxport to a MultiMate document.
3: WordPerfect - Export to a WordPerfect document.
4: GrafTalk - Export to DataBase GrafTalk.
5: Lotus 1-2-3 - Export to Lotus 1-2-3 or LotusSymphony.
6; Variable Length - Export variable length ASCIIrecords.
7: Fixed Length - Bxport fixed length ASCII records.
8: DIF - Bxport using the Data Interchange Format.
Files created using export formats are intended to be read into otherprograms. Therefore, the formats do not include headers, footers,or other non-data output. When creating an export, be sure todirect the report output to a disk destination on the Print Stylescreen and be sure no printer name is specified.
The export format is used to
export data to anotherprogram.
DataBase can export data in
formats used hy Lotus 1-2-3.
Lotus Symphony. WordPerfect,
WordStar. MultiMate. andmost other popular programs.
5-27Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 109/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 110/395
DATABASE REFERENCE MANUAL
Export Format
MultJMate
The MultiMate export format generates a disk file that can be The MultiMate expon formatmerged with MuhiMate documents. When you create a MultiMate exports data in a format thatexport file, remember to add the .doc filename extension used by ™ ^^ merged with MultiMateMultiMate. documents.
The MultiMate format positions each Field Name on a separateline. The field value is inserted under the Field Name in theformat. DataEase inserts special codes in the format to delimitfields (I-) and records (j_).
For example, suppose you want to include each customer's fullNAME, ADDRESS, CITY, STATE, and ZIP CODE, with the Field Names in
your report output. The query looks as follows:
Queryfor CUSTOMERS
;
list recordsFULL NAME
;
ADDRESS;
CITY;
STATE;
ZIP .
end
Format.itemsl-FULL NAMEI-
-ADDRESSI-
-CITYI-
_Lendcall MMERGE -q %m %e
-29Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 111/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Export Format
MultiMate (cont.)
In this format, the MuhiMate formatting commands (|-) are insertedby DataBase on either side of the Field Names and after each field
value. The (J) formatting command is the MultiMate end of
record symbol.
The .call command calls a special DataBase conversion program
named MMERGE that converts the output into the required
MultiMate format.
After DataBase generates the format:
1. Press F2 SAVB to save the format.
2. Select Option 6, Define Print Style on the DQL menu.
3. When the Print Style Specification screen is displayed, select
the disk destination.
4. When you name the output file, be sure to include the DOSpath for the MultiMate directory, and the MultiMate filename
extension .doc as shown below.
C:\MM\MAILLIST.DOC
When you select Run Procedure, the output file is automatically
formatted for use as a MultiMate secondary merge document, with
the following restrictions from the MultiMate program:
• The maximum number of records that can be converted at one
time is 254. Excess records are discarded.
• The maximum field width is 156 characters.
• The maximum number of fields is 64 per record.
• Field Names of more than 1 2 characters may be truncated.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 112/395
DATABASE REFERENCE MANUAL
Export Format
WordPerfect
The WordPerfect export format generates a disk file that can be
merged with WordPerfect documents.
The WordPerfect format positions field values in one continuousline separated by a hexidecimal code (@[120A]) that signals the
end of each field. Field Names are omitted.
For example, suppose you want to include each customer's fullNAME. ADDRESS, CITY, STATE, and ZIP CODE in your report output.
The query looks as follows:
The WordPerfect export
format exports data in aformat that can he mergedwith WordPerfect documents.
Queryfor CUSTOMERS
list recordsFULL NAME ;
ADDRESS ;
CITY;
STATE;
ZIP .
end
Format.items^@[120A]i.end
i@[1 20A]s3a8@[1 20A]«i@[1 20A]^«i@[050A]\
In this format, the @[120A] that is inserted by DataEasegenerates the WordPerfect Merge Code C^R) after each field value.
The @[050A] generates a C^E) Merge Code, the WordPerfect endof record code.
5-31 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 113/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Export Format
WordPerfect (cont.)
After DataBase generates the format:
1
.
Press F2 SAVE to save the format.
2. Select Option 6, Define Print Style on the DQL menu.
3. When the Print Style Specification screen is displayed, select
the disk destination.
4. When you name the output file, be sure to include the full
DOS path for the WordPerfect directory, or the directorywhere you want to store the file.
When you select Run Procedure, the output file is generated as a
WordPerfect secondary merge file. There are no restrictions on the
number of records or the length of the fields.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 114/395
DATA EASE REFERENCE MANUAL
Export Format
GrafTalk
The GrafTalk Export format creates an output file in a format that
can be read by GrafTalk, our companion business graphicsprogram. Unlike the GrafTalk Chart format described earlier in
this chapter (which calls GratTalk and creates a chart from within a
DQL Procedure), the export format creates a file that you useseparately to create a chart or graph with GrafTalk, after you'veexited from DataEase. Use this format if you have DataEase andGrafTalk installed on different computers.
When you select the GrafTalk Export format, DataEase asks if
you want to include the Field Names in the format. If you select
yes, the first record in the output file contains the Field Nameswhich are used as column names by DataEase GrafTalk. If youselect no, Field Names are not included in the report output.
After you create the export file, enter GrafTalk and use the data to
create a chart. In GrafTalk, specify the input as a DataEase file,
and give the DOS name of the file created by DataEase. The first
eight characters of the DataEase Field Names are available for usein GratTalk as column names.
For example, suppose you want to produce a chart that shows the
account balance information for each customer. The query looks as
follows:
The GrafTalk Export formatexports data in a format that
can he used to create GrafTalkcharts and graphs.
Queryfor CUSTOMERS ;
list recordsCUSTOMER # ;
ACCOUNT BALANCEend
FormatCUST #
.Items
ACCT BAL
.end
NOTE: When usin^^ GrafTalk. field names cannot he longer
than H characters. For this reason, we've changedthe format to CUST # and acct bal.
5-33 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 115/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Export Format
GrafTalk (cont.)
Report OutputCUST # ACCT BAL2235 595.004009 350.003525 250.006420 725.001248 300.005512 865.007860 525.001514 675.000900 140.006002 425.00
Once you've created a GrafTalk export format, you can change the
column names within these restrictions:
1
.
GrafTalk uses the first eight characters of the Field Name as
the column name, which can include single embedded spaces
only. The first character of the column name must be a letter.
2. Column names must be separated by two or more spaces.
3.The column name
format line must remain above the .items
formatting command.
For further information on DataBase GrafTalk, see the GrafTalk
Reference Manuals. The Reader section provides information on
GrafTalk Menu Mode.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 116/395
DATABASE REFERENCE MANUAL
Export Format
Lotus 1-2-3
When you select the Lotus 1-2-3 export format. DataBase creates a
report format file that can be read by Lotus 1-2-3 or Lotus
Symphony.
To create the Lotus 1-2-3 format, specify a disk filename with the
appropriate file extension on the DataEase Print Style Screen;
.WKS for Lotus 1-2-3 Version 1
The Lotus 1-2-3 export formatexports data in a format that
can he read into a Lotus
spreadsheet. Do not send aLotus export to the screen:
doing so can lock your system.
.WKl for Lotus 1-2-3 Versions 2 and 3
.WRK for Lotus Symphony
When the Lotus program reads the file, the data is arranged in a
columnar format in the spreadsheet. DataEase creates a row in the
spreadsheet for each record in the source data file, with each
column containing a field. Since DataEase exports values, not
formulas, the data exported by DataEase is compatible with all
three Lotus formats.
The format for a Lotus 1-2-3 export looks like this:
Format.export Lotus 1-2-3
There are three special considerations to keep in mind whenpreparing a Lotus 1-2-3 export:
L DataEase does not display the field layout and you
cannot edit the Lotus 1-2-3 export format.
2. The Lotus 1-2-3 output is not in ASCII format. Sending
it to the screen can lock the system.
3. You cannot use the in groups, in groups with group
totals, or any type of DQL statistical operator in a
Lotus export.
5-35 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 117/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Export Format
Variable Length ASCII
The Variable Length export format generates an ASCII file that
can be easily imported and used by most popular programs.
The Variable Length export format displays one record on each
line. If the program employs specific record and field separator
characters, use these in the format. If not, use a carriage return to
separate records, and use any character that does not appear in the
data to separate fields. DataBase also asks if you want to include
the Field Names as the first line of the output.
For example, suppose you want to include each customer's full
NAME, ADDRESS, CITY, STATE, and ZIP CODE, with the FieldNames
in
your report output and you specify a tilde (~) as the field separator
character. The query looks as follows:
The Variable Length export
format exports data in a
format that can he read hymost popular programs.
Queryfor CUSTOMERS
list recordsFULL NAME
;
ADDRESS ;
CITY;
STATE ;
ZIP .
end
FormatFULL NAME-ADDRESS-CITY-STATE-. items
.end
ZIP
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 118/395
DATABASE REFERENCE MANUAL
Export Format
Variable Length ASCII (cont.)
Report OutputFULL NAME-ADDRESS-CITY-STATE-ZIPJohn Adams~8 Smallwood Drive~Lonqbranch~NJ~07740Lynn Anderson~30 Bainbridge Ave. -Cfommack-NY-1 1725Pat Brown~25 Evergreen Circle~NonA/alk~CT~06851
When choosing field and record separators, be careful not to use acharacter that appears in your data. If you do, the program readingthe data will incorrectly interpret the characters in the data as field
or record separators.
If you use any character other than a carriage return as the recordseparator, enter that character at the
end of the format line followedby a backslash. For example, if the @ sign is used as the recordseparator, it is inserted at the end of the format line followed by abackslash as shown below.
When choosini; field andrecord separators, never itse
any character that appears in
your data. If you use anycharacter other than acarriage return as the recordseparator, you must enter that
character at the end of the
format line followed hy abackslash.
5-37 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 119/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Export Format
Fixed Length ASCII
The Fixed Length exportformat creates an
ASCIIfile that can be
read by many programs, but it should be used only if no other
export format can be used by the target program.
Because each output record is the same length, the Fixed Length
export format produces a file containing a continuous stream of
ASCII data. There are no field or record separators. For example,
to include each customer's full name, address, city, state, and zip
CODE in your output, the query and format look as follows:
The Fixed Length exportformat exports data in a
format many programs can
read, hut it should only he
used when no other export
format can he used hy the
target program.
Queryfor CUSTOMERS
list recordsFULL NAME
;
ADDRESS ;
city ;
state ;
ZIP .
end
Format.items
.end
-\
DataBase automatically inserts a backslash character at the end of
the format line to suppress the carriage return. This character does
not appear in the output.
Report OutputJohn AdamsLynn AndersonPat Brown
8 Smallwood Drive30 Bainbridge Ave.25 Evergreen Circle
LongbranchCommackNorwaik
NJ 07740NY 11725CT 06851
NOTE: Because the Fixed Length export format has no field
or record separators, it can lead to data import
errors in the target program. For this reason, we
recommend that you only use this format if no other
formal is acceptable.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 120/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 121/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Format Types
Custom Format
The custom format lets you design any kind of format you want.
It is particularly useful for generating form letters or designing
output to conform to preprinted business forms. However, because
you must design a custom format from scratch, it should only be
used if none of the predefined formats can produce output close to
the final format you want. If a predefined format produces output
close to your requirements, use the predefined format and then edit
it to serve your custom report requirements.
When you select custom, DataBase displays a blank screen.
You design the report format from this starting point, using any
combinationof formatting
commands, formtext,
andfields.
Remember that a format must always include at least two
commands: .items and .end. Other formatting commands are
optional. A custom format with several formatting commands is
shown below.
The custom format gives ycomplete control over the
appearance of a report, bu
requires a little extra workdesign a custom format. Fthis reason, we recommendthat whenever possible youselect one of the predefined
formats and modify it to su
your needs.
R 1 C
. header
. footer
. itens
.end
Add header text/fields here.
ftdd footer text/fields here
Add forMat text andlist fields here.
F4 ESC F5 Fia
Figure 5-3 - Sample Formatting CommandsUsed to Create a Custom Format
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 122/395
DATABASE REFERENCE MANUAL
Format Types
Custom Format (cont.)
Specifying Fields in a Custom FormatWhen you design a custom format from scratch, you have twooptions for specifying fields. One method is to select all the fieldsas list items in the query and then simply position them in theformat.
The other method is to specify only those fields that require sorting,grouping, or statistical output as list items. The remaining fields
may be directly specified in the format. However, you are notassisted by menus to select Field Names from if you use this
second method.
Report fields are usually
specified as list items in the
query. Fields that do notrequire sorting, grouping, orstatistics can he specified in
the report format withoutappearing in the query.
Cursor Movement on the Format ScreenDataBase formats can be up to 4000 characters wide and up to 16screens long. To scroll the display to the right or left, just movethe cursor off the edge of the screen. The display immediatelyscrolls one half-screen (40 characters) in the chosen direction.
Alternatively, hold down the CTRL key while pressing eitherArrow key for express cursor movement. CTRL -> moves thecursor 40 positions to the right; CTRL <- returns immediately to
Column 1.
A format van have up to 4000characters and occupy up to
16 screens.
NOTE: The Formatting Comrtiaiids and proceduresdescribed in the pages that follow can he used to
create a custom format or to edit a predefinedformal.
When you move the cursor offthe side of the screen, the
display automatically scrolls
in the chosen direction.
5-41Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 123/395
DEFINE FOR MAT, 'PRINT ST\LE: DESIGNING REPORT OUTPUT
Custom Format
Formatting Commands
DataBase provides eight Formatting Commands that control the
appearance of report output, whether it is displayed on screen or
printed as hard copy. Formatting Commands are inserted in the
report format, but they are not displayed in the report output.
Each Formatting Command is preceded by a period and must be
placed in Column 1 at the left margin of the format.
When you type a period in the first column of the format. DataBase
displays the following menu:
1
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 124/395
DATABASE REFERENCE MANUAL
Custom Format
Formatting Commands (cont.)
• The page-level Formatting Commands are .page, .header, and
.footer. The page commands can be used as options in anyreport format. The .header and .footer commands specify text
and/or field values that you want to print at the top and/or
bottom of the pages of the report. The .page commandadvances the report to a new page even if the output has not
reached the end of the current page.
• The external call Formatting Command can be used as an
option at the very end of any format. When all the records
have been processed and the output created, the program
specified by the .call command is automatically invoked.
When the called program is completed, control returns to
DataEase. You must select Start New Procedure before
running a procedure that contains a .call command.
The DQL Formatting Commands can be used in any combination
as long as the format contains an .items command, an .end
command, and one .group trailer command for each .group
header command. Figure 5-4 shows a basic format that includes
only the two required commands, .items and .end. All the
formatting commands are discussed in greater detail in the pages
that follow.
Formatting Commands can hused in any combination as
long as the format contains an.items command, an .end
command, and a .grouptrailer command for eachgroup header command.
itensFULL NftMEADDRESSCITY
end
Figure 5-4 — Basic Format
5-43 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 125/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Custom Format
Required Formatting Commands
The Required Formatting Commandsare .items and .end. A
format must contain one .items command and one .end commandand it cannot contain more than one of each of these commmands.
The .items CommandIn the format, the area above the .items and any .header commandlines is known as the Report Header Area. Any information placed
in the Report Header Area before the first Formatting Commandprints once at the beginning of the report.
The area between the .items command and the next command is
known as the Items Area. Any information placed between the
.items command and the next Formatting Command is printed once
for each record processed by the query. The Items Area usually
contains all the fields and form text you want repeated for each
record.
The .end CommandThe .end command specifies the end of record processing. The area
following the .end command line is known as the Report End Area.
Any information following the .end command is printed once at the
end of the report, after all the records have been processed. If youplace a field after the .end command, statistics for that field can be
generated from all the records processed in the report, rather than
for an individual group. For example, if you request a sum for a
field and place the field after the .end command, a grand total for
all records in the report is generated.
If a .page command is placed after all output lines in the Report
End Area, the printer skips to the top of the next page when the
report has finished printing. If a .call command is used, it must be
placed in the Report End Area and it must be the very last line in
the format.
The area before the .items
.header commands is called
the Report Header Area.
information in this area is
printed once at the beginning
of the report.
The area between the .itemscommand and the ne.xt
Formatting Command is
called the Items Area.
Information in this area is
printed once for each record
processed by the queiy.
The area following the .end
command is called the Rep
End Area. Information in
area is printed once at the
of the report, after all the
records have been processed.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 126/395
DATABASE REFERENCE MANUAL
Custom Format
Required Formatting Commands (cont.)
To illustrate the Required Formatting Commands, the examplebelow shows a query, a predefined columnar format, and output fora report that lists the state, last name, and account balance fieldvalues for each customer.
Queryfor CUSTOMERS
;
list recordsSTATE ;
last name;
account balance .
end
FormatSTATE LAST NAME ACCOUNT BALANCE
.Items
.end
Report Output
STATE LAST NAME ACCOUNT BALANCENJ Adams $595.00NY Anderson S350 00CT Brown ;;250.00NY Cooper 1725.00CT Davis $300.00
Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 127/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Custom Format
Required Formatting Commands (cont.)
Remember that anything between the .items command line and the
next command line displays once for each record processed by the
query. For example, if we edit the format adding a dotted line in
the Items Area, like this:
FormatSTATE LAST NAME ACCOUNT BALANCE
.items
.end
The altered output looks like this:
Report OutputSTATE
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 128/395
DATABASE REFERENCE MANUAL
Custom Format
Required Formatting Command Options
There are two options you can add to an .items command to control
how the information in the Items Area of the format appears in the
output:
The .items nosplit CommandThe .items nosplit command tells DataBase not to split information
from a record between two pages. When the output approaches the
end of a page, if there are not enough lines left on the page to print
the required output for the current record, DataBase automatically
advances to a new page.
The .items nosplit commandprevents data from a single
record appearing on tvi-o
different pages.
The .items across N wide M CommandNormally, information in the Items Area is printed once for each
record in vertical output lines. The .items across N wide Mcommand lets you print this information horizontally as well as
vertically (as mailing labels often require). When you use this
option, DataBase prints N records across the page, starting a newrecord every M characters. You can assign any value you want to
N and M, as long as the product N * M does not exceed the total
specified width for the report.
When using the across N wide M option, either value may bespecified first. If you specify one and not the other, DataBase
divides the output device width by the specified value and
calculates the other value. For example, if you are using an
80-column printer, .items across 3 would print the second record
beginning in column 27 and the third in column 53 (80 / 3 = 26
plus).
The nosplit and/or across N wide M options must appear after
the .items command on the same line in the format. These two
options can only be used in conjunction with the .items Formatting
Command (they cannot be used to modify header, group, or trailer
output).
The .items across N wide Mcommand prints several
records across the page.
This is useful for printing
special jobs like 3 across
mailing labels.
5-47 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 129/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPL'T
Custom Format
Required Formatting Command Options
How to Use the .items across CommandIf you are printing mailing labels and the label sheet has two labels
per row and each label (including the space between the labels) is
30 characters wide, you could insert the across N wide M option in
a predefined Record Entry format as follows:
Format.items across 2 wide 30
.end
The final report output might look like this, with the second label
starting in column 3 1 :
Report OutputJohn Adams8 Smallwood DriveLongbranch, NJ 07740
Pat Brown
25 Evergreen CircleNorwalk, CT 06851
Lynn Anderson30 Bainbridge Ave.Commack, NY 11725
Paul Carter
64 Lake StreetAlameda, CA 94501
NOTE: The mailing labels format, which is designed to
speed address label printing, incorporates the .items
across N wide Moption and prompts you for the Nand M values.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 130/395
DATAEASE REFERENCE MANUAL
Custom Format
Group Level Formatting Commands
The Group Level Formatting Commands are .group header and.group trailer.
Group Level Formatting Commands are used with a query that
includes fields specified either in groups or in groups withgroup-totals (groups in Quick Reports). The Group LevelFormatting Commands control how and where the informationin the query's grouped fields appears in the output.
The Group Level Commands are always used in pairs. There mustbe one .group header and one .group trailer in the report formatfor each li.st field specified in groups or in groups with
group-totals in the query.
For each .group header command in a report format there must bea coirespondinii .group trailer command. If you have more than
one .group header and .group trailer in a format, they correspondto each other as follows: \hQ first .group header corresponds to the
last .group trailer, the second .group header corresponds to the
second from last .group trailer, etc. They are paired from the top
and bottom inward as shown in Figure 5-5.
Group Level FormattingCommands should he usedwhen the query contains fields
specified in groups or in
groups with group totals.
There must he one group
trailer command for each.group header command in
the format.
r
.groupheader A
.group header B
.items
.group trailer B
.group trailer A
.end
Figure 5-5 - Pairing Group Formatting Commands
5-49 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 131/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OLTPLT
Custom Format
Group Level Formatting Commands (cont.)
The area between a .group header command and the nextFormatting Command is known as a Group Header Area. Anyinformation placed in a Group Header Area prints once at the start
of each group. The area between a .group trailer command and
the next Formatting Command is known as a Group Trailer Area.
Any information placed in a Group Trailer Area prints once at the
end of each group. Fields with group level statistics must be placed
in a Group Trailer Area.
A field that has statistics specified in the query can appear in morethan one position in the format. For example, you may want the
ACCOUNT BALANCE field valuc to appear in the .items area, the grouptotal of the account balance field to appear in the .group trailer
area, and the overall account balance total to appear at the end of
the report.
NOTE: You can include a .page command in the GroupHeader or Group Trailer areas to print each group
on a separate page.
The area between a .groupheader command and the
Formatting Command is
called the Group HeaderArea. The information in
area is printed once at the
start of each group.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 132/395
DATAEASE REFERENCE MANUAL
Custom Format
Group Level Formatting Commands (cont.)
The example on this page and the next contains a query, format,
and part of the output for a report that asks DataBase to list the
STATE. LAST NAME, and ACCOL NT BALANCE for cach customer in the
CUSTOMERS form. Group level totals are included in the output.
Queryfor CUSTOMERS ;
list recordsSTATE in groups with group-totals
;
LAST NAME :
ACCOUNT BALANCE item SUm .
end
FormatSTATE LAST NAME ACCOUNT BALANCE
.group header
.items
.group trailer
State Total
.end
Grand Total $^^mIn this example, the .group header text is the state field value.
The .group trailer form text (State Total), which is not a field
value, is typed directly in the format where you want the text to
appear in the report output. The report boundary lines (===) are
entered in the format where you want them to appear in the report
output. In addition to group totals, this format includes a Grand
Total statistic which appears after the .end formatting command.
5-5 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 133/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Custom Format
Group Level Formatting Commands (cont.)
Report OutputSTATE LAST NAME ACCOUNT BALANCE
CT
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 134/395
DATAEASE REFERENCE MANUAL
Custom Format
Page Level Formatting Commands
The Page Level Formatting Commands tell DataBase what
information to print at the top and bottom of each page and when to
advance to a new page. The Page Level Formatting Commands.page, .header, and .footer are explained below. An example that
illustrates the use of the Report Header, the .header command, and.footer commands appears on the facing page.
The .page CommandThe .page command tells DataBase to immediately advance to anew page before continuing to print any further output. If the .pagecommand line is placed first in a Group Header Area, each group,including Group 1, starts printing on a new page. If it is placed
first in a Group Trailer Area, each group's detail information andgroup-level statistics start printing on a new page. If you want eachgroup to begin printing on a new page, but you want Group 1 onthe same page as the Report Header, place the .page command last
in the Group Trailer Area.
If you place the .page command at the end of the Report End Area.DataBase advances to the top of a new page when the report
completes printing. If it is placed first or last in the Items Area,each record is printed on a new page (placing it between fields
causes the records to be split). Any number of .page commands
can be used in a format.
The .page command advancesthe printer to a new pa^e.
The .header [N] CommandThe .header command specifies information to be printed at the top
of each page in a report. The .header command should be placednear the beginning of the format. There can be only otw .headercommand in a format, although none is required.
The area between the .header command and the next FormattingCommand is known as the Page Header Area. Any informationplaced in the Page Header Area prints once at the top of each page.
The most common use of a Page Header is to repeat columnheadings at the top of each page of a report that prints on more thanone page. If you don't want Page Header information to appearuntil a certain page, you can add the optional N parameter to the
.header command, where N is a page number. For example, if youspecify .header 3, in the report format, the Page Headerinformation begins on page 3 and prints on every following page in
the report.
The .header commandspecifies information to heprinted at the top of each pagein a report. There can he only
one .header command in aformat.
The area between between the
.header command and the
next formatting command is
called the Page Header Area,
hiformation in this area is
printed at the top of each page
5-53 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 135/395
FINE FORMAT/PRINT STYLE: DESIGNING REPORT OUT
Custom Format
Page Level Formatting Commands (cont.)
FormatFor example, the following format:
DATAEASE TRAINING COURSE SCHEDULE
CITY DATE LOCATION
.header 2
CITY DATE LOCATION (cont.)
.footer
For more information, contact the DataBase TrainingDepartment at (203) 374-8000..items
.end
produces a report in which the report title (DataBase Training
Course Schedule) appears only on the first page and the columnheading information (cit^', date, location) appears at the top of
every page.
It's important to understand the difference between the Report
Header Area (the area above the first formatting command), and the
Page Header Area in a report format. Information in the Report
Header Area prints once at the start of the/;/-.?? page of a report.
Information in the Page Header Area prints once at the start of eachpage of a report. Note that if your report includes a Report HeaderArea and a Page Header Area which is to print on the first page,
the Page Header prints before the Report Header.
In the example above, in order to avoid printing the columnheading information
before the report title,it
is placed under thereport title in the Report Header Area (to be printed only on
Page 1 ) and then is repeated in the Page Header Area, using the
.header 2 command in the report format (to be printed on every
page, starting on Page 2).
You cannot use more than
one .header command in a
format. The commandnamed .header 2 in this
example is t/ie only .headercommand in the format. Thinformation that appearsonly on the first page is the
Report Header (it is not part
of the .header command).
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 136/395
DATAHASE REFERENCE MANUAL
Custom Format
Page Level Formatting Commands (cont.)
The .footer [N] CommandThe .footer command specifies information to be printed at the
bottom of each page in a report. The .footer command should beplaced at the beginning of the format, right after the .headercommand. There can be only one .footer command in a format,
although none is required.
The area between the .footer command and the next Formatting
Command is known as the Page Footer Area. Any informationplaced in the Page Footer Area prints once at the bottom of eachpage. The most common use of a Page Footer is to place pagenumbers, running totals, footnotes, etc .. at the bottom of each pageof a multi-page report.
If you don't want Page Footer information to appear until a certain
page, you can add the optional N parameter to the .footer
command, where N is a page number. For example, if you specify
.footer 3 in the format, the Page Footer information begins on page3 and prints on every following page in the report.
Fields with summary statistics (for example: salary: sum) can beplaced in the Page Footer Area. Field statistics placed in the PageFooter Area represent statistical information for all records
processed up to the end of the current page (unlike after the .endcommand, where the statistical information takes into account everyrecord processed in the report).
The .footer command specifies
information to he printed at
the bottom of each page in areport. There can he only one.footer command in a format.
The area hcnvecn the .footer
command and the next
formatting command is called
the Page Footer Area.
Information in this area is
printed at the bottom of eachpage.
5-55 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 137/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Custom Format
The .call Command
The .call command is a Custom Formatting Command that lets youcall and run another program at the end of a DataBase procedure.
DataBase swaps itself to either disk or expanded memory (EMS),
thereby freeing most conventional memory for the guest program.
The .call command is inserted after the .end command. The .call
command should be the last line in the report format (it is executed
last, regardless of where in the format it appears). When the
DataBase procedure is completed. DataBase frees as much memoryas possible and immediately calls the specified program.
The called program must be in the same directory as DataBase, or
in a different directory located in your DOS PATH. When the
called program ends, control automatically returns to the DataBase
menu from which the report was run.
The syntax of the .call command is shown below:
.call PROGRAM [/D] [%e] [%r]
PROGRAM is the name of the program to be executed (the DOS.BAT, .COM, or .BXB command for this program).
• The /D option generates a unique disk filename for use by thecalled program to store any output it may generate.
• The %e option returns the output filename entered on the
DataBase Print Styles screen. This is the name of the
DataBase data file to be used by the called program.
• The %r option returns the DOS filename of the DataBase
procedure. This is used to return control to DataBase whenthe called program is completed.
There is an example of the .call command on the next page.
The .call command lets yoexecute an external programat the end of a DataBasereport.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 138/395
DATABASE REFERENCE MANUAL
Custom Format
The .call Command (cont.)
The following command calls DataBase GrafTalk at the end of a
procedure and tells it to draw a chart using the data generated bythe list records command in the query (or list fields in the QuickReport). The data generated by the query is stored in the output
file named on the DataBase Print Styles screen.
.call GrafTalk /D %e %r
The /D parameter creates the unique filename of the GrafTalk chart
definition. The %e parameter passes the output filename specified
on the DataBase Print Styles screen. The %r parameter passes the
filename of the DataBase procedure.
NOTE: A procedure containing a .call command cannot be
run while loaded in memory. You must first unload
the procedure using the Start New Procedure option
on the DQL menu (he sure to save the procedure
first). Then use Run Procedure and select the
appropriate procedure from the list.
5-57 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 139/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 140/395
DATAEASE REFERENCE MANUAL
Editing Formats
Format Text
You can edit, delete, or fully replace any format text in the format.
The report titles, page numbers, column header information,
boundary lines, and other format text can be changed without
affecting the report data output.
For example, if you're using the default Columnar format, youmight want to change the column headings selected by DataBase.
Simply cursor down to the text and type over them. Alternatively,
you can press F7 DELLN to delete the default Field Names. Thenpress F8 INSLN to insert a new blank line on which you can type
your own column headings.
ASCII Extended Character SetWhen you press ALT-FIO, DataBase gives you access to the ASCIIExtended Character set. These characters can be used to create a
number of special format effects, including single or double borders
around all or part of the report layout. Refer to Volume 2. Chapter
2, Form Definition and Relationships for more information on howto use the special ASCII characters in form design and modification.
Format text can he freely
edited without affecting
report data.
5-59 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 141/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Editing Formats
Adding and Modifying Fields
How To Add or Modify FieldsYou can add or modify fields in a format just as you do on any
form. Just place the cursor where you want to add the field (or
inside the field you want to modify), and press FIO FIELD.
If you are adding a field, DataBase displays the Report Field
Definition screen and a menu that lists the names of all the output
fields specified in the report query (see Figure 5-6). Select the field
you want from the menu by highlighting it, then press RETURN.The field (represented by a shaded rectangular area) is immediately
inserted at the cursor position in the format on the screen.
To insert afield in a format,
just place the cursor wherevow want the field to appearand press FIO FIELD.
^aBSSS^MSHE BOK^SSQ^header
footer
itens
end
HasSOMESMSBMia^SSrMane ^^^^^^^^^^^^^^^^^^^^^^^^^^|
(for neu field, leave blank and press RETURN)
Field Type
Suppress Spaces
iitFiy^ Fsri^m F78Rim r&iannnMBff; F7nraron _
Figure 5-6 — Report Field Definition Screen
If you are modifying a field, when you position the cursor in the
field and press FIO FIELD the current field definition is displayed
on the Report Field Definition screen. If the field you specify is aNumber field, DataBase asks which type it is. If you want to
change the number's appearance in the report, you can change the
type in the format (for example, from Floating Point to Fixed Point
or Integer). This change affects only the current report, not the
actual field definition.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 142/395
DATAEASE REFERENCE MANUAL
Editing Formats
Adding and Modifying Fields (cont.)
If you want to add a field tliat you have not specified in the query,
skip the menu choices and press RETURN. DataBase displays awindow inset in the Report Field Definition screen (see Figure 5-7).
Suppress Spaces
Sgjgj Fhjp qp F7|q 5pp[g l^ tBFP|il
If you want to add afield that
you have not specified in the
query, skip the menu choices,
press RETURN, and type the
name of the field or afieldderivation formula in the
window that DataBasedisplays on the Report FieldDefinition screen.
Figure 5-7 - Report Field Formula in Window
In theReport Field Formula window, you can enter the name of a
field from any form specified in the query, a current systemvariable (such as current date), or a Derivation Formula up to
4000 characters in length. You cannot use the all operator, or anysorting, grouping, or statistical operators (except relational
statistical operators) in the Report Field formula. You can userelational statistical operators in the formula.
When the DQL Procedure (or Quick Report) is run, the fields
entered in this window are included in the report output just like list
items specified in the query.
In certain cases, if you misidentify a field in a report field formula,DataEa,se may nevertheless use the correct field. For example, if thefield named SHIP TO is incorrectly called SHIP TO ADDRESS in areport field formula, DataEase may accept the formula and use thevalue from the SHIP TO field.
5-61 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 143/395
DEFINE FORMAT/PRINT STYLE; DESIGNING REPORT OUTPUT
Editing Formats
Adding and Modifying Fields (cont.)
Field Lengtlis and Field TypesThe second question on the Report Field Definition screen is Field
Length. If you want, you can specify a length greater or less than
that of the field itself. You might do this to avoid truncating an
output value or taking up unnecessary space in the report output.
Again, this change affects only the current report, not the actual
field definition.
If you specified more than one statistic fo r the field in the query,
DataEase also asks what statistical value should be output in this
position in the format. If you want the field value itself to appear,
specify item; if you want the total of the field values (such as for a
group total or grand total), specify sum, and so on.
Depending on the specified Field Type. DataEase asks one to three
additional questions when you are creating or modifying a report
format.
If you specify a Number field, DataEase asks:
Suppress the commas? :
Press RETURN to accept the default answer of no and includecommas in the output. Answer yes if you don't want commasincluded in the output. You might use this for an export format in
which commas are used to separate fields.
If you specify a non-integer Number field, DataEase asks:
Suppress the decimal point? :
Press RETURN to accept the default answer of no and include
the decimal point in the output. Answer yes if you don't want a
decimal point included in the output. You might use this for anexport format where the target program works with an assumed
decimal point, or if the field value is normally not decimalized
(percentages, etc.).
DataEase asks you if youto suppress commas anddecimal points from list item
Number fields. If you answyes. the output is modifiedrequested, hut there is no
effect on the Field Definitions.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 144/395
DATABASE REFERENCE MANUAL
Editing Formats
Adding and Modifying Fields (cont.)
Suppressing SpacesFor any type of field. DataBase asks:
Suppress Spaces?
Press RETURN to accept the default answer of no and include
spaces in the output. Answer yes if you don't want the unusedspaces from the field definition included in the output. This lets
you print related fields (such as first name and last name)adjacent to each other without a number of empty intervening
spaces. If you answer yes, all unused spaces before the first
character in the field and after the last character are deleted. Otherfields on the same line move a corresponding number of spaces to
the left in the report output.
For example, if the format has a hrst name and last name field:
DataBase asks if you want t
suppress leading and trailing
spaces from list item fields.
you answer yes. the spaces asuppressed in the report only(there is no effect on the Field
Definition).
Answer yes: John Adams
Answer no: John Adams
If the format has a line with just fields (no form text)and
allfields
are set to Suppress Spaces, the line does not print if all the fields
for any record are blank. Instead, the line is moved to the end ofthe print area. This feature can be very helpful if you are printing
mailing labels with a variable number of lines (such as optional
lines for a person's title or a second address line). All lines are
printed together with no inappropriate blank lines, and the first line
printed on the next label (or preprinted form) is always printed in
the right place.
For other information on printing labels, see the mailing labels
format earlier in this chapter, and the Print Style SpecificationExample: Printing on Continuous Labels at the end of this chapter.
5-63 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 145/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Editing Formats
Saving a Format
After inserting or modifying each field in the format, pressF2 SAVE to include the field in the format. When you finish all
the additions or changes you want to make, press F2 SAVE to save
the modified format in memory. Then, select Option 7, Save
Procedure on the DQL menu. This saves the format on disk as
part of the procedure.
When you finish all the additio
or changes you want to make,select Save Procedure to sav
the modified format as part
the procedure.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 146/395
DATABASE REFERENCE MANUAL
Editing Formats
Printer Control Commands
DataEase provides a number of special Printer Control commandsyou can use to control highlighting and spacing for any part of the
report.
In addition to the commands provided by DataEase, you can sendany control string you want to your printer. When you specify the
control string in the format, you must enclose it in brackets andprecede it with an @ sign, for example: @[1B4333]. However,DataEase does not check these strings for validity or check the
results in any way. Consult your printer manuals for information
on control strings accepted by your printer.
The @ (At Sign) CommandThe @command lets you highlight report information in boldface,
italics, or any special feature your printer supports. The @ can beplaced anywhere in a format except on a line containing a
Formatting Command. The @ character must be immediatelyfollowed by a special character or character group representing the
printer function you want to use.
The @Formatting Command and its following characters do not
take up space in your output; they do not advance the print head.
The @commands are ignored when the report is sent to the screenrather than to a printer (i.e., text that appears in color on the RecordEntry form is not displayed in color in the record entry report
format). However, the corresponding print command is used. Forexample, if text is highlighted with the @u command duringRecord Entry, when the record entry format is used, that text will
be underlined. See the section on Field Highlighting in Volume 2,
Chapter 2, Form Definition, for more information. If the report is
sent to disk, the output depends on the printer defined on the Print
Style screen. If a printer is designated on the Print Style screen, the
printer control codes generated by the @commands are written in
the disk file as printer codes. If there is no printer designated onthe Print Style screen, the @commands are ignored.
NOTE: If you want an at sign (@) to appear in a report
output, enter two consecutive at signs (@@) in the
format.
When you specif)' the control
siring in the forma , you musenclose it in t>rackets andprecede it with an @sign.
The @sign Printer ControlCommand lets you highlight
report information in boldface,
italics, or any special featureyour printer supports.
5-65 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 147/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Editing Formats
Special Effects (Highlighting)
Ifyour printer definition includes special effects options, you can
access them in the report by specifying the @ sign and any
one of the following commands in the format. For completeinformation on defining printers, see Volume 2, Chapter 4, System
Administration.
Command
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 148/395
DATAEASE REFERENCE MANUAL
Editing Formats
Characters per Inch (CPI)
If your printer definition includes multiple CPI options, you can
access them during the report by specifying the @ sign and anyone of the following commands in the format:
Command
cl
c2
c3
c4
Print Effect
First CPI (Character Per Inch) setting in
printer definition.
Second CPI setting in printer definition.
Third CPI setting in printer definition.
Fourth CPI setting in printer definition.
For example, if your printer definition supports 10, 12, 16 and 4CPI and the default is 10 (the first specified), if you enter thefollowing command in the report format:
@c3This text will be sixteen characters per inch.@c1
The @ci command causes the printer to switch to 16 CPI.The (©cl command returns it to the default 10 characters per inch.
See Volume 2, Chapter 4, System Administration, for moreinformation on printer definitions.
The CPI (Charaeters per InchCommands control the
character width in a report.
5-67Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 149/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Editing Formats
Lines per Inch (LPI)
If your printer definition includes multiple LPI options, you canaccess them during the report by specifying the @ sign and any
one of the following commands in the format:
Command Print Effect
The LPI (Lines per Inch)Commands control the
interline spacing in a report.
11 First LPI (Line Per Inch) setting in printer
definition.
12
13
14
Second LPI setting in printer definition.
Third LPI setting in printer definition.
Fourth LPI setting in printer definition.
For example, if your printer definition supports 6, 8, 12, and 16
LPI, and your default is 6 LPI, if you enter the following commandin the format:
@l4This text would appear in the smallest available LPI, in this
case16 LPI (since there are
morethan
6lines
perinch,
thetext is more compressed). This is considered compressedformat. @I1
The @14 command causes the printer to switch to 16 LPI.
The @11 command returns it to the default 6 lines per inch.
See Volume 2, Chapter 4. System Administration, for moreinformation on printer definitions.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 150/395
DATAEASE REFERENCE MANU A L
Editing Formats
Page Size
Page Size
DataBase creates and transmits printer control strings based on youruse of the special @ report formatting commands. However, it
does not adjust page breaks to take into account the spacingchanges made by @ formatting commands.
DataBase provides automatic page breaks based only on the pagesize, margins, and lines per inch specified on the Print StyleSpecification screen. Therefore, if in the middle of a page, youchange to a type style using fewer lines per inch, the page may fill
before DataBase provides the automatic page break. If you changeto a type style with more lines per inch, empty space may be left atthe bottom of a page. Similar problems may occur in providingautomatic line wrap if you change type sizes in the middle of a line.
You can compensate for these formatting adjustments by specifyingdifferent page sizes and margins on the Print Style Specificationscreen. For example, when using more compressed LPI (lines perinch), specify a shorter page length; with less compressed LPI,specify a longer page length.
DataBase inserts page breaksbased on the margin and paglength information you enteron the Print Style
Specification screen.
5-69Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 151/395
DEFINE FORMAT/ PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
The Print Style Specification
The Print Style Specification screen is a special DataBase Systemform that is used to specify the destination, margins, spacing, type
size, and other physical characteristics for report output.
When you select Option 6, Define Print Style on the DQL menu,
DataBase displays the Print Style Specification screen (shown
below). The values you enter in the fields on this screen define the
report destination and the physical appearance of the report output.
The Print Srsle Specification
defines die destination anddimensions of the report
output. It can he used to
temporarily override the
settings stored in the Printer
Definition record. For moreinformation see Define
Printers. in Volume 2.
Chapter 4. System
Administration.
1: Screen Z: Printer J: DiEk
PRINT STVLE SPECIFICflTION
Report Destination: ^^^^| flllou Style nodif ication at run-tineIf disk Output, Filenane:
Nou press DEFAULT UIEU to get default ualues for the renaining fields.Printer Nane
Pause after each page 7
3
-Header-4
Text
ftrea
6
-Footer-
IF PRINTER NAME IS SPECIFIED flBOUE :
PAGE SIZE AND P OSITION ON C flRRIflGE (in inches)
Length ^m Uidth HHJ Starting position |
MARGINS (in inches): SEE F IGURE ON LEFT
l.Left ^H Z. Right
3. Top to Header ^^M 4. Header to TextS. Footer to Botton ^^| b.Text to Footer
TVPE STYLECharacters Per Inch
Highlights 1
F4'aaiBiaiR] Fscjaii fz^w^ Fni^ii/Jinamjiii rsfjiiaagiiaari FftHippiBaiiiRni
Figure 5-8 - Print Style Specification Screen
NOTE: If you do not specif- a Print Style Specification, the
output is sent to the screen by default.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 152/395
DATABASE REFERENCE MANUAL
Define Print Style
Defining the Report Destination
The first choice on the Print Style Specification screen lets you
choose the report's destination. You can send a report to either the
Screen, a Printer, or a Disk File. The default destination is Screen.Each destination is defined as follows:
• Screen: displays the report on the computer's monitor.
• Printer: sends the report to a printer device to generate hardcopy output.
• Disk: creates a disk file for storage. The disk file may beprinted at a later time or used as input by another program.
Each report destination is described in detail in the following pages.
A report can either he sent to
the screen, sent to a printer,
it can he saved as a disk pie.
5-7 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 153/395
DEFINE FORMAT /PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
Report Destination: Screen
If you select Screen as the report destination, you don't have toanswer any other questions on the Print Style screen. Just press
F2 SAVE to save the destination.
When a report is sent to the screen, it always pauses after each page
is displayed. You must tap the Spacebar to continue running the
report.
If you select the Screendestination, there are noquestions to answer.
Press F2 SAVE to save the
destination.
Screen Report Scrolling
When a report is sent to the screen, the following keys are used to
scroll through the report.
Key
PgDnPgUpHOMEEND
CTRL^CTRL^->
<-
Scrolls To
Next Screen
Previous Screen
Start of the Report
Next Screen if you haven't viewed the
Report yet ORHighest Numbered Page that you
have viewed so far
Half Screen (40 columns) to the Right
Half Screen (40 columns) to the Left
Full Screen (80 columns) to the Right
Full Screen (80 columns) to the Left
Reports with Two DestinationsIf a report is usually displayed on the screen but may occasionally
need to be printed, fill in the fields as if the report is to be printed,
then go back to the destination and change it to Screen before
pressing F2 SAVE. If you also tell DataEase to allow style
modification at run-time, when the report is run you only have to
change the report destination to pr int the report.
If a report is usually printed, but may occasionally need to be
exported, don't specify any printer values (they cause problems for
the target program). Instead, choose the Disk destination. When the
report is run, specify the printer name and press F3 DEFAULTVIEW to generate the printer control commands.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 154/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 155/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
Report Destination: Printer
If you select Printer as the report destination, you must answer Ifvou select the Printerseveral questions about your printer and the way you want the destination. \ou must specify
output printed. The following pages discuss the various printer the Printer Name and the
questions in detail (after the page on Print Style Modification). dimensions of the output.
First, you must specify the name of the printer that you want to use.
All printers attached to the system are defined in the Define
Printers option of System Administration. To display the default
printer name and specifications as entered on the System
Configuration form, press F3 DEFAULT VIEW. See Volume 2.
Chapter 4, System Administration, for more information on printer
definitions.
When prompted for the name of the printer, the most flexible
response is to place an asterisk (*) wild card symbol in this field.
When the report is run, the output is sent to the default printer
specified on the System Administration form.
Alternatively, you can specify the printer number (Local 1,
Local 2, Network 1 or Network 2) as listed on the SystemConfiguration form.
When the report is run, DataBase uses the appropriate printer
control codes fo r the specified printer in addition to the information
in the Print Style Specification when it generates the report output.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 156/395
DATABASE REFERENCE MANUAL
Define Print Style
Print Style Modification
The prompt on the Print Style Specification screen that follows
your procedure/report destination choice reads:
Allow style modification at run-time?
If you answer yes, DataEase displays the Print Style screen eachtime you run the procedure, so you can modify the current
specifications. If you modify the Print Style without saving the
procedure afterward, the changes are not saved on disk. If yousave the procedure after making modifications, the modified Print
Style specification is saved, replacing the previous one.
If you answered yes to this question, but you now want to run the
procedure without changing the Print Style, just press F2 SAVEwhen the Print Style Specification screen is displayed. DataEasewill then run the unmodified procedure.
If you answer no to the run-time style modification question,
DataEase does )\ot display the Print Style screen. It immediatelyruns the report using the last saved Print Style choices.
After running a procedure, you can recall the last used Print Style
Specification immediately by pressing F5 DEFAULT FORM. If
you only want to view certain fields, you can recall each fieldindividually by moving the cursor into the field and pressingF6 DEFAULT FIELD. However, once you exit the procedure or
load a new procedure, you can only access the Print Style
Specification that was saved with the procedure.
You can set up a report so the
Print Style can he modifiedeach time the report is run.
5-75 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 157/395
DEFINE FORMAT/PRINT STYLE; DESIGNING REPORT OUTPUT
Define Print Style
Completing the Print Style Specification: Page Size
After choosing the report destination, press F3 DEFAULT VIEW if
the report is being sent to a printer or being sent to disi<. with
printer codes (to be printed later). DataEase displays the default
answers to the remaining questions. You can change any of these
default responses as explained below:
The next prompt asks:
Pause after each page?
Answer yes if you're printing on hand-fed single sheet paper or
envelopes. DataEase will pause after each page and let you changethe paper. Press any key to continue printing.
Answer no if you're printing on continuous feed/form paper.
The next part of the Print Style screen lets you change the default
values for Page Length, Page Width, and/or Starting Position.
Enter the Page Length and Page Width values in inches if they
are different from the defaults.
The Starting Position field should be left blank unless your
printer's form feed mechanism won't let you align the left edge ofthe paper with the left edge of the platen. If this is the case, specify
the distance between the paper edge and the platen edge in inches.
NOTE: These values affect printed reports and reports sent
to disk; tfiey Imve no ejfect on a screen report.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 158/395
DATAEASE REFERENCE MANUAL
Define Print Style
Completing the Print Style Specification: Margins
The left, right, top, bottom, header and fooler margins are specified
in the next six fields on the Print Style screen. All margin values
should be specified in inches. The margins are defined as follows:
1 . Left: The distance between the left edge of the paper
and Xhe first column of text.
Themargin values can he
modified by simply typing in
replacement values. Marginvalues are specified in inches.
2. Right: The distance between the last column of text
and the right edge of the paper.
3. Top to Header: The distance between the top edge of
the paper and \\\q first line of the header. If there is no
header, this margin is ignored. You must include a
.header command in the format to create a margin at
the top of the page.
4. Header to Text: The distance between the last line of
the header and \ht first line of text. If there is no
header, this field is ignored.
5.Footer
toBottom: The
distance between the last line
of the footer and the bottom edge of the paper. If there
is no footer, this margin is ignored. You must include
a .footer command in the format to create a margin at
the bottom of the page.
6. Text to Footer: The distance between the last line of
text and Xhs. first line of the footer. If there is no footer,
this field is ignored.
NOTE: The Margin fields are left blank as a default
indicating a value of 0. The chart at the left side of
the Print Style Screen is a guide showing which field
affects which margin area.
5-11 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 159/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
Completing the Print Style Specification: Type Style
The last five fields on the Print Style screen let you specify the typestyle used for the report as a whole. You can override these
settings for portions of the report by inserting @ (At Sign) Printer
Control commands in the format. The five type style choices are
defined as follows:
1. Characters per Inch: For normal printing this value should
be 10. If your printer supports variable CPI, specify a higher
value for condensed printing or a lower value for expanded
printing. The value specified must be included on the Printer
Definition form.
2. Lines per Inch: For normal printing this value should be 6.
If your printer supports variable LPI, specify a higher value
for condensed printing or a lower value for expanded
printing. The value specified must be included on the Printer
Definition form.
3. Highlights: You can specify up to 12 special user-defined
highlights supported by your printer. The highlights
specified must be stored in the Printer Definition form as
Special Effects. The entire report is highlighted as specified
by your choices. The menu choices are:
1: Bold2; Underline3: Italicize
4: Special 1
5: Special 2
DataBase lets you specify th
rype size, line spacing, andother printer features for the
wiwle report as well as for
emphasis in specific areas
the report.
12: Special 9
For more information on printer definitions, see Volume 2, Chapter
4, System Administration.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 160/395
DATABASE REFERENCE MANUAL
Define Print Style
Saving/Modifying
Saving the Print Style Specification
When you finish filling in the Print Style Specification form, press
F2 SAVE to save your specifications. DataEase checks to be sure
all required fields are filled and saves the specification form. If oneor more required fields are blank, DataEase prompts:
Print specification is incomplete
Do you want to complete the specification at run-time?
If you answer yes and you also answered yes to the Print Style
Modification at run-time question, the incomplete specification is
accepted and DataEase returns to the DQL menu. If the
specification is incomplete and you answered no to the run-time
modification question, DataEase prompts:
Data in this field is required
The Print Style Specification form remains on the screen with the
cursor in the first incomplete field. Complete the form and press
F2 SAVE again.
When you finish filling in the
Print Style Specification, pressF2 SAVE to save it in the
computer's memory. Topermanently save the Print
Style on disk, select Option 7.
Save Procedure, on the DQL
Modifying the Print Style Specification
If you answered yes to the question:
Allow style modification at run time
the Print Style Specification form appears on the screen wheneveryou run the report. You can then change any fields you wantbefore running the report. When you finish making changes, press
F2 SAVE to run the report with these changes.
You can change your answer to the style modification question byselecting Modify Print Style from the DQL menu and overwriting
your previous response.
5-79 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 161/395
DEFINE FORMAT /PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
Examples
Screen Destination: To send the reportoutput to the screen, leave
Printer Name and related fields blank.
P RINT ST YLE SPECIFICftTIONReport Destination: ^^^^^ Allou Style Modification at run-tine
If disk Output. Filename
Nou press DEFAULT UIEU to get default -.v alues for the r enaining fields.Printer NanePause after each page ?
3—Header-
4
Text
Area
6-Footer-
S
IF PRINTER NAME IS SPECIFIED ABOUE :
PAGE SIZE AND POSITION ON C ARRIAGE < in inches)Length ^^^| Uidth |^^| Starting position |
MARGINS (in inches): SEE F IGURE ON LEFTl.Left ^^M Z. Right3. Top to Header ^^H 4, Header to Text5. Footer to BottoM ^^H 6. Text to Footer
TYPE STYLECharacters Per InchHighlights 1
Screen Preview: To preview a printed report on screen, specify the
Printer destination. After all related questions are answered,
change the report destination to Screen. The screen output is
formatted as it will appear when printed on the specified printer
(within the limitations of the screen).
P RINT ST YLE SPECIFICATIONReport Destination: ^^^^Q Allou Style Modification at run-tine
If disk Output. Filenane:
Nou press DEFAULT UIEU to get default u alues for the r enaining fields.Printer NanePause after each page 7
3-Header-
4
Text
Area
-Footer-5
IF PRINTER NAME IS SPECIFIED ABOUE
PAGE SIZE AND P OSITION ON C ARRIAGE (in inches)Length Q|]^H Uidth |^^| Starting position |
MARGINS (in inches): SEE FIGURE ON LEFTl.Left3. Top to Header5. Footer to BottOM
TYPE STYLECharacters Per InchHighlights 1
Z. Right4. Header to Text6. Text to Footer
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 162/395
Define Print Style
DATABASE REFERENCE MANUAL
Examples
Printer Destination: To print on continuous roil labels, specify
Page Length as 0. Leave Margins fields blank.
P RINT ST YLE SPECIFICATIONReport Destination: j^^Q^D flUou Style nodification at run-tine
If disk Output. Filenane:
Nou press DEFAULT U I EU to get default v alues for the r enaining fields.Printer NanePause after each page ?
3—Header-
4
Text
Area
6-Footer—
5
IF PRINTER NAME IS SPECIFIED ABOUE :
PAGE SIZE AND P OSITION ON C ARRIAGE < in inches)Length S^^| Uidth ^^^B Starting position |
MARGINS < in inches): SEE F IGURE ON LEFTl.Left ^^m Z. Right3. Top to Header ^^H 4. Header to TextB. Footer to BottoM ^^^ b. Text to Footer
TYPE STYLECharacters Per InchHighlights 1
Fsraam r^^wa F^iiiamnKMi nsii Fsmagf ^ Fhiaiawwa^^
Printer Destination: To print on individually inserted pages,
specify the complete print style and answer yes to Pause question.
DataEase stops after each page to let you insert the next sheet or
envelope.
P RINT ST YLE SPECIFICATIONReport Destination; |2QQ Allou Style Modification at run-tine
If disk Output. Filenane:
Nou press DEFAULT UIEU to get default u alues for the r enaining fields.Printer NanePause after each page ?
3
—Headei4
Text
Area
IF PRINTER NAME IS SPECIFIED ABOUE :
PAGE SIZE AND P OSITION ON C ARRIAGE (in inches)Length E|B| Uidth |^^B Starting position |
MARGINS (in inches): SEE F IGURE ON LEFTl.Left HJH Z. Right3. Top to Header
^^H4. Header to Text
5. Footer to Botton ^^H 6. Text to Footer
5 -XI Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 163/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Define Print Style
Examples
Disk Destination: Toexport the
reponoutput to another program,
specify the filename including a pathname if appropriate. Be sure
that Printer Name and related fields are blank.
P RINT ST YLE SPECIFICATIONReport Destination; [^Q^^| Allou Style Modification at run-tine
If disk OutpCSCUSTOMERS
Nou press DFFrtlH.T UIEU to get default ^^ alues for the r et-ta ining fields.Pniitfr NanePause after each page 7
Text
Area
&—Footer—
IF PRINTER NAME IS SPECIFIED ABOUE :
PAGE SIZE AND POSITION ON CARRIAGE (in inches)Length ^^^| Uidth ^|^B Starting position |
MARGINS ( in inches): SEE F IGURE ON LEFT1. Left ^^H Z. Right3. Top to Header ^^H 4. Header to Text5. Footer to Botton ^^^| t.Text to Footer
TYPE STYLECharacters Per 1 nchHighlights 1
ni.u/J»*«lldi
Disk Destination: To save the report on disk for later printing,
specify the report Printer destination. After answering all related
questions, change the report destination to Disk and enter the
filename and target drive letter. The resulting disk file output canbe printed later using the DOS COPY command. This output
cannot be printed on individually inserted sheets.
PRINT STVLE SPEC I F I CftTIONReport Destination: [^Q^^| rtllou Style Modification at run-tiMe
If disk Ou tput. FilenaMB:
Nou press DEFAULT I'lEU to get default ualues for the renaining fields.Printer Nane U:Km±l>\±UZStmmPause after each page ?
3
-Headei4
Teyt
Area
8-Footer
5
IF PRINTER NAME IS SPECIFIED ABOUE :
PAGE SIZE AND P OSITION ON C ARRIAGE C in inchesLength 3^^| Uidth ^^^| Starting position |
MARGINS I in inches): SEE F IGURE ON LEFTl.Left ^^H Z. Right3. Top to Header ^^H 4. Header to TextS. Footer to Botton ^^| 6. Text to Footer
TVPE STVLECharacters Per InchHighlights 1
u^mssasEiim
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 164/395
DATABASE REFERENCE MANUAL
Chapter 6
DQL Lexicon
INTRODUCTIONhe DQL Lexicon is a complete list of all the DataBase QueryLanguage concepts, terms, and symbols presented in alphabetical
order. Each query language term is identified and explained in the
lexicon in the following format:
Keyword: The term or symbol as it appears in the DQL.
Type: Identifies the type of the term. DQL terms are divided into
five main groups: commands, functions, keywords, operators,
and symbols. Each of these groups contains several
subordinate types.
Purpose: An overview that explains the general purpose of the term.
Syntax: A generic query statement that demonstrates the proper format
in which the term is used in a query. For an explanation of the
syntax format itself, see Typographical Conventions on the
next page.
Returns: Specifies the type of value that is returned by a function or
operator.
Usage: Additional details concerning the use of the term in general
and special purpose contexts.
LAN: Special considerations or restrictions that govern the use of
the term when running DataBase on a LAN (Local Area
Network).
Example: One or more examples that demonstrate the use of the term in
a query statement or a complete query. When a complete
query is presented, an explanation of the query and an
example of the report output is generally included.
See Also: A cross reference of related terms, including all terms of the
same type and other important temis used in the preceding
example.
In this Lexicon, each entrybegins on a separate page.
However, some entries
continue for two or morepages. If an entry Joes not
require one of the formatsections defined on this page,that section is omitted fromthe explanation.
6-1 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 165/395
DQL LEXICON
DQL LEXICON TYPOGRAPHICAL CONVENTIONS
Except as noted below, the typographical conventions used in this lexicon
are the same as those used in the previous chapters. These conventions
are explained in Chapter 1. Introduction to DQL Advanced Processing.
Syntax Diagrams
In the syntax diagrams, items enclosed in brackets [ ] may or may not be
included in the statement. If they are included, the quotation marks and
parentheses must appear where shown. When items are separated by a
vertical bar I, either may be used. For example, in the syntax statement:
any FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)] FIELDNAME
you can use either a FORMNAME or a RELATIONSHIP in the query
statement. A UNIQUE RELATIONSHIP NAME can be included ornot. If selection criteria are included in the statement, the criteria must be
enclosed in parentheses. A FIELDNAME rtntst be included at the end of
the statement followed by a semicolon.
In the syntax diagrams, the terms shown in lower case (any, named, andwith) are DQL terms. The words shown in upper case (FORMNAME,RELATIONSHIP, UNIQUE RELATIONSHIP NAME, and
FIELDNAME) are generic terms. In an actual query you replace such
terms with specific data by typing in the actual database names or
selecting the appropriate items from the Interactive menus.
Margin Notes
The notes printed in the margins contain cross references, syntax
restrictions, and other important information. Unlike the rest of the
DataBase Reference Manual, facts given in the lexicon margin notes
may not appear elsewhere on the same page.
Typesize
The typesize used in the lexicon is slightly smaller than the size used in
the previous chapters.
Database Forms Used in the Examples
Most of the examples in the lexicon are based on the CUSTOMERS andINVOICES forms shown in Figure 3-1 at the start of Chapter 3.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 166/395
DATAEASE REFERENCE MANUAL
Symbols
Symbols are tools that c la ri fy a query's meaning, perform basic mathoperations, and help retrieve data when you can't recall the exact values
you want a query to retrieve. The symbols listed below can be used in
Form Definition derivation formulas as well as DQL Advanced Processingoperations.
There are four groups of DQL symbols as specified below:
Punctuation Symbols
Punctuation symbols are used to clarify, separate, and conclude various
operations specified in a query. The double dash symbol precedescomments used to annotate a query.
Math Symbols
Math symbols are used to perform arithmetic operations on numericvalues.
Wildcard Symbols
Wildcard symbols are used to specify unknown characters in selection
criteria text values.
Comparison Symbols
Comparison Symbols are used to compare one value to another. TheAssignment Operator symbol is used to assign a value to a field or
variable.
For a full explanation of any of the DQL symbols, see the entry in the
Lexicon. The symbols are presented first, beginning on the next page.
Punctuation Symbols
; (semicolon)
: (colon)
. (period)
( ) (parentheses)
(quotation marks)-- (dash)
Math Symbols
+ (plus)
- (minus)* (multiplication)
/ (division)
Wildcard Symbols
* (asterisk)
? (question mark)~ (tilde)
Comparison Symbols
< (less than)
<= (less than
or equal to)
= (equals)
> (greater than)>= (greater than
or equal to)
:= Assignment
Operator
6-3 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 167/395
DQL LEXICON
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 168/395
DATAtASE REFERENCE MANUAL
Symbols (cont.)
Keyword: /(division)
Type: Arithmetic Symbol
Purpose: The / symbol tells DataBase to divide Value I by Value 2.
The result is the quotient of the division.
Syntax: VALUE 1 / VALUE 2
Returns: A numeric value.
Example: monthly rent := annual rent / 12
See Also: +, - *
When typing fractions like
10 1 12, DataBase requires
that you type a space t>efore
and after the I division
svmhol.
QKeyword: * (multiplication)
Type: Arithmetic Symbol
Purpose: The * symbol tells DataEa.se to multiply Value I by
Value 2. The result is the product of the multiplication.
Syntax: value1 *
value 2
Returns: A numeric value.
Example: wages := hourly wage * total hours worked
See Also: +, -, /
6-5 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 169/395
DQL LEXICON
Symbols (cont.)
QKeyword: * (wildcard)
Type: Wildcard (Character Pattern) Symbol
Purpose: The * asterisk wildcard character can be used to substitute
for any number of unspecified characters in an alphanumeric
string. It can be used up to twice in a string to show that an
unspecified number of characters may have been omitted.
The symbol can be used in any logical comparison or record
selection context.
Example 1 : for CUSTOMERS with last name = *son ;
list recordsLAST NAME in order .
end
This query tells DataBase: List the records for customers whose last nameends with the letters son. The report output for this query, arranged in
alphabetical order by LAST name, might look as follows:
LAST NAME
AndersonBatesonDavidson
HansonRobertson
Example 2: for CUSTOMERS with last name = 's?n ;
list recordslast name in order .
end
This query tells DataBase: List the customers whose last name ends with
the letters s and /;. with an unknown value between them. The report
output for this query might look as follows:
AndersenAndersonBatesonDavidsonHansenHansonRobertson
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 170/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 171/395
DQL LEXICON
Symbols (cont.)
Keyword: - (tilde)
Type: Wildcard (Sound Pattern) Symbol
See Also: *. ?
Purpose: The ^ wildcard character is used to find data that sounds
like a specified text string. The ~ symbol can be used before
any number of characters or words; it locates all the records
that have a similar sound to the specified string. In making
comparisons with the ^. DataEase matches the consonant
pattern: vowels and spaces between words are ignored.
Consonants with similar sounds (such as f and ph) are treated
as the same character. The ~ symbol can be used in any
logical comparison or record selection context and may beused in a text string after another wildcard symbol (* or ?).
See Volume 1. Chapter 2. Record Entry, for more information.
Example: -Fosteror CUSTOMERS with LAST NAME =
list recordsLAST NAME in order ;
FIRST NAME .
end
This quer\- tells DataEase: List the records for customers whose last namesounds like Foster. The report output for this query, arranged in
alphabetical order by LAST NAME, might look as follows:
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 172/395
DATABASE REFERENCE MANUAL
Symbols (cont.)
Keyword: : (colon)
Type:
Purpose:
Syntax:
Example:
Punctuation Symbol
A colon is inserted between a field name and one or more
statistical operators when you want to include statistics in the
report output.
See Also: item, sum, mean,max, min, std.dev., std.err.,
variance {Statistical
Operators) and item, count,
percent (ConditionalStatistical Operators).
VALUE : statistical operators
for CUSTOMERS ;
list recordsLAST NAME in order ;
ACCOUNT BALANCE : item sumend
This query tells DataBase: List the CUSTOMERS records showing each
customer's LAST NAME, ACCOUNT BALANCE, and the total of all the
ACCOUNT BALANCE values at the end of the report. The report output for
this query, artanged in alphabetical order by LAST NAME, might look as
follows:
LAST NAME ACCOUNT BALANCE
Adams
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 173/395
DQL LEXICON
Symbols (cont.)
aKeyword: ( ... ) (parentheses)
Type: Punctuation Symbol
Purpose: Parentheses are used as separators in selection criteria and
function arguments and to clarify the sequence of mathematic
operations. The use of parentheses is especially important
when combining selection criteria using the and and or
operators or when clarifying the order of evaluation of
otherwise ambiguous expressions and operations.
500 and (state = NYExample: for CUSTOMERS
with ACCOUNT BALANCEor STATE = NJ )
;
list recordsLAST NAME in orderACCOUNT BALANCE ;
STATE .
end
With the parentheses as shown, this query tells DataBase to list all the
customers from either New York or New Jersey whose ACCOUNTBALANCE is greater than 500. The report output from this query,
arranged alphabetically by LAST NAME, might look as follows:
LAST NAME ACCOUNT BALANCE STATE
Adams
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 174/395
DATABASE REFERENCE MANUAL
Symbols (cont.)
DKeyword: . (period)
Type: Punctuation Symbol
Purpose: A period marks the end of an action that may or may not befollowed by other actions.
In a query, you must insert a period after:
1. Any DQL Control command.
2. Any assign, break, deflne. or exit Procedural commandand after each action in a case, if, or while command.
3. The last item in a list records, modify records,
delete records, or enter a record Processing command.
Example: for CUSTOMERS ;
list recordsLAST NAME in order ;
ACCOUNT BALANCE;
STATE .
end
This query tells DataBase: List each customer's LAST NAME, ACCOUNTBALANCE, and STATE. The report output, arranged in alphabetical order
byLAST NAME, might look like this:
See Also: ; (semicolon)
In a Low Level query,
a period marks the end of the
procedure. In Hii;h Level,
multiple actions are permitted.
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 175/395
Symbols (cont.)
DQL LEXICON
0]
Keyword: ; (semicolon)
Type: Punctuation Symbol
Purpose: A semicolon is used to separate items in a query action.
The semicolon is always used after a for command that
specifies the query's Primary form; after ad-hoc selection
criteria are specified; and after each output item except the
last in a list records, modify records, or enter a record
command.
Syntax:
Example:
FIELDNAME I CONSTANT VALUE
for CUSTOMERS with ACCOUNT BALANCE > 500 ;
list recordsLAST NAME in Order ;
ACCOUNT BALANCE;
STATE .
end
See Also: . (period)
The semicolon is used after a
for command that specifies th
query' s Primary form; it is no
used when the for commandspecifies a form other than the
Primary form.
This query tells DataEase: For customers whose ACCOUNT BALANCE is
greater than 500. list each customer's LAST name, ACCOUNT BALANCE,
and STATE. The report output, arranged in alphabetical order by LAST
NAME, might look as follows;
LAST NAME ACCOUNT BALANCE STATE
Adams
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 176/395
D .'^ T .A K .Ji S E REFERENCE M .A \ t AL
Symbols (cont.)
Keyword: ... (quotation marks)
Type: Punctuation Symbol
Purpose: Quotation marks are always used to enclose a text constant.
Quotes are also used to enclose the name of a variable in a
define command and to enclose an optional relationship namewhen It IS first specified in a query by the named operator.
Sec Also: define, named
Syntax: TEXT CONSTANT '
define temp VARIABLE NAME
sum of CUSTOMERS named HIGH VOLUME with
ACCOUNT BALANCE > 500 ;
Example: for CUSTOMERS with statelist records;
LAST NAME in Order ;
ACCOUNT BALANCE;
STATE .
end
NY
This query tells DataEase: For customers who live in New York,list each customer's last n,ame. accolnt b.al.ance, and state.
The report output, arranged in alphabetical order by LAST NA.ME,miaht look as follows:
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 177/395
DQL LEXICON
Symbols
SKeyword: := (Assignment Operator) See Also, assign
Type: Operator Symbol
Purpose: The assignment operator symbol is used whenever the \ alue
of a variable or field is assigned or modified.
Syntax: fieldname = assigned value
VARIABLE NAME := ASSIGNED VALUE
Example 1 : address := data-entry address ;
This query statement tells DataBase to modify the address field by
copying the value entered in the ADDRESS field on the Data-entry form.
Example 2: assign temp discount := INVOICES order total0.10 .
This query statement assigns a value to a temporary variable namedDISCOLNT. The value assigned to the variable is 109f of the order
total on the invoice.
Volumes
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 178/395
DATA K ASF. R E F F. R E N C E MAN L: AL
Symbols (cont.)
aKeyword: < (less than)
Type: Comparison Operator Symbol
Purpose: The < (less than) symbol is used to compare one value to
another. It specifies that the value to the left of the s\ inbol
is les.s than the value to the right of the symbol.
Syntax: value i < value 2
Example: for CUSTOMERS with account balance < 500 ;
This query statement selects CUSTOMERS records that have a value less
than 500 in the ACCOUNT BALANCE field.
Keyword: <= (less than or equal to)
Type: Comparison Operator Symbol
Purpose: The <= (less than or equal to) symbol is used to compare one
value to another. It specifies that the value to the left of the
symbol is less than or equal to the value to the right of the
symbol.
Syntax: value 1 <= value 2
Example: for CUSTOMERS witfi ACCOUNT balance 500
This query statement selects CUSTOMERS records that have a value less
than or equal tn .SOO in the ACCOUNT BALANCE field.
.Sec AIsd: <=, =, >, >=
between, not
Sec Also: <. =, >, >=
between, not
6-15 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 179/395
DQL LEXICON
Symbols (cont.)
BKeyword: = (equals)
Type: Comparison Operator Symbol
Purpose: The - (equals) symbol is used to compare one value to
another. It specifies that the value to the left of the symbol is
equal to the value to the right of the symbol.
See Also: <, <=, >, >=,
between, not
VALUE 1 = VALUE 2yntax:
Example: for CUSTOMERS with account balance = 500 ;
This query statement selects CUSTOMERS records that have a value
equal to 500 in the ACCOUNT BALANCE field.
BKeyword: > (greater than)
Type: Comparison Operator Symbol
Purpose: The > (greater than) symbol is used to compare one value to
another. It specifies that the value to the left of the symbol is
greater than the value to the right of the symbol.
See Also: <, <=, =, >=,
between, not
Syntax: VALUE 1 > VALUE 2
Example: for CUSTOMERS with account balance > 500 ;
This query statement selects CUSTOMERS records that have a value
greater than 500 in the ACCOUNT BALANCE field.
Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 180/395
DATABASE REFERENCE
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 181/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 182/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 183/395
DQL LEXICON
Ad-hoc Relationship
Keyword: Ad-hoc Relationship
Type:
Purpose:
Syntax
Usage:
Concept
Like a predefined relationship, an ad-hoc relationship is a
relationship between two sets of records, but an ad-hoc
relationship is created during a queiy instead of being
specified on the Relationships form during the Form
Definition process. An ad-hoc relationship lets you easily
access records in another form while processing a procedure.
However, because the ad-hoc relationship isn't stored as a
part of the database, it must be redefined in each procedure.
An ad-hoc relationship is created by combining a relational(or relational statistical) operator with the name of an
unrelated form, or the name of a predefined relationship to
which new selection criteria are added.
When you create an ad-hoc relationship, the named operator
is used to give the set of related records a unique name. This
lets DataBase identify each distinct set of records selected
from a given form.
relational operator FORMNAME|
RELATIONSHIP [named
UNIQUE RELATIONSHIP NAME ] [with (selection criteria)]
[FIELDNAME] ;
Once an ad-hoc relationship is created with certain selection
criteria, the criteria cannot be changed during the remainder
of the query. If you want to selec t another set of records, you
must crea te a new ad-hoc relationship and give it a new name
using the named operator.
-^ This entry continues on the next page
See Also: all, any, count of
highest of, lowest of, meansum of, named. Relationships
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 184/395
DATABASE REFERENCE MANUAL
Ad-hoc Relationship (cont.)
Example: for CUSTOMERS with account balance > 500 ;
list recordsLAST NAME in order ;
sum of INVOICES named MAY with(CUSTOMER # = CUSTOMERS CUSTOMER #
and DATE between 05/01/89 to 05/31/89 )
ORDER TOTAL .
end
As there is a predefined relationship between CUSTOMERS andINVOICES based on the customer # field, the statement;
sum of INVOICES named MAY with(CUSTOMER # = CUSTOMERS CUSTOMER #
and DATE between 05/01/89 to 05/31/89)
ORDER TOTAL .
creates an ad-hoc relationship by adding the additional DATE selection
criteria to the existing predefined relationship.
This query tells DataEase: 1) Select all the CUSTOMERS records that
have a account balance greater than $500. 2) Find all these customers'invoices in the related INVOICES form that are dated during May 1989.
3) For each record selected from the CUSTOMERS form, list the
customer's last name and the sum of that customer's May invoices.
Note that if we also want DataEase to list the sum of these customers'JUNE invoices, we have to create a new ad-hoc relationship and give it a
unique name as shown below:
for CUSTOMERS with ACCOUNT balance > 500 ;
list recordsLAST name in order ;
sum of INVOICES named MAY with(CUSTOMER # = CUSTOMERS CUSTOMER #
and DATE between 05/01/89 to 05/31/89 )
ORDER TOTAL ;
sum of INVOICES named JUNE with(CUSTOMER # = CUSTOMERS customer #
and DATE between 06/01/89 to 06/30/89 )
ORDER TOTAL .
end
6-21 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 185/395
DQL LEXICON
all
Keyword: all
Type: Relational Operator
Purpose: The all operator selects every record in a related form that
matches the current record being processed.
See Also: any
Syntax: all FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)) FIELDNAME :
Returns: The specified value from every matching record in the related
form. The type of value returned is the same as that of the
specified field. For example, if you're selecting text fields,
the returned value is text.
Usage: The all operator can only be used to specify report output
items in a list records command. It cannot be used to specify
selection criteria or to select related records from more than
one form on each relationship level (i.e., one Secondary form,
one Tertiary form, etc.). See Example 2.
Examplel: for CUSTOMERS with account balance > 500 ;
list recordsLAST name in groups ;
all INVOICES INVOICE # ;
all INVOICES ORDER total .
end
This query tells DataEase: 1) Select all the CUSTOMERS records that
have an ACCOUNT balance greater than $500. 2) Find all these
customers' invoices in the related INVOICES form. 3) For each record
selected from the INVOICES form, list the invoice # and the ORDERtotal. The output from this query, arranged in groups by LAST NAME(from the CUSTOMERS form), miaht look as follows:
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 186/395
DATABASE REFERENCE MANUAL
all (cont.)
The all operator lets you retrieve information from one form on eachrelationship level. To demonstrate this, E.xample 2 introduces a thirdform called RETURNS. The RETURNS form keeps track of any returned
merchandise and the amount refunded for each invoice. The RETURNSform is related to the INVOICES form by the INVOICE # field.
Exampie2: for CUSTOMERS with account balance > 500 ;
list recordsLAST NAME in groups ;
all INVOICES INVOICE # ;
all INVOICES ORDER TOTAL ;
all INVOICES all RETURNS refund total .
end
This query tells DataEase: 1) Select all the CUSTOMERS records thathave an ACCOUNT balance greater than $500. 2) Find all thesecustomers' invoices in the related INVOICES form. 3) For each recordselected from the INVOICES form, list the invoice # and the orderTOTAL. 4) For each invoice, find the related record in the RETURNS form(i.e., the record with the same INVOICE #) and list the REFUND TOTAL.
The output from this query, arranged in groups by LAST NAME (from theCUSTOMERS form), might look as follows:
The e.xample on this pageshows how all can he used to
access information in aTertiary form by iisini; arelated Secondary formThe all operator cannot heused to access information
from more than one form onthe same relationship level.
LAST NAME
Adams
CooperEvans
ivers
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 187/395
DQL LEXICON
ampm
Keyword: ampm
Type: Time Function
Purpose: The ampm function evaluates a value expressed in the
24-hour time format (HH:MM:SS) and returns the appropriate
abbreviation AM (before noon), or PM (after noon).
See Also: current, hour,
minutes, seconds, timeamp
Syntax: ampm(TIME VALUE)
Returns: A text value (either AM or PM).
Usage: Time values from midnight (00:00:00) to ( 1 1 :59:59) return
AM. Time values from noon (12:00:00) to (23:59:59) return
PM.
Examples: ampm(08:15:25)Returns: AM
ampm(1 5:30:50)Returns: PM
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 188/395
DATAEASE REFERENCE MANUAL
and
Keyword: and
Type: Logical Operator
Purpose: The and operator combines two sets of selection criteria.
Syntax:
See Also: < , <=,
between, or, not
=, >, >=
SELECTION CRITERIA 1 and SELECTION CRITERIA 2
Returns: The values in records that satisfy both of the selection criteria
statements.
Usage: The and operator requires that a record meet all the specified
selection criteria to be processed. The or operator requires
that a record meet any of the specified criteria to be
processed. When selection criteria are combined with both the
and and or operators in one statement, the criteria must be
enclosed in parentheses to clarify the meaning.
Examples: for CUSTOMERS with state = NYand ACCOUNT balance > 500 ;
This statement tells DataBase: Process only those CUSTOMERS records
that contain NY in the STATE field and a value greater than 500 in the
ACCOUNT BALANCE field. Only records that satisfy both these criteria are
processed.
for CUSTOMERS with (STATE = NY or STATE = NJ )and account balance > 500 ;
This statement tells DataBase: Process only those CUSTOMERS records
that contain either NY or NJ in the STATE field and a value greater than
500 in the ACCOUNT BALANCE field.
Again, only records that satisfy horli sets of criteria are processed.
6-25 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 189/395
DQL LEXICON
any
Keyword: any
Type: Relational Operator
Purpose: The any operator selects the first record in a related form that
matches the current record being processed.
See Also: all
Syntax: any FORMNAME |RELATIONSHIP [named UNIQUE
RELATIONSHIP NAME ] [with (selection criteria)] FIELDNAME ;
Returns: The specified value from the//;-i7 matching record in the
related form. The type of value returned is the same as that
of the specified field.
Usage: The any operator can be used to:
1. Specify output items in a list records command.
2. Specify selection criteria.
3. Select related records from more than one form on each
relationship level (i.e.. Secondary forms. Tertiary forms,
etc.). See Primary Form for details on relationship levels.
Example: for INVOICES with order total > 500 ;
list recordsINVOICE # in order ;
ORDER TOTAL;
any CUSTOMERS last name .
end
This query tells DataBase: 1) Select all the INVOICES records that have
an ORDER TOTAL greater than 500. 2) For each record selected from the
INVOICES form, list the invoice # and the ORDER TOTAL. 3) For each
record selected from the INVOICES form, find the first (and only the
first) related record in the CUSTOMERS form. 4) For each record
selected from the CUSTOMERS form, list the customer's LAST NAME.
The output fromthis
query, arrangedin
order by INVOICE #, might look asfollows:
Note that the any operator
(unlike the all operator) caccess information in anynumber of forms on the sarelationship level.
INVOICE* ORDER TOTAL LAST NAME
A1 17095
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 190/395
DATABASE REFERENCE MANUAL
asm
Keyword: asin (arcsine)
Type: Trigonometric Function
Purpose: The asin function calculates the arcsine of a numeric value.
The result is an angle expressed in radians between -nil to
nil.
See Also: acos, atan, alan2,cos, cosh, sin, sink, tan, tank
Syntax:
Returns:
Usage:
Example:
asin(NUMERIC VALUE) Z2A numeric value.
The valid range of the input value is -1 to 1. If the input
value is outside the range, it may cause the system to freeze
unless it has a math coprocessor.
asin(l)
Returns: 1.570796
asin(-0.50)
Returns : -0.5235988
6-27 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 191/395
DQL LEXICON
assign
Keyword: assign
Type: Procedural Command
Purpose: The assign command is used to give a value to a temporary
or global variable. A variable is used to store a value, such as
a text string or a calculated result, that can change during the
processing of a procedure. By specifying the variable's name,
the stored value can be used like any other value in a query.
The status of a variable can be global (denoted by the
keyword global) or temporary (denoted by the keyword
temp). A temporary variable can only maintain a value during
the current procedure. A global variable can pass its valuefrom one procedure to another. To pass a value from one
procedure to another, the variable must be defined identically
in each procedure.
See Also: define, global, tem
Syntax: assign global| temp VARIABLE NAME := ASSIGNED VALUE .
Usage: The assign command is followed by:
The status of the variable (global or temporary).
The name of the variable (without quotation marks).
The assignment operator.The value assigned to the variable.
A period.
Example: define temp DISCOUNT Number
.
for INVOICES with ORDER TOTAL > 500 ;
assign temp DISCOUNT := INVOICES order total0. 15 .
modify records
ORDER TOTAL := ORDER TOTAL - temp DISCOUNT .
end
This query tells DataEase: 1) Create (define) a temporary variable called
DISCOUNT to store a number while processing the current query. 2) Find
all the INVOICES records that have a value greater than 500 in the orderTOTAL field. 3) Give (assign) the DISCOUNT variable a number value
determined by multiplying the ORDER total on each invoice by 157r.
4) Modify these INVOICES records by subtracting the value of the
DISCOUNT variable from the value in the ORDER total field.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 192/395
DATABASE REFERENCE MANUAL
atan
Keyword: atan (arctangent)
Type: Trigonometric Function
Purpose: The atan function calculates the arctangent of a numericvalue. The result is an angle expressed in radians between-nil to 7t/2.
See Also: acos, asin, atanl,cos, cosh, sin, sink, tan, tank
Syntax: atan(NUMERIC VALUE)
Returns: A numeric value.
Examples: atan(500.3)Returns : 1 .56879753
atan(-359.4)Returns : -1.5680139
6-29 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 193/395
DQL LEXICON
atan2
Keyword: atan2 (arctangent 2)
Type: Trigonometric Function
Purpose: The atan2 function calculates the arctangent of Value 1
divided by Value 2. The result is an angle expressed in
radians between -n to n.
See Also: acos, asin, atan,
cos, cosh, sin, sink, tan, ta
atan2(NUMERIC VALUE 1, NUMERIC VALUE 2)yntax:
Returns: A numeric value.
Examples: atan2(3,127)Returns : 0.02361766
atan2(1, 1)
Returns : 0.7854
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 194/395
DATABASE REFERENCE MANUAL
backup db
Keyword: backup db (backup database)
Type: Control Command
Purpose: The backup db command creates a backup copy of the
current database. When processing reaches a backup dbcommand, DataBase automatically locks the current database.
It then displays a series of prompts asking you to specify the
drive on which the backup copy should be stored and howyou want to handle any errors that occur during the backup
procedure.
Syntax:
Usage:
LAN:
backup db
Example:
When you backup a database using the backup db command,DataEase copies the database using a special format;
therefore, the backup copy can only be restored using the
DataEase restore db command or Maintenance menu option.
When you backup and restore a database, all records that have
been deleted since the last backup and restore operation are
permanently erased.
On a LAN (Local Area Network), if another user is currently
using any resource required by the backup db command,DataEase displays a
Resource Conflict message. While thismessage is displayed, DataEase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4, System Administration
for more information on resource conflicts and Multi-User
Locking Options.
record entry CUSTOMERS .
run procedure PRINT INVOICESbackup db .
This query tells DataEase: 1) Display the CUSTOMERS form so the
operator can enter new customer records. 2) When the operator finishes
entering records, run the procedure named PRINT INVOICES. 3) After
running the PRINT INVOICES procedure, make a backup copy of the
current database.
See Also: db status,
reorganize, restore db
The backup db commandfunctions like selecting
Backup Database {Option 2)
on the Maintenance menu.
For more information ondatabase backups, see
Volume I , Chapter 4,
Database Maintenance.
6-31 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 195/395
DQL LEXICON
between
Keyword: between
Type: Comparison Operator
Purpose: The between operator is used to indicate that a value falls
within a specified range. It specifies that the test value is
greater than or equal to Value 1 and less than or equal to
Value 2.
Syntax: TEST VALUE between VALUE 1 to VALUE 2
See Also: <=, <, =, >, >
not
Returns: All records for which the comparison is true.
Example: for CUSTOMERS with account balance between to499 ;
This query statement selects CUSTOMERS records that have a value
between and 499 (inclusive) in the account balance field.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 196/395
DATABASE REFERENCE MANUAL
blank
Keyword: blank
Type: Keyword
Purpose: The blank keyword is used to assign a /;//// value to a field or
variable.
Syntax:
Usage:
blank
A null value is an unspecified value, not a zero. Whenstatistics are calculated on a field, blank values are not
included in the calculation. Zero field values are included
in generating statistics.
Field or variable values can be compared to blank, and blankcan be assigned as a value to any field or variable.
Examples: for CUSTOMERS with account balance = blank ;
delete recordsend
This query tells DataBase: Delete the CUSTOMERS records that have a
blank value in the account balance field. It might be used to delete
inactive CUSTOMERS records.
6-33 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 197/395
DQL LEXICON
break
Keyword: break
Type: Procedural Command
Purpose: The break command is used to immediately stop the action of
a for or while command and continue processing the
procedure.
When processing reaches a break command, DataBase
immediately abandons the current action. It resumes
processing the procedure w ith the first action listed after the
corresponding end command.
Syntax:
See Also: exit
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 198/395
DATABASE REFERENCE MANUAL
call menu
Keyword: call menu
Type: Control Command
Purpose: The call menu command displays the specified menu.
Syntax: call menu MENU NAME
Usage:
Example:
The call menu command can be used to display either a
DataBase system menu or a user-defined menu at any point
during a Control Procedure.
When the menu is displayed, you can make selections from it
and perform the associated DataBase operations normally.
When a chain menu is called, it is automatically executed, butthe menu is not displayed.
The DataBase system menus are called by the following titles:
MAIN (Main Menu)
FORMS (Form Definition menu)
RECORDS (Record Entry menu)
QUICK REPORTS (QBE - Quick Reports menu)
DQL PROCEDURES (DQL menu)
MAINTENANCE (Maintenance menu)
UTILITIES (Utilities menu)
ADMINISTRATION (Administration menu)
When a menu function is completed and you press ESC, the
Control Procedure resumes with the action following the call
menu command.
record entry CUSTOMERS .
run procedure PRINT INVOICEScall menu MAINTENANCE .
This query tells DataBase: 1) Display the CUSTOMERS Record Entry
form so the operator can enter new records. 2) Run the PRINTINVOICES Procedure. 3) Display the Maintenance menu.
See Also: call program
hi a call menu command, the
menu name should he
enclosed in quotation marksunless it is specified as avariable. User-defined menusare called hy the name entered
in the Menu Name field whenthe menu was created.
For more information on the
use of menus, see Volume 2,
Chapter 3. Menu Definition.
6-35 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 199/395
DQL LEXICON
call program
Keyword: call program
Type: Control Command
Purpose: The call program command runs the specified DOS program.
Syntax: call program PROGRAM NAME [OPTIONAL ARGUMENT ] .
Usage: The call program command is used to call and run another
program at any point during a Control Procedure.
The called program can be any .BAT, .COM, or .EXEprogram. The command must specify the drive and directory
on which the called program is stored ifit
is not stored in thecurrent directory.
The command can include optional arguments. The commandcan be a constant (Example 1) or an expression involving
functions and variables (Example 2).
When the called program has been executed, DataEase
resumes processing the Control Procedure with the action
following the call program command.
CAUTION: Do not try to call a memory-resident program from within
DataEase. Doing so may damage your system.
NOTE: DataEase can he swapped to either E.xpanded Memoiy (EMS)or disk to free enough memory for the called program. If
enough EMS memory is available, DataEase automatically
transfers itself into e.xpanded memory.
If there is not enough memory, you can make DataEase swap
itself to disk. To do this, you must add the name of the called
program and its memory requirement (in bytes) to the
DataEase PROGCALL.DAT file. This is an ASCII text file
which you can edit with any ASCII text editor.
The following information must be entered in the
PROGCALL.DAT file for each program you intend to call
from DataEase:
PROGNAME bytes
-^ This entry continues on the next page
See Also: call menu
In a call program commandthe program name andarguments should he enin quotation marks unless
variahle is specified.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 200/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 201/395
DQL LEXICON
case
Keyword: case
Type: Procedural Command
Purpose: The case command functions like an if-then-else statement
with multiple ifs. It tells DataEase to compare an expression
to a series of values and execute a different action (or group
of actions) based on which comparison is true.
When processing reaches a case command, DataEase
compares the expression that follows case to each of the
statements specified by the keyword value.
If the first comparison is true, DataEase executes all the
actions between that value statement and the next value
statement.
If the first comparison is not true, the case expression is
compared to the next value statement. This comparing of
values continues in top-to-bottom sequence from one value
statement to the next until the case expression has been
compared to each value statement.
As soon as the actions following any single statement are
executed, processing passes to the first action following the
end command for the case structure.
If none of the specified value comparisons are true, DataEase
executes the actions specified after the keyword others. If the
others keyword is not present, DataEase executes none of the
specified actions, it continues processing the query.
See Also: break, end, exit,
nested actions, others, valu
while
The keyword value is
automatically inserted afterthe case expression in HighLevel Interactive Mode.
Syntax: case (EXPRESSION)value COMPARISON 1 ;
ACTION SERIES 1.
[value COMPARISON 2 :
ACTION SERIES 2]
[value COMPARISON N :
ACTION SERIES N][others :
OTHERS ACTION SERIES.]
end
-^ This entry continues on the next page
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 202/395
DATABASE REFERENCE MANUAL
case (cont.)
Usage: The case command requires a case expression, at least one
value statement, and an end command. Subsequent value
statements, actions, and the others keyword are optional.
If others is used, it must follow the last value statement.
The case expression must be enclosed in parentheses. It can
be a field, a variable, or any other expression except a
boolean expression (true or false). Each comparison value
can be a constant, a variable, an expression, or a range of
values.
An action can specify any valid procedure commandincluding another if, while, or case command. Each nested
command must be completed before processing passes to the
first action after the end command (see the nested actionsentry in this Lexicon).
When case commands are nested, the first end corresponds to
the last preceding case, and each case comand must be
matched with a corresponding end command. This rule
applies to all nested Procedural commands (including case,
for, if, and while).
Example: case (current user name)value FRANK :
call menu ADMINISTRATION .
value TOM :
call menu UPDATE .
value CAROL :
run procedure DAILY .
others:
record entry CUSTOMERS .
end
This query tells DataEase: If the current user is Frank, display the
Administration menu. If the current user is Tom. display the Updatemenu. If the current user is Carol, run the Daily Procedure. If the currentuser is anyone other than Frank, Tom, or Carol, display the CUSTOMERSRecord Entry
form.
6-39 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 203/395
DQL LEXICON
ceil
Keyword: ceil
Type: Math Function
Purpose: The ceil function rounds up a numeric value to the next
integer.
See Also: abs, floor, mod,random
Syntax: ceil(NUMERIC VALUE)
Returns: An integer value.
Examples: ceil(5.000)
Returns: 5
ceil(5.001)Returns; 6
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 204/395
DATABASE REFERENCE MANUAL
comments
BKeyword: -- (comments)
Type: Symbol
Purpose: The -- (comments) symbol is used to insert annotative
comments in a query. Comments have no effect during the
execution of the procedure.
See Also: The double dash(-) comments symbol at the
front of the lexicon.
Comments can only he addedto a query in Edit Mode.
Syntax: -COMMENT TEXT
Usage: Comments can only be added to a query in Edit Mode.
DataBase treats each character between the double dash
symbol and the end of the line as part of the comment.
To continue a comment on more than one line, use the doubledash symbol at the beginning of each line.
Example: for CUSTOMERS with account balance >= 500 ;
list recordsLAST name ;
ACCOUNT BALANCE .
end -- THIS QUERY LISTS THE VOLUME BUYERS.-IT SHOULD BE UPDATED ON THE TENTH DAY-OF EACH MONTH.
This query statement selects CUSTOMERS records that have a valuegreater than or equal to 500 in the ACCOUNT BALANCE field and lists thecustomers' last name and CURRENT balance values. The comment at
the end of the query has no effect on processing. DataEase ignores textthat follows the double dash comment .symbol.
NOTE: Comments are for your reference purposes only. DataEaseignores comments when processing the query.
6-41 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 205/395
DQL LEXICON
Comparison Operators
Keyword: Comparison Operators
Type: Operator
Purpose: Comparison Operators are used to compare one value to
another in record selection criteria, math formulas, and in
other text and numeric expressions.
The DQL uses seven Comparison Operators:
= Both sides of the comparsion have the same
value.
See Also: <=, <, =, >, >between, not
<=
>=
between
not
The value on the left side of the comparison is
less than the value on the right side.
The value on the left side of the comparison is
greater than the value on the right side.
The value on the left side is less than or equal
to the value on the right side.
The value on the left side is greater than or equal
to the value on the right side.
The value lies within the specified range(inclusive).
Reverses the meaning of the operator that
immediately follows it.
Examples: for CUSTOMERS with account balance > 500and STATE not = NY
;
for INVOICES with date between 01/01/89to 01/31/89 ;
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 206/395
DATABASE REFERENCE MANUAL
Conditional Statistical Operators
Keyword: Conditional Statistical Operators
Type: Operator
Purpose: Conditional Statistical Operators generate statistical
information about specific conditions that occur in a set of
records.
The DQL uses three Conditional Statistical Operators: item,
count, and percent.
item returns a YES or NO answer indicating if the
comparison is true or false.
returns the number of true responses within all
the specified records as well as specified groups.
returns the percentage of true responses
(the number of true responses divided bythe total number of records processed,
multiplied by 100). percent also worksat the group level.
Usage: in a query, the Conditional Statistical Operator is inserted
after a list item that is compared to a specified value. Theoperator is separated from the comparison by a colon.
-> This entry continues on the next page
See Also: count, item, percent
count
percent
6-43 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 207/395
DQL LEXICON
Conditional Statistical Operators (cont.)
Example: for CUSTOMERS ;
list records
LAST NAME in order ;
ACCOUNT BALANCE;
ACCOUNT BALANCE > 500 : item count percent .
end
This query tells DataEase: 1) Process all the CUSTOMERS records.
2) List each customer's LAST name and ACCOUNT balance. 3) For each
customer, display a YES or NO answer indicating if the customer's
ACCOUNT BALANCE is greater than 500. 4) Display the total number of
customers whose ACCOUNT balance is greater than $500.
5) Display the number of customers that have an ACCOUNT BALANCEgreater than 500 as a percentage of all the customers.
The output from this query arranged in alphabetical order by LAST namemight look as follows:
LAST
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 208/395
Constant Value
DATABASE REFERENCE MANUAL
Keyword: Constant Value See Also: variable
Type: Concept
Purpose: A constant value is a value that does not change while a
procedure is being processed (the opposite of a variable).
Constant values are used in selection criteria comparisons,math formulas, proper names, and other text and numericexpressions.
Usage: In a query, a constant value can be used wherever its value
type is allowed. The value types of constants are the same as
the basic field value types: text, number, numeric string, date,
time, and dollar.
The format for typing constant values is as follows:
--Enclose Text constants in double quotes ( TEXT ).-Use slashes in Date constants (01/01/89).
-Use colons in Time constants (09:30:00).
-Do not type formatting characters in numeric strings.
-Do not type commas in Number constants.
Example: for CUSTOMERS with last name = SPENCER
and ZIP > 90000 ;
In this query statement, both the last name SPENCER and the zip code90000 are constant values.
6-45 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 209/395
DQL LEXICON
Control Procedure
Keyword: Control Procedure See Also: Processing
Procedure
Type: Concept
Purpose: A Control procedure is a High Level procedure that lets you
link other procedures together with or without conditional
processing actions specified by Procedural commands.
A Control procedure can link any number of procedures
together and can invoke many operations shown on DataBase
system menus such as Record Entry, Run Procedure, Backup
Database. Install an Application, etc.
Usage: AControl procedure can include any combination of Control
commands and Procedural commands.
Although a Control procedure can link Processing procedures
together, you cannot use a Processing command in the
Control procedure itself. Note also, that a Control procedure
itself cannot enter, delete, or modify records, or create output.
For a full explanation of any of the DQL commands, see the
individual command entry in this lexicon.
Example: if current user = PAUL thencall menu UTILITIES .run procedure MAILING LIST .
else
call menu MAIN .
end
This Control procedure tells DataBase: If the current user is Paul,
1) Display the Utilities menu. 2) Run the procedure that generates an
up-to-date mailing list. 3) If the current user is not Paul, display the MainMenu.
Control Commands
run procedurecall menucall programrecord entry
importreorganize
db status
backup dbrestore dblock dbunlock dbinstall application
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 210/395
DATAEASE REFERENCE MANUAL
copy all from
Keyword: copy ail from
Type: Processing Command
Purpose: The copy all from command copies values in identically
named fields from one form to another.
The copy all from command is not listed on the High Level
Command menu because it can only be used following either
a modify records or enter a record command. When youselect either of these commands. DataEase asks if you want to
use the copy all from command to transfer data from one
form to another.
See Also: data-entry, enter arecord, modify records
Syntax: copy all from FORMNAME | data-entry
Usage: The copy all from statement must specify a Source form.
The Source form can be any form or relationship previously
specified in the query or the Data-entry form.
The Target form is specified at the end of the mandatory
modify records or enter a record command. The Target
form can be any form you specify; the default is the Primary
form. Data is copied into each Target field from the
identically named field in the Source form.
Example: Assume we've defined a ta rg et form called CATALOGCUSTOMERS. This form contains only those customers whoreceive a special Christmas promotional catalog.
for CUSTOMERS with
any INVOICES order total > 500 ;
enter a record in CATALOG CUSTOMERScopy all from CUSTOMERS .
end
This query tells DataEase: 1) Select all the CUSTOMERS records that
have any related INVOICE record with an ORDER TOTAL greater than$500. 21 For each CUSTOMERS record selected, enter a record in the
CATALOG CUSTOMERS form and copy all the information frotii thesource CUSTOMERS record into the target CATALOG CUSTOMERSrecord, based on matching field names.
When yoit use the copy all
from command, data is only
transferred between fields witthe same fieldname.Non-matching fields are
ignored.
b-Al Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 211/395
DQL LEXICON
COS
Keyword: cos (cosine)
Type: Trigonometric Function
Purpose: The cos function calculates the cosine of an angle expressed
in radians. The value returned ranges between -1 and 1.
See Also: acos, asin, atan,
cosh, sin, sink, tan, tank
cos(NUMERIC VALUE)yntax:
Returns: A numeric value.
Examples: cos(3.1415928)Returns: -1
cos(-22)Returns: .9271838
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 212/395
DATABASE REFERENCE MANUAL
cosh
Keyword: cosh (hyperbolic cosine)
Type: Trigonometric Function
Purpose: The cosh function calculates the hyperbolic cosine of an angle
expressed in radians.
See Also: acos, asin, atan,
atanZ, cos, sin, sinh, tan, tank
Syntax: cosh(NUMERIC VALUE)
Returns: A numeric value.
Examples: cosh(2.34)Returns: 5.23878166
C0Sh(-5.4)
Returns: 110.70547
6-49 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 213/395
DQL LEXICON
count
Keyword: count
Type: Conditional Statistical Operator
Purpose: The count operator counts the number of records in the form
being processed that satisfy a condition specified by a
comparison of two values. The result usually appears as a
statistic in the summary area at the end of a report.
See Also: count of, item,
percent
Syntax:
Usage:
CONDITION : count [other statistical operators]
To count all the records processed by a query, use a statement
that is true for every record, such as A = A . This method
is shown in Example 2.
Example 1: for CUSTOMERS ;
list recordsLAST NAME in order
;
ACCOUNT BALANCE ;
ACCOUNT BALANCE > 500 : COunt .
end
This query tells DataBase: 1) Lis t the CUSTOMERS records showing
each customer's last name and account balance. 2) Count the
number of customers who have an ACCOUNT BALANCE greater than $500.
The output from this query might look as follows:
To count all the records
processed hy a query, use
sraiement that is true for ev
record, such as A = A .
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 214/395
DATAEASE REFERENCE MANUAL
count of
Keyword: count of
Type:
Purpose:
Syntax:
Relational Statistical Operator
The count of operator counts how many records in a related
form match the specified selection criteria. The result can
appear as a list item in the detail area of a report or as a
statistic in the summary area at the end of a report.
count of FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)]
;
Example: for CUSTOMERS ;
list recordsLAST NAME # in Order ;
ACCOUNT BALANCE ;
ACCOUNT BALANCE > 500 : item count;
count of INVOICES with (Order total >end
100)
This query tells DataBase: 1) Process all the CUSTOMERS records.
2) List each customer's last name, and account balance. 3) For each
customer, display a YES or NO answer indicating if the customer's
ACCOUNT BALANCE is greater than 500. 4) Count the total number of
customers whose ACCOUNT BALANCE is greater than $500 and display this
total as a statistic at the end of the report output (this is generated by the
count operator). 5) Count the number of related INVOICES records that
have an ORDER TOTAL greater than $100, and display this number as a list
item for each customer (this is generated by the count of operator). Theoutput from this query might look as follows:
See Also: all, any, count,
highest of, lowest of, mean
ofsum
ofnamed
There's an important
difference between the
conditional statistical
operator count and the
relational statistical operator
count of. count finds the
number of records that satisfy
a specified condition amongthe records being processed.
count of calculates the
number of matching records
related to the records being
processed by the query.
LAST
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 215/395
DQL LEXICON
current
Keyword: current
Type: Keyword
Purpose: The current keyword lets you access any of the eight
system-determined variables defined below:
• current date returns the date recorded by the system clock
(a date value).
• current time returns the time recorded by the system clock
(a time value).
• current page number returns the current page number for
multi-page report output (a numeric value).
• current item number returns the number of the current record by
automatically counting records as they are processed by the query (a
numeric value).
• current user name returns the name used to sign onto the database
(a text value).
• current user level returns the current user's security level (a numeric
value from 1 to 7).
• current computername returns the name of the workstation
processing the procedure when operating DataBase on a Local Area
Network (a text value).
• current status returns a numeric value depending on which key the
user presses when entering data using the DQL input command.
This value can then be used to control subsequent processing (see
input for an example).
The value stored in the current status variable is shown below:
See Also: data-entry, global,
input, temp
Key Pressed
ESCF2F8F7
Action
EXITSAVEMODIFYDELETE
Value Returned
1
2
3
4
This entry continues on the next page
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 216/395
DATABASE REFERENCE MANUAL
current (cont.)
Syntax:
Example:
current variable name Hfor CUSTOMERS with ACCOUNT BALANCE >
list recordsLAST NAME in order
;
ACCOUNT BALANCE;
current date ;
current page numbercurrent user name .
end
500
This query tells DataBase: 1) Select the CUSTOMERS records that havean ACCOUNT BALANCE value greater than 500. 2) List the LAST NAMEand ACCOUNT balance values from each record that is processed. 3) Listthe current date (today's date), the current page number, and the
current user name (the name of the user who generated the report).
The output from this query might looks as follows:
PAGE: 1 USER: GEORGE McGRAfH DATE:l)l720/89===================================================== The double boundary lines at
=================================================___ the top of this output are part
LAST NAME ACCOUNT BALANCE '^f^ custom report format;
Adams $595.00 generated by DataBase.
Cooper $725^00Evans $865.00Hill $525.00'vers $675.00
6-53 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 217/395
DQL LEXICON
data-entry
Keyword: data-entry
Type: Keyword
Purpose: The data-entry keyword identifies the Data-entry form as the
source of the specified value.
See Also: input, recordentry
Syntax:
Usage:
data-entry FIELDNAME
Example:
Data-entry values are used in a query exactly like any other
value or expression. The keyword data-entry is used as the
form name to specify a value entered in a Data-entry form.
The keyword can only be used if a Data-entry form has
already been defined for the procedure.
In Interactive Mode, if a Data-Entry form has been defined,
DataBase offers a menu of all the fields defined on the form
for use in the query.
for CUSTOMERS with customer # = data-entryCUSTOMER #
;
modify recordscopy all from data-entryaddress := data-entry new address .
end
This query might be used to post address changes into the CUSTOMERSform. It tells DataBase: 1) Find the CUSTOMERS record that has the
same customer # as the customer # specified on the Data-Entry form.
2) Modify the CUSTOMERS record by copying the value from the
NEW address field in the Data-entry form to the address field in the
CUSTOMERS form. After each record is modified, the Data-entry formis redisplayed so the operator can enter the next change of address.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 218/395
DATABASE REFERENCE MANUAL
date
Keyword: date
Type: Date Function
Purpose: The date function constructs a date value from three separate
numeric values.
Sec Also: current, day, Julian,
month, spelldate, spellmonth,
spellweekday, year, yearday,yearweek
Syntax: date(MONTH, DAY, YEAR)
where MONTH is the number of the month (1-12), DAY is
the day of month (1-31), and YEAR is the last two digits of
year.
Returns: A date value in the format specified on the System
Configuration form. For example, if you specify the North
American date format on the System Configuration form, the
date value is returned in the order MMfDDfYY.
Usage: If any input value is invalid (e.g., month > 12 or day > 31),
DataBase calculates a future date, for example, 6,45,89
becomes 07/15/89. Decimal values are automatically
truncated.
Examplel: date(7,1,89)Returns : 07/01/89
Example 2: FIRSTDAY := date(month(TODAY), 1,LASTDAY := date((month(TODAY)+1)year(TODAY)) - 1 .
year(TODAY))1,
This portion of a query uses a variable named TODAY (which holds the
current date) and two other date functions, month and year, to find the
first and last days of the current month.
The result, if the current date is July 4th, 1989. is: FIRSTDAY =
07/01/89; LASTDAY = 07/31/89. This routine is accurate for any date.
NOTE: If your system is configured for the International
date format, the date value is returned in the order
DD/MM/YY. If your system is configured for the
Metric date format . the date value is returned in the orderYYIMMIDD. Regardless of how your system is configured,
the three numerical values this function requires are alwaysinput in the order MONTH. DAY. YEAR.
6-55 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 219/395
DQL LEXICON
day
Keyword: day
Type: DateFunction
Purpose: The day function extracts the day of the month (1- 31) from a
date value.
See Also: current, date,
Julian, month, spelldate,spellmonth, spellweekday,
year, yearday, yearweek
Syntax: day(DATE VALUE)
Returns: An integer value between 1 and 31. The date format selected
in System Administration changes the date sequence but does
not effect which value is returned by a Date function.
Examples: day( 12/31/89)Returns: 31 (North American format)
day(31/12/89)Returns: 31 (European format)
day(89/12/31)Returns: 31 (Metric format)
NOTE: In Form Definition, you can use the derivation formuladay lookup current date) to stamp each record with the
date of the month. For more information, sec Volume 2.
Chapter 2. Form Definition.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 220/395
DATAEASE REFERENCE MANUAL
db status
Keyword: db status (database status)
Type: Control Command
Purpose: The db status command generates a report that displays the
status of the current database.
When processing reaches a db status command, DataBaseautomatically locks the current database. It then displays a
prompt asking you to specify which of the following items
you want to include in the report: forms, procedures, or
imports.
Depending on your reply, the status report includes one or
more of the following:
• The number of system and user defined forms in the database.
• The name of each form.
• The DOS filename and filesize of each form.
• The number of existing records in each form.
• The number of deleted records in each form.
• The name of each procedure.
•The DOS filename and filesize of each procedure.
• The name of each import specification in the selected directory.
• The DOS filename and filesize of each import specification.
See Also: backup db, restore
db
The db status commandfunctions like selecting
Database Status (Option J I onthe Database Maintenancemenu. For more information,
see Vohmie 1 , Chapter 4.
Database Maintenance.
-> This entry continues on the next page
6-57 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 221/395
DQL LEXICON
db status (cont.)
Syntax:
Usage:
db status .
To print the db status information, press the SH-F9 PRINTkey.
LAN:
Example:
On a LAN (Local Area Network), if another user is currently
using any resource required by the db status command.DataBase displays a Resource Conflict message. While this
message is displayed. DataEase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this lime, you must reboot the computer.
When the required resource becomes available. DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2. Chapter 4. System Administrarion.
for more information on resource conflicts and Multi-User
Locking Options.
record entry CUSTOMERS .
run report PRINT INVOICES .
db status .
This query tells DataEase: 1) Display the CUSTOMERS form so the
operator can enter new customer records. 2) When the operator finishes
entering records, run the previously defined report named PRINTINVOICES. 3) After running the PRINT INVOICES report, display the
requested status information for the current database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 222/395
define
DATABASE REFERENCE MANUAL
Keyword: define See Also: assign, global, temp
Type:
Purpose:
Syntax:
Procedural Command
The define command is used to create a global or temporary
variable. A variable is used to store a value such as a text
string or a calculated result that can change during the
processing of a procedure. By specifying the variable's name,
the stored value can be used like any other value in a query.
The status of a variable can be global (denoted by the
keyword global) or temporary (denoted by the keyword
temp). A temporary variable can only maintain a value
during the current procedure. A global variable can pass its
value from one procedure to another. To pass a value fromone procedure to another, a variable must be defined
identically in each procedure.
define global|
temp VARIABLE NAME TYPE [LENGTH] .
Usage: The define command is followed by:
—The status of the variable (global or temporary).
—The name of the variable (enclosed in quotation marks).
-The type of the variable (any field type except Choice.
Dollar, or Yes/No).
-The length of the variable (optional, see below).
—Aperiod. The define command requires a concluding
pjeriod not a semicolon.
The length specifies the number of characters for Text and
Numeric String variables. The default length is 25; you can
specify any length up to 255 characters. Number variables
are always 14 digits long. Date and Time variables are 8
characters long. The default length is used if you do not
specify a length in the define command.
NOTE: You can define a variable as any field type except Choice.Dollar, or YesINo fields.
— This entry continues on the next page
6-59 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 223/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 224/395
DATABASE REFERENCE MANUAL
delete records
Keyword: delete records
Type: Processing Command
Purpose: The delete records command deletes records in the specified
form.
See Also: lisl records, modifyrecords
Syntax:
Usage:
delete records in FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)]
When you delete records in the Primary form, the keyword in
is omitted and no punctuation is used after the delete records
command (see Example 1).
Example1: for
CUSTOMERSwith (highest of INVOICES datedelete records
end
01/01/80)
This query deletes records in the Primary form (CUSTOMERS) whosemost recent invoice (in the related INVOICES form) is dated prior to
January 1st, 1980.
When you delete records in a form other than the Primary form, the
keyword in precedes the form name, and the command ends with a
semicolon (or a period if it is the last in a s er ie s of actions —see Example 2).
Example 2: for CUSTOMERS;
delete records in INVOICES named OUTDATEDwith (CUSTOMER # = CUSTOMERS CUSTOMER #and INVOICES date < 01/01/80) .
end
This query deletes records in the related (INVOICES) form that are datedprior to January 1st, 1980. The named operator is used to assign a uniquerelationship name to the group of outdated records in the related form.
Note that when you use the named operator to create an ad-hocrelationship, you forfeit any predefined relationship. Because of this,
you must again tell DataEase how the CUSTOMERS and INVOICESforms are related. By including the phrase (customer # = CUSTOMERSCUSTOMER #) in the ad-hoc criteria, you are telling DataEase that the
INVOICES records you want to delete must have the same customer #
as the CUSTOMERS record that is currently being processed anJ a datebefore January 1st, 1980.
The delete records comnumddoes not permanenetly delete
records until the specified
form is reorganized. Until the
form is reorganized, deleted
records can he retrieved hypressing CTRL-FJ to accessthem hy record niimher. andthen re-activating them iisinq
F8 MODIFY. Deleted records
cannot he retrieved once the
form is reorganized. If
records cne frequently addedand deleted, reorganizing the
form will increase efficiency.
6-61 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 225/395
DQL LEXICON
do
Keyword: do
Type: Keyword
Purpose: The do keyword is a component of the while commandsyntax.
When processing reaches a while command, DataEase
evaluates the condition that follows the keyword while.
If the specified condition is true. DataEase executes all the
actions that follow the keyword do until it reaches the
corresponding end command. DataEase then reevalutes the
original condition. If the condition is still true. DataEase
executes the do action series again. If the condition h false.
processing passes to the first action following the end
command for the while statement.
See Also: while
The keyword do is
automatically inserted after
the specified while condition
in High Level Interactive
Mode.
Syntax: while CONDITION do
ACTION 1
ACTION 2 ,
ACTION Nend
Example: define temp serial Number
.
assign temp serial := .
while temp serial < 1000 dotemp serial := temp serial + 1
list recordsjointextC'SYSTEM DISK , temp serial) .
end
This query tells DataEase: 1) Create (define) a temporary variable called
SERIAL. 2) Give (assign) an initial value of to the SERIAL variable.
3) Print a series of labels joining the words SYSTEM DISK to the number
that is the current value of the SERIAL variable. 4) While printing thelabels, increment the variable by one each time a new label is printed.
5) When the value of the variable exceeds 999, stop printing labels.
The while command tells DataEase to reevaluate the value of the variable
each time it prints a label. As long as that value is less than 1000,
DataEase prints another label. When the value of the variable exceeds
999, DataEase stops performing the action following the do keyword.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 226/395
DATAEASE REFERENCE MANUAL
else
Keyword: else
Type: Procedural Command
Purpose: The else keyword is a component of the if command syntax.
The if command executes one of two different actions (or
series of actions) based on whether the specified condition is
true or false. When processing reaches an if command,DataBase evaluates the condition that follows the keyword if
If the specified condition is true. DataBase executes all the
actions which follow the keyword then until processing
reaches the corresponding end or else command. If the
specified condition \s false. DataBase executes all the actions
that follow the keyword else until processing reaches thecorresponding end command. If there is no else. DataBase
jumps directly to the statement following the end command.
See Also: if Command
Syntax: if CONDITION then
[ACTION 1
ACTION 2
[else
ACTION N]
ACTION 1
ACTION 2
ACTION N.
end
Example: for CUSTOMERS ;
if highest of INVOICES date < 01/01/80 thendelete records .
else
delete records in INVOICES with (date < 01/01/80)end
end
This query tells DataBase: 1) For each CUSTOMBRS record, find the
most recently dated record in the related INVOICBS form. 2) If the mostrecent invoice is dated before January 1st. 1980, delete the CUSTOMERSrecord. 3) If a customer's most recent invoice is dated on or after January1st. 1980, delete all of that customer's INVOICBS records dated prior to
1980. Note that the first end marks the end of the if cotnmand that selects
which records to delete. The second end marks the end of the forcommand that selects the records from the Primary form.
6-63 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 227/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 228/395
DATABASE REFERENCE MANUAL
end (cont.)
Example 2: for CUSTOMERS ;
if highest of INVOICES date < 01/01/80 thendelete records
elsedelete records in INVOICES with (date < 01/01/80) ;
end
if highest of INVOICES date > = 01/01/89 thenlist recordsLAST NAME in Orderhighest of INVOICES date .
endend
This query tells DataBase: 1) For each CUSTOMERS record, find the
most recently dated record in the related INVOICES form. 2) If the mostrecent invoice is dated before January 1st. 1980, delete the CUSTOMERSrecord. 3) If a customer's most recent invoice is dated on or after January
1st, 1980. delete all of that customer's INVOICES records dated prior to
1980. 4) For all customers with invoices dated on or after January 1st
1989, list the customers in order by LAST NAME and show the date of each
customer's most recent invoice.
Notice that for each if command in the query, there is a corresponding
end command. The first end marks the end of the if command that
selects which records to delete. The second end marks the end of the
if command that selects which records to include in the report output.
The third end marks the end of the for command that .selects the records
from the Primary form.
NOTE: Although DataBase does not require an end commandin Low Level queries, most High Level queries do. Since
most users eventually convert Low Level queries into HighLevel, we recommend that you make a habit of using an endcommand at the end of a query to ensure that the synta.x
requirements for High Level are satisfied.
6-65 Volum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 229/395
DQL LEXICON
enter a record
Keyword: enter a record
Type: Processing Command
Purpose: The enter a record command adds a record to the specified
form.
See Also: copy all from,data-entry, input, record
Syntax:
Usage:
enter a record in FORMNAME
The enter a record command must specify a target form and
the field values to be input in to the form. Alternatively, you
can specify another form to copy field data from using the
copy all from command (see Example 2, below). As data is
entered in the form, automatic error checking is performed,
including checks for uniqueness, required fields, range checks,
etc. Any errors are logged to an exception file.
Example 1: for CUSTOMERS with account balance > 500 ;
enter a record in CATALOG CUSTOMERSNAME 1 := CUSTOMERS FIRST NAME ;
NAME 2 ;= CUSTOMERS last name;HOME ADDRESS := CUSTOMERS address
;
HOME CITY ;= CUSTOMERS city ;
HOME STATE := CUSTOMERS STATE ;
ZIP code := CUSTOMERS zip .
end
This query tells DataBase: 1) Select all the CUSTOMERS records that
have an ACCOUNT balance greater than $500. 2) For each
CUSTOMERS record selected, enter a record in the CATALOGCUSTOMERS form, by copying the information from each field in the
CUSTOMERS form to the assigned field in the CATALOGCUSTOMERS form.
Example 1 simply copies information from the CUSTOMERS form into
the target form. If you rename the fields so both forms are identical, the
same result can be accomplished with the simpler query shown in
Example 2.
Example 2: for CUSTOMERS with account balance > 500 ;
enter a record in CATALOG CUSTOMERScopy all from CUSTOMERS .
end
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 230/395
DATABASE REFERENCE MANUAL
exit
Keyword: exit
Type: Procedural Command
Purpose: The exit command is used to immediately terminate a query.
Syntax:
See Also: break, end
exit
Usage:
Example:
The exit command can be used anywhere in a query. When it
is executed, the query immediately stops processing and
returns control to the calling menu or procedure.
for CUSTOMERSlist recordsACCOUNT BALANCE in reverse ;
LAST NAME .
if current item number > 5 thenexit
endend
This query tells DataBase: List the five customers with the highest
ACCOUNT BALANCE values. When the fifth record is processed, terminate
the query. Note that two end commands are required to fulfill the DQLsyntax requirements even though the exit command terminates processing.
The output from this query, arranged in descending order on the ACCOUNT
BALANCE field, might look as follows:
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 231/395
DQL LEXICON
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 232/395
DATAEASE REFERENCE MANUAL
firstc
Keyword:
Type:
Purpose:
Syntax:
Returns:
Usage:
Examples:
firstc
Text Function
The firstc function extracts a specified number of characters
(n) from the beginning (left) of a text value.
See Also firstlast,firstw,
jointext, lastc, lastfirst, lastw,
length, lower, midc, midw,proper, lextpos, upper
firstc(TEXT VALUE, n)
A text string n characters in length.
Leading blanks are included in the count of characters (n).
firstcC'DataEase International, Inc. , 8)
Returns; DataEase
firstcC'New User , 4)
Returns: New
firStC(LAST NAME, 4)
Returns: The first four characters in the last namefield for every record that is processed. If a recordcontains the value Holmes in the last name field,
the function returns Holm.
6-69 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 233/395
DQL LEXICON
firstlast
Keyword: firstlast
Type: Text Function
Purpose: The firstlast function converts a text value from the format:
Last Name. First Name [M.] to the format: First Name [MJLast Name. The [M.] is an optional middle initial (or name).
Syntax: firstlast(TEXT VALUE)
Returns: A text value.
Usage: This function is used when names are stored in a single field.
The contents of the field are rearranged so the first word (i.e.,
the last name) becomes the last word in the returned string. If
the name is followed by a comma, the comma is deleted.
Examples: firstlast( Anthony, Susan B. )
Returns: Susan B. Anthony
firstlastC'Eliot, T.S. )
Returns: T.S. Eliot
firstlast(FULL name)Returns: The value in the full name field in the formatshown above for every record that is processed. If arecord contains the value Holmes, Sherlock in the
last name field, the function returns Sherlock Holmes.
See Also, firstcflrstw,
jointext, lastc, lastfirst, lastw
length, lower, midc, midw,proper, textpos, upper
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 234/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 235/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 236/395
DATABASE REFERENCE MANUAL
for
Keyword: for
Type: Processing Command
Purpose: The for command specifies the form from which records are
selected for processing and the criteria used to select them.
Usage: The for command is always the first word in a Low Level
query.
A Low Level query can have only one for command whichspecifies the query's Primary form (see Example 1).
A High Level query can have multiple for commands to
select records from different forms (see Example 2).
In a High Level query, for commands can be nested to alte
the sequence of program actions (see Example 3).
When used to specify a query's Primary form, the for
command requires a concluding semicolon. Otherwise, the
for command does nor require a semicolon.
The for command is always terminated by an end command.All the actions specified between a for command and its
corresponding end command are executed once for eachrecord selected hy the for command.
See Also: end, with
Syntax: for FORMNAME| RELATIONSHIP [named UNIQUE
RELATIONSHIP NAME ] [with (selection criteria)] [;] JNote: The for command is the most frequently used word in the
DataBase Quety Language. Most Processing proceduresbegin with this command.
-^ This entry continues on the next page
//; Low Level Interactive
Mode, the for command is
automatically inserted at the
start of the queiy. To start aHigh Level query with anyother command, press Home(to move the cursor to the start
position). F9 (High Level),
and Fl to return to InteractiveMode.
6-73 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 237/395
DQL LEXICON
for (cont.)
Example 1 : Low Level QueryUsing for Command to Access the Primary Form
for CUSTOMERS with account balance > 500 ;
list recordsLAST NAME in order ;
ACCOUNT BALANCE .
end
This query tells DataBase: 1) Select the CUSTOMERS records that have a
value greater than $500 in the ACCOUNT BALANCE field. 2) For each
selected record, list the customer's LAST name and ACCOUNT balance.
The output from this query, arranged in alphabetical order by LAST NAME.might look like this:
LAST NAME ACCOUNT BALANCE
Adams
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 238/395
DATABASE REFERENCE MANUAL
for (cont.)
Th,e.quer>' for Example 2 tells DataBase: 1) Select the CUSTOMERSrecords that have a value greater than S500 in the account balancefield. 2) For each selected record, list the customer's last name.
3) Select all the INVOICES records. 4) For each INVOICES record,list the invoice # and the order total.
Since its impossible to properly align information that is processed andprinted in sequence from two different forms, this query produces outputthat is very difficult to read as shown below.
LAST NAME INVOICE #
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 239/395
DQL LEXICON
for (cont.)
Example 3:
High Level QueryWith Nested for Commands
for CUSTOMERS with account balance > 500 ;
for INVOICESlist recordsCUSTOMERS LAST NAME in groups ;
invoice # in order;
ORDER TOTAL .
endend
In this query, thesecond
forcommand,
which is nested within the first,
selects all the related records in the INVOICES form and performs all the
actions between the second for and its end for each related record.
This query tells DataBase: 1) Select the CUSTOMERS records that have
a value greater than S500 in the ACCOUNT balance field. 2) Find all the
related INVOICES records for each CUSTOMERS record selected in
Step 1. 3) For each selected CUSTOMERS record, list the customer's
LAST NAME . 4) For each selected INVOICES record, list the INVOICE #
and the ORDER TOTAL.
The output from this query, arranged in alphabetical order by LAST NAME,might look as follows:
LAST NAME
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 240/395
DATABASE REFERENCE MANUAL
Functions
Keyword: Functions
Type: Concept
Purpose: The 58 DataBase functions execute calculations, manipulate
text, and perform other time-saving data-entry operations.
There are nine groups of functions listed to the right side ofthis page and briefly summarized below.
• The if function returns one of two values based on its evaluation of a
specified condition as true or false.
• Date functions convert a date into a number representing the day,
month, year, day of the week, or day of the year on which the
specified date falls.
• Spell functions convert a date or numerical value into its equivalent
text value.
• Time functions extract the hour, minutes, or seconds from a 24-hourformat time value or assign the appropriate AMor PM suffix.
• Text functions are used to concatenate, truncate, or manipulate a text
value.
• Financial functions calculate either the beginning value, end value,
interest rate, installment amount, or number of payment periods for a
financial transaction, given the values of the other four variables.
• ScientiHc functions raise a base value to a power, derive natural andbase 10 logs, or derive the square root of a value.
• Trigonometric functions convert a numeric value into a value
expressed in radians.
• Math functions perform common mathematical rounding operations
or return the absolute value of a specified numeric value. Therandom function generates a pseudo random number.
For a full explanation of any of the DQL functions, see the entry listed
under the function's name in this Lexicon.
6-77
List of DQL Functions
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 241/395
DQL LEXICON
futurevalue
Keyword: futurevalue
Type: Financial Function
Purpose: The futurevalue function calculates the final value of a
financial transaction given the presentvalue, installment
payment, interest rate, and number of payment periods.
Syntax:
Returns:
Usage:
futurevalue(presentvalue. installment, rate, periods)
A numeric value (the final value after all payments are made).
If the installment payment increases the value of the
investment (e.g., an annuity), the installment must beexpressed as a positive amount. If the payment decreases
the value of the investment (e.g., loan amortization), the
installment must be expressed as a negative amount.
The interest rate, installment payments, and time periods must
be based on the same terms. For example, if payments are
made monthly on a five-year loan, the number of periods is
(12 * 5) or 60. The interest rate must be expressed in the
same terms (the monthly interest rate is the annual rate
divided by 12). The interest rate must also be expressed as a
whole number (10<7f is 10, not 0.10).
Examplel: futurevalue(lOOOO, 100, 10 / 12. 120)Returns: $47,554.91
This example calculates the futurevalue (accumulated balance) of a
monthly savings plan, if you start with S 10,000 and add $100 every monthfor 12 years at an annual interest rate of \09c.
Example 2: futurevalue(lOOOO, 1200, 10, 12)
Returns: $57,045.42
This example calculates the futurevalue (accumulated balance) of an
annual savings plan, if you start with SI 0.000 and add S12(X) every year
for 12 years at an annual interest rate of lO'^. Both examples assume that
installments are always paid at the start of each period.
NOTE: DataBase financial functions are derived from the formulashown below. (The double asterisks (meaning raise to the
power ) cannot be used in a query).
futurevalue = principal * ((] + (rate/JOO)) ** periods) +(installmentl(ratellOO)) * (({I + (rate/JOO)) ** periods) - I)
See Also: installment, rate,
periods, presentvalue
When typing fractions like
10 1 12, DataBase requires
that you type a space befor
and after the I division
symbol.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 242/395
DATABASE REFERENCE MANUAL
global
Keyword: global
Type: Keyword
Purpose: The keyword global specifies a global variable.
A variable is used to store a value such as a text string or a
calculated result that can change during the processing of a
procedure. By specifying the variable's name, the stored
value can be used like any other value in a query.
The status of a variable can be global (denoted by the
keyword global) or temporary (denoted by the keywordtemp).
A temporary variable can only hold a value during the
current procedure.
A global variable can pass its value from one procedure to
another. To pass a value from one procedure to another, a
variable must be defined identically in each procedure.
Syntax: I global variable name
Usage:
See Also: assign, define, temp,variable
When processing a Control procedure that links two or moreProcessing procedures, each global variable with the samename and type is considered the same variable and can pass
its value from one procedure to another. If a Control
procedure requires data retrieved from a relationship, the data
can be obtained in a Processing procedure and stored in a
global variable.
Example: define global income Numberdefine global expenses Numberdefine global profit Number
run procedure MONTHLY TOTALS .
if global INCOME > global expenses then
run procedure PAYROLL BONUS .
else
run procedure REGULAR PAYROLL .
end
—> This entry continues on the next page
6-79 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 243/395
DQL LEXICON
global (cont.)
This query is a Control procedure that tells DataBase: 1) Create (define)
three global variables called INCOME. EXPENSES, and PROFIT to store
three different numbers while processing the query. 2) Run the
MONTHLY TOTALS procedure. This procedure (shown below)
calculates the total income and expenses for the month and subtracts the
latter from the former to determine the amount of profit. As each of these
totals is calculated, it is assigned to the appropriately named global
variable. 3) If the INCOME variable is greater than the EXPENSESvariable, run the PAYROLL BONUS procedure using the value stored in
the PROFIT variable to calculate each employee's bonus (a percentage of
the profit based on the employee's salary level). 4) If the INCOMEvariable is not greater than the EXPENSES variable, run the REGULARPAYROLL procedure.
The MONTHLY TOTALS Processing procedure looks like this:
Example: define global income Number
.
define global expenses Number
.
define global profit Number
.
assign global income := sum of INVOICES orderTOTAL with (DATE between 09/01/89 to 09/30/89) .
assign global expenses := sum of PURCHASE orderTOTAL with (DATE between 09/01/89 to 09/30/89) .
assign global profit := global income- global expenses .
end
The key feature of this example is the fac t tha t the global variables are
identically defined in the Processing procedure which calculates the value
of each variable and in the Control procedure which passes these values
from one Processing procedure to another.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 244/395
DATAEASE REFERENCE MANUAL
Grouping
Keyword: Grouping
Type: Concept
Purpose: Grouping lets you process records with the same field value
together.
Usage: There are two DQL operators that control grouping:
in groups and in groups with group-totals.
The in groups operator causes records with identical field values to be
processed as a single group and the groups are automatically sorted in
ascending order. For example. Democratic Presidents are listed together
as a group followed by the Republican Presidents.
Example 1: for PRESIDENTS :
list recordsPOLITICAL PARTY in groups ;
LAST NAME in order ;
FIRST NAME .
end
The output is grouped on the political party field (shown in bold):
POLITICAL PARTY LAST NAME FIRST NAME
See Also: in groups, in groupswith group totals, Sorting
DEMOCRATIC
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 245/395
DQL LEXICON
Grouping (cont.)
The in groups with group-totals operator groups records and generates
statistical totals for each group if any other statistic is requested by the
query. For example, if we add a new line to the query in Example 1;
Example 2: for PRESIDENTS ;
list recordsPOLITICAL PARTY in groups with group-totals
;
LAST NAME in order;
FIRST NAME;
A = A : count
.
end
In this example, the line:
A = A : count .
tells DataBase to count every record that is processed. The count statistic
allows DataBase to also calculate the group total for each political party.
The output includes the group level statistics (shown in bold):
POLITICAL PARTY LAST NAME FIRST NAME
Grouping operators (in
groups and in groups with
group-totals) always precedeSortint; operators (in orderand in reverse) in the query.
DEMOCRATIC
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 246/395
DATAEASE REFERENCE MANUAL
highest of
Keyword: highest of
Type:
Purpose:
Relational Statistical Operator
The highest of operator finds the highest value in a specified
field in all matching records in a related form. The result canappear as a list item in the detail area of a report or as a
statistic in the summary area at the end of each group or the
end of the report.
Syntax:
Returns:
highest of FORMNAME|
RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)] FIELDNAME
A value of the same type as the specified field. If a
Text field is specified, DataBase returns the highest ASCIIvalue. If a Choice field is specified, DataBase returns the
value in the highest numbered choice (not necessarily the
highest ASCII value).
Example: for CUSTOMERS;
list recordsLAST NAME in Order ;
highest of INVOICES order total .
end
This query tells DataBase: 1) Process all the CUSTOMBRS records andlist
each customer's last name in alphabetical order. 2) For eachCUSTOMBRS record selected, find all the related records in the
INVOICES form (those that have a matching customer #). 3) List thehighest ORDER TOTAL in the set of matching INVOICES records.
The output from this query, arranged in alphabetical order by LAST name.might look as follows:
LAST NAME HIGHEST OF INVOICES ORDER TOTAL
AdamsCooperEvansHill
Ivers
$195.00$225.00$105.00$125.00$ 75.00
If you also want to include the highest order total among this group ofinvoices, change the fourth line of the query to read:
highest of INVOICES order total : item max .
See Also: all, any, count of,
lowest of, mean of, sum ofnamed
There's an importantdifference between the
statistical operator max andthe relational statistical
operator highest of.
max finds the highest value in
the specified field among all
the records being processed.highest of finds the highestvalue among the recordsrelated to the records beingprocessed.
6-83 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 247/395
DQL LEXICON
hours
Keyword: hours
Type: Time Function
Purpose: The hours function extracts the hour from a time value
expressed in a 24-hour format.
See Also: ampm, current,
minutes, seconds, timeampm
Syntax: hours(TIME VALUE)
Returns: An integer value from 00 to 23.
Examples: hours(1 2:00:00) (midday)Returns: 12
hours(23:59:00) (one minute before midnight)Returns: 23
NOTE: The parenthesized text above (e.g.. midday) is to clarifiy
the time of day only: it is not one of the function'
parameters.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 248/395
DATAEASE REFERENCE MANUAL
if Command
Keyword: if Command
Type: Procedural Command
Purpose: The if command executes one of two different actions (or
series of actions) based on whether the specified condition is
true or false.
When processing reaches an if command. DataEase evaluates
the condition that follows the keyword if.
If the specified condition is true. DataEase executes all the
actions which follow the keyword then until processing
reaches the corresponding end or else command.
If the specified condition \% false. DataEase executes all the
actions that follow the keyword else until processing reaches
the corresponding end command.
See Also: if Function
Syntax:
The keyword then is
automatically inserted after
the specified if condition in
High Level Interactive Mode.
if CONDITION then
(ACTION 1
ACTION 2
ACTION N.l
[else
ACTION 1
ACTION 2
ACTION N.
end
Example 1 : for CUSTOMERS ;
if highest of INVOICES date < 01/01/80 thendelete records .
else
delete records in INVOICES with (date < 01/01/80)end
end
—> This entry continues on the next page
6-85 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 249/395
DQL LEXICON
if Command (cont.)
This query tells DataBase: 1) For each CUSTOMERS record, find the
most recently dated record in the related INVOICES form. 2) If the most
recentinvoice is
dated beforeJanuary 1st, 1980, delete the
CUSTOMERSrecord. 3) If a customer's most recent invoice is dated on or after January
1st, 1980, delete all of that customer's INVOICES records dated prior to
1980.
The first end marks the end of the if command that selects the records to
delete. The second end marks the end of the for command that selects the
records from the Primary form.
Usage: A query may contain multiple if commands nested (indented)
within one another (see Example 2). These additional if
commands can appear after either then or else; however, a
nested if command is only processed if the previous conditionis true.
When if commands are nested, the first end corresponds to
the last preceding if and each if command must be matched
with a corresponding end command. This rule applies to all
nested Procedural commands (including case, for. if, and
while). See nested actions and the for command entry for
more information on nesting one command inside another.
Example 2: for INVOICES ;
if INVOICES ORDER TOTAL > 500 thenmodify records in CUSTOMERSSTATUS := PREFERRED .
if DATE between 01/01/89 to current date thenenter a record in CATALOG CUSTOMERScopy all from CUSTOMERS .
endend
end
This query tells DataEase to divide the INVOICES records into two
groups and process them as follows: 1) The records with an ORDERTOTAL greater than $500 are modified by changing the value in the
STATUS field to PREFERRED. 2) The records with an ORDER totalgreater than 500 and a date between the start of 1989 and today's date
are modified and also copied into the CATALOG CUSTOMERS form.
In this example, the second if command, which selects a subgroup of the
records selected by the fi rs t i f command, is nested within the first if
command.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 250/395
DATABASE REFERENCE MANUAL
if Function
Keyword: if Function
Type: Conditional Function
Purpose: The if function returns one of two specified values based on
whether the specified condition is true or false. A query mayhave multiple if functions nested within one another.
See Also: break, case, for,
else, end, exit, if Command,nested actions, while, then
Syntax: if(CONDITION, TRUE VALUE, FALSE VALUE)
Returns: The true value if the specified condition is true. JYit false
value if the specified condition is false.
Usage: Generally, you can specify any type of value you want for the
true value and false value parameters. In certain cases.
however. DataBase requires that these values must be the
same type as the value returned by the specified condition.
For example:
if(ampm(current time) = AMafternoon )
in the morning , in the
is acceptable because both the value used in the condition
( AM or PM ) and the final value returned ( in the
morning or in the afternoon ') are text expressions.
Conversely,
if(12 < hours(current time), in the morning , in theafternoon )
might be prohibited because the value used in the condition is
a numeric value and the final value we want DataBase to
return is a text value.
If you have trouble saving a query that contains an if
function, try changing the type of the true and false values.
—> This entry continues on the next page
6-87 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 251/395
DQL LEXICON
if Function (cont.)
Example: for CUSTOMERS ;
list recordsLAST NAME in order ;
ACCOUNT BALANCE ;
if(ACCOUNT BALANCE > 500, YES , NO ) .
end
This query tells DataBase: For each record in the CUSTOMERS form, list
the LAST NAME and the account balance. If the value in the ACCOUNTBALANCE field is greater than $500, display the value YES in the report
output. If the value in the ACCOUNT BALANCE field is not greater than
$500, display the value NO. The output from this query, arranged in
alphabetical order by LAST NAME, might look as follows:
LAST
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 252/395
DATABASE REFERENCE MANUAL
importi
Keyword: import
Type: Control Command
Purpose: The import command imports a data file into the current
database. It can be used to import data at any point during a
Conffol procedure. After executing the import, the data can be
used in the same Control procedure.
import IMPORT SPECIFICATION FILENAMEyntax:
Usage: The import command can only be used to execute a
previously defined Import Specification. The filename that
follows the import command is the filename of the Import
Specification. This name must be eight or fewer characterswith no intervening spaces. See Volume 2. Chapter 5,
Database Utilities for information on how an Import
Specification is defined.
LAN: On a LAN (Local Area Network), if another user is currently
using any resource required by the import command.DataEase displays a Resource Conflict message. While this
message is displayed. DataEase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4, System Administration.
for more information on resource conflicts and Multi-User
Locking Options.
Example: import MAILLIST .
run procedure PRINT LETTERS
This query tells DataEase: 1) Execute the MAILLIST Import Specification.
2) When the impon is completed, run the PRINT LETTERS procedure.
See Also: install application
The import commandfiinctions like selecting RunDefined Import (Option 2) onthe Data Import menu. For acomplete e.xplanation of the
Import procedure . see Volume2. Chapter 5. DatabaseUtilities.
6-89 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 253/395
DQL LEXICON
in
Keyword: in
Type: Keyword
Purpose: The in operator tells DataBase to use a form other than the
query's Primary form when executing a list records, delete
records, modify records, or enter a record command.
See Also: delete records,
enter a record, list records,
modify records
Syntax: in FORMNAME|
RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection critena)]
Usage: When the in operator is used without selection criteria,
DataBase performs the action on all related records in the
specified form. If you do not specify a FORMNAME,DataBase automatically performs the action on the Primary
form. The in operator should not be used in conjunction with
the query's Primary form (see Example 3).
Example 1: for CUSTOMERS ;
modify records in INVOICESORDER TOTAL ;= ORDER TOTAL
endDISCOUNT
This query discounts every related INVOICES record each time a
CUSTOMERS record is processed. Since every invoice is related to
only one customer, each record is discounted only once.
Example 2: for INVOICES ;
modify records in INVOICESORDER TOTAL := ORDER TOTAL - DISCOUNT .
end
This example demonstrates an INCORRECT use of the in operator.
This query discounts every INVOICES record each time a record is
processed (each invoice is discounted as many times as there are
records to process).
Example 3: for INVOICES ;
modify recordsORDER TOTAL :=
endORDER TOTAL - DISCOUNT
This query CORRECTLY modifies records in the Primary form.
The in keyword is omitted from a list records, modify records, or
delete records command when the action is performed on the Primaryform.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 254/395
in groups
DATABASE REFERENCE MANUAL
Keyword: in groups
Type: Grouping Operator
Purpose: The in groups operator tells DataBase to process all the
records with the same value in the specified field together
and display the report output in a grouped format (e.g.. all the
customers from Connecticut, then all those from New Jersey,
then all those from New York. etc.). The group identifier is
displayed once at the beginning of the group. If statistics are
specified for any output fields, group subtotals are calculated
but the subtotals are not included in default report output
unless you use the operator in groups with group-totals.
Syntax:
Usage:
FIELDNAME in groups HI
Example:
In a query, an item to be processed in groups should be listed
hefore all other output items including items to be sorted in
order. When a field is sorted in groups, the groups are
automatically sorted in order (all Alabama customers are
listed before any Alaska customers).
Grouping operators cannot be used in conjunction with the all
relational operator (i.e.. if INVOICES is the Primary form,
you cannot use the query statement: all CUSTOMERS state
in groups).
for CUSTOMERS;
list recordsSTATE in groups
;
LAST name in order .
end
This query tells DataEase: 1) Process all the CUSTOMERS records withthe same value in the state field together as a group. 2) Display thegroup identifier (STATE) once at the beginning of each group. 3) Withineach group, arrange the customers in alphabetical order by last name.The output from this query might look as follows:
STATE
NJ
NY
LAST NAME
AdamsHill
CooperEvansI vers
See Also: in groups with
group-totals, in order, in
reverse
The in groups operator can
only he used on list items/(•)//( ni//(t,' the list recordscommand. It cannot he used\\iih the enter a record,
modify records, or delete
records commands.
6-91 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 255/395
DQL LEXICON
in groups with group-totals
Keyword: in groups with group-totals
Type: Grouping Operator
Purpose: The in groups with group-totals operator groups records and
generates statistical totals for each group if any other statistic
is requested by the query.
Syntax:
Usage:
FIELDNAME in groups with group-totals
Example:
The group identifier is only displayed once at the beginning
of the group. If statistics are specified for any output fields,
group subtotals are calculated and the subtotals are
automatically included in the default report output.
Grouping operators cannot be used in conjunction with the all
relational operator ( i.e. , i f INVOICES is the Primary form,
you cannot use the query statement: all CUSTOMERS STATE
in groups with group-totals).
for CUSTOMERS ;
list recordsSTATE in groups with group-totals
;
LAST NAME in order;
ACCOUNT BALANCE : item sum .
end
This query tells DataBase: 1) Process all the CUSTOMERS records with
the same value in the STATE field together as a group. 2) Display the
group identifier (STATE) once at the beginning of each group. 3) Within
each group, arrange the customers in alphabetical order by LAST NAME.4) List each customer's ACCOUNT balance, the subtotal for each STATEgroup, and the sum of all the account balance amounts combined.
The output from this query might look as follows:
STATE LAST NAME ACCOUNT BALANCE
NJ
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 256/395
DATABASE REFERENCE MANUAL
in order
Keyword: in order
Type: Sorting Operator
Purpose:
Syntax:
The in order operator tells DataEase to process records and
display the report output in sequence from lowest to highest
value in the specified field, (e.g. 0101 1. before 01012, before
01013. etc.).
FIELDNAME in order
Usage: The in order operator can be used on any type of field.
A Time. Date, or Number field is ordered from lowest to
highest value. A Choice field is sorted by Choice number.A Text tleld is sorted in alphabetical order.
Sorting operators cannot be used in conjunction with the all
relational operator (e.g.. if INVOICES is the Primary form,
you cannot use the statement:
all CUSTOMERS LAST NAME in order ;
Example: for INVOICES ;
list recordsSTATE in groups
;
ZIP in order ;
LAST NAME in order .
end
This query tells DataEase: 1) Process all the CUSTOMERS records with
the same value in the ST.ATE field together as a group. 2) Display the
group identifier state once at the beginning of each group. 3) Withineach group, arrange the customers in lowest to highest zip code order.
4) Within each zip code, arrange the customers in alphabetical order bylast name.
The output from this query might look as follows
STATE ZIP CODE LAST NAME
NJ
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 257/395
DQL LEXICON
in reverse
Keyword: in reverse
Type: Sorting Operator
Purpose: The in reverse operator tells DataBase to process records and
display the report output in reverse sequence from highest to
lowest value in the specified field, (e.g., 01013 before 01012,
before 01011, etc.).
Syntax: FIELDNAME in reverse
Usage: The in reverse operator can be used on any type of field.
A Time, Date, or Number field is ordered from highest tolowest value. A Choice field is ordered from highest to
lowest Choice number. A Text field is sorted in reverse
alphabetical order.
Sorting operators cannot be used in conjunction with the all
relational operator (e.g., if INVOICES is the Primary form,
you cannot use the statement:
all CUSTOMERS LAST NAME in reverse ;
Example: for CUSTOMERS ;
list recordsSTATE in groups :
ZIP in reverse;
LAST NAME in order .
end
This query tells DataEase: 1) Process all the CUSTOMERS records with
the same value in the STATE field together as a group. 2) Display the
group identifier state once at the beginning of each group. 3) Within
each group, arrange the customers in highest to lowest ZIP code order.
4) Within each zip code, arrange the customers in alphabetical order by
LAST NAME.. The output from this query might look as follows:
STATE
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 258/395
DATAEASE REFERENCE MANUAL
input
Keyword: input
Type: Processing Command
Purpose:
Usage:
The input command provides all the facilities of record entry
but allows DQL to process records before they are entered
into the database. It can be used at any point in a procedure.
Syntax: input using FORMNAME into TEMPFORM
In the input command syntax, FORMNAME is the name of
the database form. TEMPFORM is the name DataEase uses
to reference an input record. You can assign any name you
want for this purpose except the name of another form in the
same database. Thefirsr time that the TEMPFORM name is
specified in the query, it must be enclosed in quotation marks.
There is no limit to the number of input commands you can
use in a query; however, each database form must be
assigned a unique TEMPFORM in the input statement.
The input command tells DataEase to display a specified
record entry form. When the specified form is displayed, you
can either enter or modify a record (in Form View), or scroll
through the form (in Form or Table View) and select any
existing record. You can also use the FIO MULTI key to
view records in related forms.
When you press a processing key (ESC, F2 SAVE,F7 DELETE, or F8 MODIFY), the input record is copied into
memory and a number that corresponds to the processing key
is stored in the current status variable. DataEase then
resumes processing the procedure, using the input record data
just like values entered in a data-entry form. The current
status value can be used to control subsequent processing.
The input command can only hold one record in memoryunder a given TEMPFORM name at a time. If you want to
process more than one record using the input command, set
up a loop using the the current status variable. To enter aninput record into the database, you must use the enter a
record command in the query (see Example 2).
Since input can only hold one record in memory, the form
must be displayed in Form View when a processing key is
pressed. Table View is used for selection purposes only.
—> This entry continues on the next page
See Also: data-entry, record
entry, current status
In Interactive Mode. DataEaseautomatically inserts the wordusing after input and the wordinto after the name of the
record entry form.
Current Status Values
Key Pressed
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 259/395
DQL LEXICON
input (cont.)
Example 1: input using CUSTOMERS into TEMPCUST .
for INVOICES
with (CUSTOMER* = TEMPCUST customer #) ;
list recordsINVOICE # :
ORDER TOTAL ;
DATE .
end
This quer>' tells DataEase: 1) Display the CUSTOMERS form. 2) Whenthe user selects a specific CUSTOMERS record and presses F2. store that
record in memory (using the name TEMPCUST to reference it). 3) Find
all the INVOICES records with the same CUSTOMER # as the CUSTOMER #
in the TEMPCUST record. 4) For each related invoice, list the invoice #
and the ORDER TOTAL. The output from this query might look as follows:
INVOICE* ORDER TOTAL DATE
A1 17095
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 260/395
DATAEASE REFERENCE MANUAL
input (cont.)
If current status = 3. (the user pressed F8 MODIFY when the inputrecord was on the screen), modify the record in the CUSTOMERS formwith a CUSTOMER* (a Unique field) that is the same as the CUSTOMER* on
the input record. If current status = 4. (the user pressed F7 DELETEwhen the input record was on the screen), delete the record in the
CUSTOMERS form with a CUSTOMERS (a Unique field) that is the sameas the CUSTOMER* on the input record. 3) Display the CUSTOMERSform again so the operator can enter, modify, or delete another record.
Example 3: while current status not = 1 doinput using CUSTOMERS into TEMPCUST .
case (current status)
value 1 : break .
value 2 : if TEMPCUST customer code <= 20 thenenter a record in CUSTOMERScopy all from TEMPCUST .
else message Invalid Code, Re-enter the record. .
endothers : message You are not authorized to modify
or delete records. window .
endend
This query tells DataEase: 1) Display the CUSTOMERS form. 2) Eachtime the user enters a record and presses a processing key, check the valueof the current status variable. If current status = 1 (ESC), stop queryprocessing without entering a record in the CUSTOMERS form. If
current status = 2 (F2 SAVE), verify that a valid customer code(<=
20)was entered in the
input record.If it
is valid, copy the inputrecord into the CUSTOMERS form. If it is not valid, display an error
message. If current status = 3 or 4 (F8 MODIFY or F7 DELETE),display a message telling the user that he/she is only authorized to enter
records. 3) Display the CUSTOMERS form again so the u.ser can enter
another record.
Using the input Command with MultiformsWhen using the input command on a Multifomi. DataEase treats Mainforms and Subforms differently. If you enter, modify, or delete a Mainform record, the information is copied into the specified temporary fomiwhere it can be validated and processed by the query.
If you enter or modify a Subform record, however, the new or modifiedrecord is entered directly into the Subform in the database. This is
because DataEase is unable to hold all of the entered or modified Subformrecords in memory (up to 5000 Subfomi records can be entered or
modified at once) and still continue processing the query.
-^ This entry continues on the next page
When van press a process ini;
key (ESC. F2. F7. or FS). the
input record is copied into
memory and tlie appropriate
value is stored in the currentstatus variable. The currentstatus value can then he usedto control subsequentprocessing.
When you use the input
command to enter, modify, or
delete records in a Multiform,DataEase treats Main formand Subform records
differently. If you enter,
modify, or delete a Main formrecord, it is copied into the
specified temporary form. If
you enter or modify Subformrecords, however, the new or
modified records are entered
directly into the Subform.
6-97 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 261/395
DQL LEXICON
input (cont.)
If the user presses F2 SAVE to enter a Multiform record, you can use
enter a record to enter the record into the Main form (the Subform
records were automatically entered when the user pressed F2). If thequery tests the Main form for validity (e.g., CUSTOMER CODE <= 20 in
Example 3) and it fails, you must use delete records to remove the
Subform records that were entered when you pressed F2 SAVE.
If the user presses F8 MODIFY to modify a Multiform record, you can
use modify records to modify the Main form record, (the Subformrecords are automatically modified when the user pressed F8). If the
query tests the Main form for validity (e.g., CUSTOMER CODE <= 20 in
Example 3) and it fails, it is up to the user to remember which Subformrecords were modified and then go back to the Subform and undo the
modifications. DataBase cannot automatically undo modified Subformrecords.
If you delete a Multiform record using the input command, the records
are not directly deleted from the form. You must use the query to verify
that a valid record was entered and then use delete records to explicitly
delete the appropriate Main and Subform records.
Example 4: while current status not = 1 doinput using INVOICES into TEMPINVOICE .
case (current status)
value 1 : break .
value 2 : if TEMPINVOICE customer code <= 20 thenenter a record in INVOICES
copy all from TEMPINVOICES .
else message Invalid Code, Re-enter the record.
.
delete records in INVOICE LINE ITEMS with(INVOICE NUMBER = TEMPINVOICE INVOICE NUMBER)end
others : message You are not authorized to modify or
or delete records. If you have modified records,
you must manually delete the modifications. windowendend
This query tells DataBase: 1) Display the INVOICES form. 2) Each timethe user enters a record and presses a processing key,
checkthe value of
the current status variable. If current status = 1 (ESC), stop queryprocessing without entering a record in the INVOICES form. If currentstatus = 2 (F2 SAVE), verify that a valid customer code was entered in
the input record. If it is valid, copy the input record into the INVOICESform. If it is not valid, display an error message and delete the records
that were automatically entered in the Subform (INVOICE LINE ITEMS).If current status = 3 or 4 (F8 MODIFY or F7 DELETE), display a
message telling the user that he/she is only authorized to enter records.
3) Display the INVOICES form again so the user can enter another record.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 262/395
DATAEASE REFERENCE MANUAL
install appi
Keyword: install appI (install application)
Type: Control Command
Purpose: The install appI command lets you install or replace forms or
procedures in the current database or install a new DataEase
application in the current database. When processing reaches
an install appI command. DataEase asks you to specify the
name of the Installation File.
Syntax: install appI INSTALLATION FILENAME
See Also: import, reorganize
The filename that follows the install appI command is the
filename of the Installation Command file. This name must
be eight or fewer characters with no intervening spaces. SeeVolume 2. Chapter 3. Database Utilities for more information
on how applications are installed.
LAN: On a LAN (Local Area Network), if another user is currently
using any resource required by the install appI command,
DataEase displays a Resource Conflict message. While this
message is displayed. DataEase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available. DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4. System Administration,
for more information on resource conflicts and Multi-User
Locking options.
Example: install appI A: CATALOG .
run procedure MAILLIST .
This query tells DataEase: 1) Install the CATALOG application from the
disk in drive A: into the current database. 2) When the new application is
installed, run the MAILLIST procedure.
The install appl commandfunctions like selecting;
Install DataEase Application
on the Install/Convert
Application menu. For a
complete explanation of the
Installation procedure, see
Volutne 2. Chapter 5.
Database Utilities.
6-99 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 263/395
DQL LEXICON
installment
Keyword: installment
Type: Financial Function
See Also: futurevalue,
periods, presentvalue, rate
Purpose:
Syntax:
The installment function calculates the periodic installment
payment required for a financial transaction given the
presentvalue, futurevalue, interest rate, and number of
payment periods.
installmenl(presentvalue, futurevalue, rate, periods)
Returns: A numeric value (the installment payment amount).
Usage:If the installment payment increases the value of the
investment (e.g., an annuity), the numeric value returned by
the function is expressed as a positive amount. If the payment
decreases the value of the investment (e.g., loan amortization),
the numeric value returned by the function is expressed as a
negative amount. The interest rate, installment payments, and
time periods must be based on the same terms. For example,
if payments are made monthly on a five-year loan, the
number of periods is ( 12 * 5) or 60. The interest rate must be
expressed in the same terms (the monthly interest rate is the
annual rate /1 2).
Examples: installment(15000, 0, 10 / 12, 60 )
Returns: -318.71
This example calculates the monthly installment payment required to payoff a $15,000 loan in 5 years at an annual interest rate of 10%.
installment(0, 15000, 10 / 12, 60)Returns: 193.71
This example calculates the monthly installment amount required to
accumulate $15,000 in 5 years at an annual interest rate of 10%.
When typing fractions like
10 1 12. DataBase requires
that you type a space before
and after the division symbol
NOTE: DataBase financial functions are derived from the formulashown below. (The double asterisks (meaning raise to the
power ) cannot be used in a query).
futurevalue = principal * ((I + (rate/100))) ** periods) +(installmentl(ratellOO)) * (((I + (rate/100)) ** periods) - 1)
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 264/395
DATAEASE REFERENCE MANUAL
item (Statistical Operator)
Keyword: item
Type: Statistical Operator
Purpose: The item statistical operator tells DataBase to display the
specified field value from each processed record in addition to
any specified statistics. The result appears as a list item in the
detail area of a report.
Syntax: fieldname : item [other statistical operators]
Usage:
Example:
In a Quick Report, each specified field value is automatically
included in the report output. In a DQL Procedure, if noother statistics are specified for a field, the field value is
automatically included in the report output. If statistics arespecified on a field, the field value is only included if the
field name is followed by the item operator.
for CUSTOMERS;
list recordsLAST NAME in order ;
ACCOUNT BALANCE : item min max sum .
end
This query tells DataBase: 1) Process all the CUSTOMERS records in
alphabetical order by last name. 2) List each customer's ACCOUNTBALANCE (item). 3) List the smallest
account balance (min). 4) Listthe largest account balance (max). 5) List the total of all the .accountbalance amounts combined (sum).
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
Adams $595.00Cooper $725.00Evans $865.00Hill $525.00Ivers $675.00
MINIMUM ACCOUNT BAlANci ^$52~5 oOMAXIMUM ACCOUNT BALANCE $865 00SUM ACCOUNT BALANCE $3 385 00
See Also: max, min, mean,std.dev., std.err., sum,
variance, ami also the itemcoihlitional slatistical
opeialor.
There is an important
difference between the itemstatistical operator and the
item conditional statisticaloperator. The itemstatistical operator tells
DataBase to include the list
item in the report outputwhen other statistics arespecified. The itemconditional statistical
operator tells DataBase to
evaluate a cotnparison andreturn a YBS or NO answerindicating if the comparisonis true or not.
6-101 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 265/395
DQL LEXICON
item (Conditional Statistical Operator)
Keyword: item
Type: Conditional Statistical Operator
Purpose: The item conditional statistical operator returns a yes or no
answer indicating if the specified comparison is true or false.
Syntax:
Usage:
Example:
COMPARISON STATEMENT : item
In a query, the item operator is placed after a list item that is
compared to a specified value. The item operator is separated
from the comparison by a colon.
for
CUSTOMERS;
list recordsLAST NAME in order
;
ACCOUNT BALANCE : item min max sum ;
ACCOUNT BALANCE > 500 : item .
end
This query tells DataBase: 1) Process all the CUSTOMERS records in
alphabetical order by LAST NAME. 2) List each customer's ACCOUNTBALANCE (item). 3) List the smallest ACCOUNT balance (min). 4) List
the largest ACCOUNT BALANCE (max). 5) List the total of all the ACCOUNTBALANCE amounts combined (sum). 6) For each customer specify a yes
or no answer indicating if the customer's ACCOUNT BALANCE is
greater than $500 (item conditional statistical operator).
The output from this query might look as follows:
LASTNAME
ACCOUNTBALANCE
ACCOUNT BALANCEOVER 500
Adams
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 266/395
DATABASE REFERENCE MANUAL
jointext
Keyword: jointext
Type: Text Function
Purpose: The jointext function combines two separate text values into
one.
See Also: firslcfirstlast,
firstw, lastc, lastfirst, lastw,
length, lower, midc, midw,proper, textpos, upper
Syntax:
Returns:
Usage:
jointext(TEXT VALUE1, TEXT VALUE2)
A text value up to 255 characters in length.
When two text values are joined, leading spaces are
maintained but trailing spaces are deleted. To join three or
more fields, you can use additional jointext functions as
either or both parameters.
Examples: jointext( Data , Ease )
Returns: DataBase
jointext(jointext( Data , Ease ), International )
Returns; DataBase International
In the above example, there is a space at the s tart of
the string International.
jointext{PRODUCT, 16M )Returns: DataBase 16M
In the above example, there is a space at the start of the string I6M. ThePRODUCT field holds the value DatuEase.
6-103 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 267/395
DQL LEXICON
Julian
Keyword: julian
Type: Date Function
Purpose: The julian function converts a date value to a Julian date.
Syntax: julian(DATE VALUE)
Returns: A five-digit integer in the format YYDDD.
Usage: YY are the last two digits of the year. DDD is the position of
the day in the year (with January 1st = 001; and December 31
= 365, except in leap year when it is 366).
Examples: julian(07/04/89)Returns: 89185
julian( 12/31/89)Returns: 89365
See Also: current, day, date,
month, spelldate, spellmonth,
spellweekday, year, yearday,yearweek
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 268/395
DATAEASE REFERENCE MANUAL
Keywords
Keyword: Keywords
Type: Concept
Purpose: Keywords are used to signal special operations such as
creating variables, performing conditional actions, or
retrieving values from a Data-entry form.
Usage: In interactive Mode, certain keywords are automatically
inserted in the query where required.
There are thirteen DQL keywords as specified below:
• blank returns a null (unspecified value).
•current tells DataBase that you want to access one of the eightcurrent system variables (date, time, page number, item number, username, user level, computer name, or status).
• data-entry tells DataBase to use the value found in the specified field
on the Data-entry form.
• do tells DataBase what actions to perform when the conditionspecified by a while command is true.
• else tells DataBase what actions to perform when the conditionspecified by an if command \s false.
• global identifies a global variable.
• in tells DataBase to enter, delete, list, or modify records in a formother than the Primary form.
• into is used with the input command to specify the name of atemporary destination form.
• others tells DataBase what actions to perform when all the precedingvalue statements in a case command dre false.
• temp identifies a temporary variable.
• then tells DataBase what actions to perform when the conditionspecified by an if command is Hue.
• using is used with the input command to specify the name of thedatabase source form.
• value is used with the case command to specify each of the
comparison values to which the ca.se expression is compared.
For a full explanation of any of the DQL keywords, see the separate entryin this Lexicon.
See Also: blank, current,data-entry, do, else, global, in,
into, others, temp, then,
using, value
6-105 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 269/395
DQL LEXICON
lastc
Keyword:
Type:
Purpose:
Syntax:
Returns:
Usage:
Examples:
lastc
Text Function
The lastc function extracts a specified number of characters
from the end (riahtl of a text value.
See Also: firstcfirstlast,
firstw,jointext, lastfirst,lastM\ length, lower, midc,
midM.', proper, textpos,
upper
lastc(TEXT VALUE, n)
A text value n characters in length.
lastci FIELDNAME. 1 ) returns the last non-hlank character in
the field. Trailing spaces are ignored. If there are n or fewer
characters in the field, lastc returns the original text value.
lastcC'DataEase , 4)
Returns: Ease
lastcC'New User , 4)
Returns: User
laStC(FIRST NAME. 4)
Returns: The last four characters in the first namefield for every record that is processed. If the firstNAME field contains the value Sherlock, the function
returns lock.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 270/395
DATABASE REFERENCE MANLAL
lastfjrstI
Keyword: lastfirst
Type: Text Function
Purpose:
Syntax:
The lastfirst function converts a text value from the format:
First Name [MJ Last Name to the format: Last Name, First
Name [M.J. The [M.J is an optional middle initial.
See Also: firslcfirsllasl,
firstwjoinlext, lastc, laslw,
length, lower, midc, midw,proper, textpos, upper
lastfirst(TEXT VALUE)
Returns: A text value.
Usage:
The contents of the field are rearranged so that the last word
(i.e.. the last name) becomes the first word in the returned
value. A comma is automatically inserted after the last name.
The name of this function and the firstlast function refer to
the format in which the names are stored in a sinale field.
Examples: lastfirst(Susan B. Anthony)Returns: Anthony, Susan B.
lastfirst(T.S. Eliot)
Returns: Eliot, T.S.
lastfirst(FULL name)Returns: The value in the full name field in the format
shown above for every record that is processed. If arecord contains the value Sherlock Holmes in the fullNAiviE field, the function returns Holmes, Sherlock.
6-107 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 271/395
DQL LEXICON
lastw
Keyword: lastw
Type: Text Function
Purpose: The lastw function extracts a specified number of words from
the end (right) of a text value.
See Also: firstcfirstlast,
firstwjointext, lastc, lastfirst,
length, lower, midc, midw,proper, textpos, upper
Syntax: lastw(TEXT VALUE, n)
Returns: A text value n words in length.
Usage: lastw(FIELDNAME, n) returns the last n words in the field
including intervening spaces and punctuation symbols.
Trailing spaces are ignored. If there are n or fewer words inthe field, lastw returns the original text value.
Examples: lastw( DataEase International, Inc. , 2)
Returns: International, Inc.
lastw( New User , 1)
Returns: User
laStW(BOOK TITLE, 2)
Returns the last two words in the book title field for
every record that is processed. If a record containsthe value The Hound of the Baskervilles in the bookTITLE field, the function returns the Baskervilles.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 272/395
DATABASE REFERENCE MANUAL
length
Keyword: length
_ ^ ^ . See Also: firstcfirstlast.Type: Text Function firstwjointext, lastc, lastfirst,
lastw, lower, midc, midw,Purpose: The length function counts the number of character positions proper, textpos, upper
in a text value.
Syntax: length(TEXT VALUE)
Returns: An integer value.
Usage: The length function counts leading and intervening spaces.
Trailing spaces are ignored.
Examples: length( DataEase International, Inc. )
Returns: 28
length( New User )
Returns: 8
length(coMPANY name)Returns: The number of characters in the companyNAME field for every record that is processed. If theCOMPANY NAME field Contains the value DataBaseInternational, Inc., the function returns 28.
^-'^^ Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 273/395
DQL LEXICON
list records
Keyword: list records
Type: Processing Command
Purpose: The list records command tells DataBase which items to
display in the report output for each record processed by the
query. These items are called lisr items.
Syntax: list records in FORMNAME RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with(selection criteria)]
See Also: delete records, ente
a record, modify records,
output
Usage: Each list item must be followed by a semicolon except the
last, which is followed by a period. Values specified in a list
records command can be sorted, grouped,or
summarizedwith report statistics by inserting the appropriate operator after
the list item.
Example: for CUSTOMERS :
list recordsSTATE in groups with group totals ;
LAST NAME in order ;
ACCOUNT BALANCE : item min max sum .
end
This query tells DataEase: 1) Process all the CUSTOMERS records with
the same value in the st.ate field together as a group. 2) Display thegroup identifier (STATE) once at the beginning of each group. 3) Within
each group, arrange the customers in alphabetical order by LAST NAME.4) List each customer's account balance (item). 5) List subtotals of
each specified statistic for each STATE group (in groups with
group-totals). 6) List the smallest ACCOUNT balance (min). 7) List the
largest ACCOUNT BALANCE (max). 8) List the sum of all the ACCOUNTbalance amounts combined (sum). The output might look like this:
The list records command is
the only output option
available in a Low Level
query.
In Low Level Interactive
Mode, the list records
command is automatically
inserted in the queiy when yindicate you have no moreselection criteria.
STATE
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 274/395
DATAEASE REFERENCE MANUAL
lock
Keyword: lock
Type: Processing Command
Purpose: The lock command is only functional when using DataBase
on a LAN (local area network). The lock command prevents
users from viewing, modifying, adding, or deleting data in
forms and records being used by a report/procedure.
The lock command overrides the default Multi-User Locking
Rules assigned by the database administrator. In order to
override the default locking rules, the first statement of the
query must be either lock all files or unlock all files. If
neither of these commands appears at the start of the query,
the default locking rules govern LAN functioning until a lockor unlock command appears in the query.
All lock and unlock commands are automatically terminated
at the end of a query.
Syntax:
Usage:
lock all files|
filename|
selected record [shared|exclusive]
The lock all files command locks all forms referenced by the
query. Users can view records in the locked forms but cannot
add. delete or modify data in these forms.
The lock file command locks the specified form for the
duration of the procedure or until the same form is specified
in an unlock command. When an individual form or record is
locked, you must also specify the type of lock (shared or
exclusive). Shared lets other users view records in the locked
form but prohibits them from entering, modifying, or deleting
records in that form. Exclusive prevents all access to the
locked form, including viewing records.
The lock selected record command functions like lock file
except it only locks the record that is currently being
processed. When DataBase finishes processing a record, it is
automatically unlocked. Use this command only within a for
command loop (see Example 2). If you use it outside a for
loop, no records are selected: therefore nothing is locked.
-> This entry continues on the next page
See Also: lock db, queryselection, unlock, unlock db
6-111 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 275/395
DQL LEXICON
lock (cont.)
Example: lock file INVOICES shared .
for CUSTOMERS with (sum of INVOICES order
TOTAL > 500)list recordsLAST NAME;ACCOUNT BALANCE .
end
This query tells DataBase: 1) Lock the INVOICES form so other users can
view records but cannot add, delete or modify INVOICES records during
the processing of this report. 2) Select all the CUSTOMERS records
whose related INVOICES records have a combined ORDER TOTAL greater
than $500. 3) For each record selected, list the customer's LAST NAMEand ACCOUNT balance.
Notice that locking the INVOICES form during the processing of this
report prevents other users from entering new records that might alter the
sum of calculation field.
Example 2: for CUSTOMERS;
lock selected record shared .
list recordsLAST NAME
;
ACCOUNT BALANCE ;
mean of INVOICES order total .
end
This query tells DataBase: 1) Select all the CUSTOMERS records.
2) Lock each record as it is selected so other users can view it but cannot
add, delete or modify the record while it is being processed. 3) For eachrecord selected, list the customer's last name, account balance, andthe mean ORDER total of all the related INVOICES records.
In this example, all the CUSTOMERS records can be modified except the
record that is currently being processed.
For more information on DataBase LAN configuration and the Multi-UserLocking Rules, see Volume 2, Chapter 4, System Administrarion.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 276/395
DATABASE REFERENCE MANUAL
lock db
Keyword: lock db (lock database)
Type: Control Command
Purpose:
Syntax:
Usage:
The lock db command is only functional when using
DataBase on a LAN (local area network). This commandcompletely prohibits other users from accessing the current
database.
lock db
The lock db command can be used to preserve the integrity of
data during an extended Control procedure or to prevent a
conflict when installing a new or revised application into the
database.
The lock db Control command differs from the lock Processing
command in several ways:
1 It locks the whole database rather than specified forms or
individual records.
2. There is no shared option for the lock db command: no
other user can view records or access any form in the
database for any purpose.
3. The lock db command is nor automatically terminated
at the end of the procedure. Once a database is locked by
the lock db command, it remains locked until an unlock db
command is executed, or the user who initiated the lock db
command exits from DataBase.
See Also: lock, queryselection, unlock, unlock db
There is an important
difference between the lock
Processinii command and the
lock db Control command.The lock Processing
command can lock individual
forms or records during a
Processing procedure and still
let other users view these
resources. The lock dbcommand locks the whole
database and prohibits other
users any accesss to it.
This entry continues on the next page
6-113 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 277/395
DQL LEXICON
lock db (cont.)
LAN: On a LAN (local area network), if another user is currently
using any resource required by the lock db command,
DataBase displays a Resource Conflict message. While this
message is displayed, DataEase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4, System Administration,
for more information on resource conflicts and Multi-User
Locking Options.
Example: lock db .
run procedure CALCULATE DISCOUNTrun procedure PRINT INVOICES .
unlock db .
This query tells DataEase: 1) Lock the current database. 2) Run the
CALCULATE DISCOUNT procedure. 3) Run the PRINT INVOICESprocedure. 4) Unlock the database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 278/395
DATABASE REFERENCE MANUAL
log
Keyword: log
See Also: exp, log 10, power,
Type: Scientific Function sqrt
Purpose: The log function computes the natural base e logarithm of a
numeric value.
Syntax: log(NUMERIC VALUE)
Returns: A numeric value.
Examples: log(3)
Returns: 1.098612
log(0.5)
Returns: -0.693147
6-115 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 279/395
DQL LEXICON
Iog10
Keyword: loglO
Type: Scientific Function
Purpose: The loglO function computes the common base 10 logarithm
of a numeric value.
See Also: exp, log, power,
Syntax: ioqioinumeric value)
Returns: A numeric value.
Examples: Iog10(3)Returns: 0.477121
Iogl0(0.5)Returns; -0.301031
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 280/395
DATABASE REFERENCE MANUAL
lower
Keyword: lower
Type: Text Function
Purpose: The lower function converts each letter in a specified text
value into lowercase type.
Syntax: lower(TEXT VALUE)
Returns: The specified text value with ail the letters in lower case.
Examples: lower( DataEase )Returns: dataease
lower( Washington D.C. )
Returns: Washington d.c.
IOWer(LAST NAME)Returns the value in the last name field in lowercasetype for every record that is processed. If a recordcontains the value HOLMES in the last name field,
the function returns holmes.
See Also: firstc,firstlast,
flrstwjointext, lastc, lastfirst,
lastw, length, midc, midw,proper, textpos, upper
6-117 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 281/395
DQL LEXICON
lowest of
Keyword: lowest of
Type:
Purpose:
Relational Statistical Operator
The lowest of operator finds the smallest value in the
specified field in all matching records in a related form.
The result can appear as a list item in the detail area of a
report or as a statistic at the end of each group or at the
end of the report.
Syntax:
Returns:
lowest of FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME'T [with (selection criteria)] FIELDNAME
Example:
Avalue of the
sametype as the specified field. If a
Textfield is specified, DataEase returns the lowest ASCII value.
If a Choice field is specified. DataEase returns the value in
the lowest numbered choice (not necessarily the lowest ASCII
value).
for CUSTOMERS ;
list recordsLAST NAME in order
;
lowest of INVOICES order total .
end
This query tells DataEase: 1) Process all the CUSTOMERS records andlist each customer's LAST name in alphabetical order. 2) For each
CUSTOMERS record selected, f ind the related records in the INVOICESform (those that have the same CUSTOMER #). 3) List the lowest ORDERtotal for each customer in the set of matching INVOICES records.
The output from this query arranged in alphabetical order by last name,might look as follows:
LAST NAME LOWEST OF INVOICES ORDER TOTAL
Adams
CooperEvansHill
Ivors
$15.65
$22.40$18.10$12.50$17.25
If you also want to include the smallest ORDER TOTAL among this group of
invoices, change the fourth line of the query to read:
lowest of INVOICES order total : item min .
See Also: all, any, count of
highest of, min, mean of, sof, named
There'san
important
difference het^'een the
statistical operator min anthe relational statistical
operator lowest of.
min returns the lowest value
in the specified field amongthe records being processed.
lowest of returns the lowest
value in the specified field
among the records related
the records being processed.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 282/395
DATABASE REFERENCE MANUAL
max
Keyword: max
Type: Statistical Operator
Purpose: The max operator finds the highest value in a specified field
among all the records that are processed. The result appears
in the statistical summary areas of the report.
Syntax: VALUE : max [other statistical operators]
Returns: A value of the same type as the specified value. If the
specified value is a Text field, max returns the highest
ASCII value.
Usage: max finds the highest value in the specified fieldamong
the
records being processed, highest of finds the highest value in
the specified field among the records related to the records
being processed.
Example: for CUSTOMERS with account balance > 500;
list recordsLAST NAME in Order ;
account balance : item max sum .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than 500 in the account balance field. 2) List the
customers by LAST name in alphabetical order. 3) List each customer'saccount balance and include the largest account balance amountand the sum of all the account balance amounts in the report output.
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
Adams $595.00Cooper $725.00Evans $865.00Hill $525.00
Ivers $675.00
MAX ACCOUNT BALANCE ^$865.00'
SUM ACCOUNT BALANCE $3385.00
See Also: item, highest of,
min, mean, std.dev., std.err.,
sum, variance
There's an important
difference between the
statistical operator max andthe relational statistical
operator highest of.
max finds the highest value in
the specified field among the
records being processed.
highest of finds the highest
value in the specified field
among the records related to
the records being processed.
6-119 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 283/395
DQL LEXICON
mean
Keyword: mean
Type: Statistical Operator
Purpose: The mean operator finds the average value in a specified
field among all the records that are processed. The result
appears in the statistical summary areas of the report.
Syntax: VALUE : mean [other statistical operators]
Returns: A numeric value.
Usage: The mean operator calculates the average of all the values in
the specified field (the sum of the values divided by the
number of values processed). Blank fields are ignored in the
calculation. Fields that have a value of zero are included in
the calculation.
Example: 500or CUSTOMERS with ACCOUNT BALANCE >list recordsLAST NAME in order ;
ACCOUNT BALANCE Item mean sum .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than 500 in the ACCOUNT balance field. 2) List the
customers by last name in alphabetical order. 3) List each customer's
ACCOUNT BALANCE and include the mean ACCOUNT balance amountand the sum of all the ACCOUNT balance amounts in the report output.
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
AdamsCooperEvansHill
Ivers
$595.00$725.00$865.00$525.00$675.00
MEAN ACCOUNT BALANCE $677.00SUM ACCOUNT BALANCE $3385.00
See Also: item, max, min,
mean of, std.dev., std.err.,
sum, variance
There's an important
difference between the
statistical operator meanand tile relational statistical
operator mean of.
mean finds the average valu
in the specified fie Id amongthe records being processed.
mean of finds the averagevalue in the specified field
among the records related
the records being processed.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 284/395
DATABASE REFERENCE MANUAL
mean of
Keyword: mean of
Type:
Purpose:
Relational Statistical Operator
The mean of operator calculates the average value in a
specified field in all matching records in a related form.
The result can appear as a list item in the detail area of a
report or as a statistic in the summary area at the end of
each group or at the end of the report.
Syntax: mean of FORMNAME| RELATIONSHIP [named UNIQUE
RELATIONSHIP NAME ] [with (selection criteria)] FIELDNAME
Returns: A numeric value.
Usage: The mean of operator calculates the average of all the values
in the specified field (the sum of the values divided by the
number of values processed). Blank fields are ignored. Fields
that have a value of zero are included in the calculation.
Example: for CUSTOMERS ;
list recordsLAST NAME in Order ;
mean of INVOICES order total .
end
This query tells DataBase: 1) Process all the CUSTOMERS records andlist each customer's last name in alphabetical order. 2) For eachCUSTOMERS record processed, find all the related records in theINVOICES form (those that have the same customer #). 3) List themean order total for each customer from the set of related INVOICESrecords.
The output from this query might look as follows:
LAST NAME MEAN OF INVOICES ORDER TOTAL
AdamsCooper
EvansHill
Ivers
$35.25$72.40
$48.10$25.00$67.45
If you also want to include the mean order total among this group ofinvoices, change the fourth line of the query to read:
mean of INVOICES order total : item mean .
See Also: all, any, count of,
highest of, lowest of, mean,sum of, named
There's an important
difference between the
statistical operator meanand the relational statistical
operator mean of.
mean finds the average value
in the specified field amongthe records being processed.mean of finds the averagevalue in the specified field
among the records related to
the records being processed.
6-121 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 285/395
DQL LEXICON
message
Keyword: message
Type:
Purpose:
Syntax:
Usage
Procedural Command
The message command tells DataEase to display a specified
message. The message content can be approximately 1000
characters in length (17 lines x 68 characters per line). Each
message can be assigned individual color and highlighting
effects and be positioned anywhere on the screen.
message MESSAGE TEXT' [window] [pause]
When you select message from the list of DQL commands
DataEase prompts:
Type the message to be displayed.
You can choose to use a current system variable, a relational
operator, a function, and/or a text constant enclosed in
quotation marks when entering the message.
When you finish entering the message, DataEase offers you
the choice of displaying the message in a window. If you
select this option, the message can be up to 1000 characters in
length. DataEase automatically creates a window of the
appropriate size for the message text. To divide the message
into multiple lines, insert a vertical bar character I to indicate
a new line (see Example 1 ).
If you want to control the size and location of the message
window yourself, you can sf)ecify the following parameters at
the start of the message text (see Example 2):
# of Columns, Stan Row, Start Column, # of Rows. MESSAGE
You can also control the color and highlighting of all or part
of a message by enclosing the text in angle brackets <treated
like key names>, braces {regular field color), or regular
brackets [regular text] as defined on the Screen Styles form
(See Example 3).
For more information on message highlighting, see the
explanation of the Screen Styles form in Volume 2,
Chapter 4, System Administration.
-> This entry continues on the next page
See Also: Define ScreenStyles in Volume 2. Chapter
System Administration, andField Help in Volume 2.
Chapter I . Form Definition.
The message commandfunctions in the same wayHelp messages are defined.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 286/395
DATABASE REFERENCE MANUAL
message (cont.)
Usage: If you don't choose the window option, the message length is
limited to 40 characters and is displayed on one line in the
upper right comer of the screen (see Example 4).
When a message is displayed in a window, DataEase pauses:
the user is required to press any key to acknowledge the
message and resume processing. If you don't display the
message in a window, DataEase asks if you want to use this
pause feature.
Example 1: message Sorry. |A high security level is requirecl|to runthis procedure window .
This message is displayed in a window. There are line breaks after the
words Sony and required.
Example 2: ISessage 40, 15, 20, 3, Sorry. |A high security level
requiredjto run this procedure window .
This message is displayed in a window. There are line breaks after the
words Sony and required. The message window is 40 columns wide,
begins in row 15, column 20, and is 3 rows in length.
Example 3: message 40, 15, 20, 3, <Sorry>.|A {high} securitylevel is required|to [run] this procedure window .
This message is displayed in a window. There are line breaks after the
words Sony and required. The message window is 40 columns wide,begins in row 15. column 20. and is 3 rows in length. The word Sorjyis highlighted like a keyname as defined on the Screen Styles form. Theword /»?/( is highlighted in the regular field color. The word run is treated
like regular text.
Example 4: message Sorry. A high security level is required to
run this procedure pause .
This message is displayed on a message line in the upper right comer ofthe screen. The message is truncated after the word required (40
character maximum length). When the message is displayed, DataEasepauses until the user presses a key to acknowledge the message.
6-123 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 287/395
DQL LEXICON
midc
Keyword: midc
Type: Text Function
Purpose: The midc function extracts a specified number of characters
from the middle of a text value.
Syntax: midc(TEXT VALUE, m, n)
See Also: Jirstcfirstlast,
firstwjointext, lastc, lastflrst,
lastw, length, lower, midw,proper, textpos, upper
where m is the starting position in the text value and n is the
number of characters to extract.
Returns: A text value n characters in length.
Usage: midc( FIELDNAME, m, n) returns n characters beginning at
character position m (inclusive). Intervening spaces and
punctuation symbols are included. Trailing spaces are ignored.
Examples: midc( DataEase , 4, 3)
Returns; aEa
midcC'New User , 5, 3)
Returns: Use
midC(LAST NAME, 4, 2)
Returns two characters beginning at the fourth
character position in the last name field for everyrecord that is processed. If a record contains the
value Holmes in the last name field, the function
returns me.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 288/395
DATABASE REFERENCE MANUAL
midw
Keyword: midw
Type: Text Function
Purpose: The midw function extracts a specified number of words from
the middle of a text value.
See Also: firstc,firstlast,
firstw,jointext, lastc, lastfirsl,
lastw, length, lower, midc,
proper, textpos, upper
Syntax: midw(TEXT VALUE, m. n)
where m is the starting position in the text value and n is the
number of words to extract.
Returns: A text value n words in length.
Usage: midw(FIELDNAME, m, n) returns n words beginning at
word number position m (inclusive). Intervening spaces and
punctuation symbols are included. Trailing spaces are ignored.
Examples: midw( DataEase International Inc. , 2, 1)
Returns: International
midw( New Users Group , 2, 2)
Returns; Users Group
midw(BOOK TITLE, 2, 3)
Returns three words beginning at the second wordposition in the book title field for every record that is
processed. If a record contains the value The Houndof the Baskervilles in the book title field, the function
returns Hound of the.
6-125 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 289/395
DQL LEXICON
min
Keyword: min
Type: Statistical Operator
Purpose: The min operator finds the smallest value in a specified field
among all the records that are processed. The result appears
in the statistical summary areas of the report.
Syntax: VALUE : min [other statistical operators]
See Also: item, lowest of,
max, mean, std.dev., std.err.,
sum, variance
Returns: A value of the same type as the specified value. If the
specified value is a Text field, min returns the lowest
ASCII value.
Example: for CUSTOMERS ;
list recordsLAST NAME in order
;
ACCOUNT BALANCE : item min .
end
This query tells DataBase: 1) Process all the CUSTOMERS records and
list each customer's LAST NAME in alphabetical order. 2) List each
customer's ACCOUNT balance and include the smallest ACCOUNTBALANCE amount in the report output.
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
AdamsCooperEvansHill
Ivers
$595.00$725.00$865.00$525.00$675.00
There's an important
dijference between the
statistical operator min andthe relational statistical
operator lowest of.
min returns tite lowest value
in the specified field amongthe records being processed.
lowest of returns the lowest
value in the specified field
among the records related
the records being processed.
MIN ACCOUNT BALANCE $525.00
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 290/395
DATABASE REFERENCE MANUAL
minutes
Keyword: minutes
See Also: ampm, current.
Type: Time Function hour, seconds, timeampm
Purpose: The minutes function extracts the minutes from a time value
expressed in a 24-hour format.
Syntax: minutes(TIME VALUE)
Returns: An integer value from 00 to 59.
Examples: minutes(1 2:00:00)Returns: 00
minutes(23:59:00)Returns: 59
6-127 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 291/395
DQL LEXICON
mod
Keyword: mod (modulus)
Type: Scientific Function
Purpose: The mod (modulus) function returns the remainder when one
numeric value is divided by a second numeric value. If both
values are integers, an integer value is returned. Otherwise, a
decimal value is returned.
See Also: abs, ceil, floor,
random
Syntax: mod(NUMERIC VALUE 1, NUMERIC VALUE 2)
Returns: A numeric value.
Examples: mod(8, 3)Returns; 2
mod(12.6, 1.6)
Returns: 1.4
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 292/395
DATAEASE REFERENCE MANUAL
modify records
Keyword: modify records
Type: Processing Command
Purpose: The modify records command modifies records in a specified
form.
See also: copy all from,data-entry, delete records,
enter a record, list records
Syntax:
Usage:
nodify records in FORMNAME |RELATIONSHIP [named UNIQUE
RELATIONSHIP NAME ] [with (selection criteria)]
FIELDNAME := MODIFIED VALUE
The modify records command must specify a Target form
and the field values to be changed in the Target form.
Alternatively, you can specify a Source form to copy field
data from using the copy ail from command. As data is
entered in the Target form, automatic error checking is
performed and errors are logged to an error file.
When you modify records in the Primary form, the keyword
in is omitted and no punctuation is used after the modify
records command (see Example 1 ). If no selection criteria
are specified, all the records in the Primary form are modified.
Example 1: for CUSTOMERS with (any INVOICES order total> 500) ;
modify recordsACCOUNT BALANCE := (ACCOUNT BALANCE - data-entryDISCOUNT) .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have any related INVOICES record with an ORDER total greater than
$500. 2) Modify each CUSTOMERS record by subtracting the DISCOUNTamount entered in the Data-entry form from the value in the ACCOUNTBALANCE field.
This entry continues on the next page
6-129 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 293/395
DQL LEXICON
modify records (cont.)
Usage: When you modify records in a form other than the Primary
form, the keyword in precedes the form name, and the
command ends with the appropriate punctuation mark (a
semicolon or a period - see Example 2). If no selection
criteria are specified, all the records in the specified form
are modified.
Example 2: for CUSTOMERS with state = NY ;
modify records in INVOICESORDER TOTAL := ORDER TOTAL + NY SALES TAX .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have NY in the STATE field. 2) For each CUSTOMERS record that is
processed, find all the related records in the INVOICES form. Modifyeach related INVOICES record by adding the NY SALES TAX amount to
the value in the ORDER TOTAL field.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 294/395
DATABASE REFERENCE MANUAL
month
Keyword:
Type:
Purpose:
Syntax:
Returns:
Examples:
month
Date Function
The month function extracts the month (1- 12) from a date
value.
See Also: current, day, date,
Julian, spelldate, spellmonth,
spellweekday, year, yearday,yearweek
month(DATE VALUE)
An integer value between I and 12. The date format selected
in System Administration changes the date sequence but does
not affect which value is returned by a Date function.
month(1 2/31/89)
Returns: 12 (North American format)
month(31/12/89)Returns: 12 (European format)
month(89/12/31)Returns: 12 (Metric format)
6-131 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 295/395
DQL LEXICON
named
Keyword: named
Type: Relational Operator
Purpose: The named operator is used to give a unique name to each
relationship based on different selection criteria so DataEase
can distinguish multiple relationships between the same forms.
See Also: Ad-hoc Relationship
Syntax:
Usage:
RELATIONSHIP named UNIQUE RELATIONSHIP NAME [with
(selection criteria)]
During a query, whenever you add or change the selection
criteria of a relationship (predefined or ad-hoc), you create a
newad-hoc relationship. If two
formsare related
by morethan one relationship, each of these relationships must be
assigned a unique name, either on the Relationships form or
by using the named operator in the query, so DataEase can
distinguish between them.
A unique relationship name is an arbitrary name. The name
you assign to the relationship is analogous to the optional
relationship name used on the Relationships form. It can be
any name you like as long as no other relationship in the
query has the same name. The name is placed in quotes at the
time it's first defined; no quotation marks are used if thename appears in subsequent statements.
When you use the named operator to distinguish a
relationship, the relationship automatically forfeits any
previously defined criteria, including the criteria on which a
predefined relationship was based. Thus, if you add newcriteria to a relationship and use the named operator to
distinguish it. you must also restate all of the criteria that
defines the relationship. Once a relationship is assigned a
unique name, you can use the relationship name alone to
reference it without restating the criteria.
-^ This entry continues on the next page
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 296/395
DATAEASE REFERENCE MANUAL
named (cont.)
Example: for CUSTOMERS ;
modify records in INVOICES named CURRENTwith (CUSTOMER # = CUSTOMERS CUSTOMER #
and DATE > 01/01/89)ORDER TOTAL := ORDER TOTAL - data-entry DISCOUNT
delete records in INVOICES named OUTDATEDwith (CUSTOMER # = CUSTOMERS customer #
and DATE < 01/01/80)end
This query tells DataBase: 1) Process all the CUSTOMERS records.
2) For each record processed, find all the related INVOICES records.
3) Divide the related INVOICES records into two groups: one groupnamed CURRENT (dated after January 1st, 1989). and a second groupnamed OUTDATED (dated before January 1st, 1980). 4) Modify the
records in the CURRENT relationship by subtracting the discount value
entered in the Data-entry form from the INVOICES ORDER total.5) Delete the records in the OUTDATED relationship.
There is a predefined relationship between CUSTOMERS andINVOICES. During this query, we are creating two different ad-hocrelationships between CUSTOMERS and INVOICES by adding selection
criteria based on the value in the date field. The named operator is usedto assign a unique relationship name to each group of records so DataBasecan distinguish between these two relationships.
Because the previous criteria is forfeited whenever a new relationship is
created, the full relationship criteria, including the criteria used in thepredefined relationship (customer # = CUSTOMERS customer #), is
specified when each relationship is named.
Subsequently, as long as the criteria remains unchanged, you can use the
relationship name alone without restating the relationship criteria. Forexample, if after modifying the records in the CURRENT relationship youwant to list the invoice # and ORDER TOTAL of each record, the querywould look like this:
Example: for CUSTOMERS ;
modify records in INVOICES named CURRENTwith (customer # = CUSTOMERS customer #
and DATE > 01/01/89)ORDER TOTAL := ORDER TOTAL - data-entry DISCOUNT
list records in CURRENTINVOICE # in order
;
ORDER TOTAL .
end
6-133 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 297/395
DQL LEXICON
Nested Actions
Keyword: Nested Actions
Type: Concept
Purpose: A Nested Action is an action that is invoked by another
action.
There are two types of nested actions: 1) A nested loop
action performs the same series of actions on each record that
is processed (see Example 1). 2) A nested conditional action
is most often used to select subgroups of records and perform
different actions on each group (see Example 2).
Example 1: for CUSTOMERS ;
for INVOICESlist recordsCUSTOMERS LAST NAME in groups ;
INVOICE #;
ORDER TOTAL .
See Also: for, case, end, if
while
endend
This query tells DataEase to perform the same series of actions on each
record selected by the for command. In this example, the second for
command, which retrieves the invoices related to the CUSTOMERSrecord that is currently being processed, is nested within the first for
command.
Example 2: for INVOICES ;
if ORDER TOTAL > 500 thenmodify records in CUSTOMERSSTATUS := PREFERRED .
if DATE between 01/01/89 to current date tfien
enter a record in CATALOG CUSTOMERScopy all from CUSTOMERS .
endend
end
This query tells DataEase to select two groups of INVOICES records:
1) All the records with an ORDER TOTAL greater than $500 (the related
CUSTOMERS records get modified). 2) The records with an orderTOTAL greater than 500 and a date between the start of 1989 and today's
date (the related CUSTOMERS records get modified and copied into the
CATALOG CUSTOMERS form).
In this example, the second if command, which selects a subgroup of the
records selected by the f ir st i f command, is nested within the first if
command.
Although DataEase does n
require it. it is easier to foll
the logic if you indent nested
actions as shown in these
examples.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 298/395
DATAEASE REFERENCE MANUAL
not
Keyword: not
Type: Comparison Operator
Purpose: The not operator reverses the meaning of any comparison
operator it precedes (e.g., STATE not = NY means any state
except New York).
See Also: and, between, or,
Syntax:
Usage:
VALUE 1 not comparison operator VALUE 2
Examples:
The not operator's effect can often be accomplished by
stating the comparison in a different way. For example.
< (/fii r/ic/;;) can be substituted for not >= (not equal or
greater than). Whenever possible, comparisons should be
stated as a positive expression.
ORDER TOTAL not > 500 means the value in the orderTOTAL field is less than or equal to 500.
STATE not = NY and state not = NJ ;
means any state except New York or New Jersey.
6-135 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 299/395
DQL LEXICON
Operators
Keyword: Operators
Type: Concept
Purpose: Operators refine commands; they tell DataBase how to
execute the various operations specified by Processing and
Control Commands.
There are six groups of DQL Operators which are listed to the right and
briefly summarized below:
• Comparison Operators tell DataBase to compare the value to the
left of the operator with the value to the right of the operator and
process the record if the comparison is true.
• Grouping and Sorting Operators tell DataBase to change the order
in which records are processed and listed in the output.
• Relational Operators let you retrieve specified field information
from a related form.
• Statistical Operators summarize the values of a specified field for
all the records that are processed.
• Conditional Statistical Operators indicate for which records a
specified condition is true and the total number or the percentage of
processed records for which the condition is true.
• Relational Statistical Operators are used to summarize field
information from a set of records in a related form.
There is a separate entry for each individual operator in this lexicon.
List of DQL Operators
COMP.ARISON
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 300/395
DATABASE REFERENCE MANUAL
or
Keyword: or
Type: Logical Operator
Purpose: The or operator combines two sets of selection criteria.
Syntax: SELECTION CRITERIA 1 or SELECTION CRITERIA 2
Returns: The values in records that satisfy either of the selection
criteria statements.
Usage: The or operator requires that a record meet either of the
specified criteria to be processed (as opposed to the andoperator which requires that a record meet all the specified
selectioncriteria to be processed).
When selection criteria are combined with both the and andor operators in one statement, the criteria must be enclosed in
parentheses to clarify the meaning.
Examples: for CUSTOMERS with state = NYor ACCOUNT BALANCE > 500
;
This statement tells DataBase: Process only those CUSTOMERS recordsthat contain NY in the state field or have a value greater than $500 in
the ACCOUNT BALANCE field. A record is processed if it satisfies either ofthese criteria.
for CUSTOMERS with (state = NY or state = NJ )and ACCOUNT balance > 500
;
This statement tells DataBase: Process only those CUSTOMERS recordsthat contain either NY or NJ in the STATE field and a value greater than$500 in the account balance field.
In this case, only records that satisfy both sets of criteria are processed.
See Also: between, not, and,=, <, <=, >, >=
6-137 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 301/395
DQL LEXICON
Others
Keyword: others
Type:
Purpose:
Syntax:
Keyword
The others keyword is an optional component of the case
command syntax. When processing a case command,
DataBase compares the expression that follows case to each
of the statements specified by the keyword value. If none of
the specified value comparisons are true. DataBase executes
the actions specified after the keyword others. As soon as
the actions following any value or others statement are
executed, processing passes to the first action following the
end command for the case statement.
See Also: case, value
case (EXPRESSION)value COMPARISON 1 :
ACTION SERIES 1.
[value COMPARISON 2 :
ACTION SERIES 2.1
[value COMPARISON N ;
ACTION SERIES N][others :
OTHERS ACTION SERIES]
end
Usage: The case command requires a case expression, one
comparison value, and an end command. Subsequent value
statements, actions, and the others keyword are optional.
If others is used, it must follow all the specified comparison
values.
Example: case (current user name)value FRANK :
call menu ADMINISTRATION .
value CAROL :
run procedure DAILY .
others ;
record entry CUSTOMERS .
end
This query tells DataBase: If the current user is Frank, display the
ADMINISTRATION menu. If the current user is Carol, run the DAILYProcedure. If the current user is anyone other than Frank or Carol,
display the CUSTOMERS Record Entry form.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 302/395
output
DATAEASE REFERENCE MANUAL
Keyword: output
Type: Procedural Command
Purpose: The output command is used to write text or fields directly to
the output device during processing without regard to the
report format. The text and fields are sent to the screen or
printer immediately when the command is encounteredwithout regard to grouping, formatting, or other commandstructures. The command is very similar to the PRINTcommand found in many programming languages.
Syntax:
Usage:
output :
FIELDI
TEXT
The output command lets you specify output fields and/ortext directly in the qiieiy. In Interactive Mode, when youchoose the output command. DataEase automatically
switches into Edit Mode and asks you to define what youwant to output. You can enter text (including titles, boundarylines, etc.) or move the cursor to the desired location andpress FIO FIELD to enter a field.
When you press FIO, DataEase displays the Report Field
Definition screen just as it does when you are defining a
report format. You can select a field from the menu DataEasedisplays or enter a field derivation in the Report Field
Formula Window. See Adding and Modifying Fields in
Chapter 5 of this volume for a detailed explanation of how to
generate output from fields.
The output command must be entered on a separate line in
the query and be followed by a colon. You can use anynumber of output commands in a single query. Followingeach output command, you can enter any number of lines
containing fields or text. Following the last line to be output,
insert a period on a separate line in Column I of the query.
After inserting an output command in Edit Mode, you mustinsert a period in column 1 of the query before you can return
to Interactive Mode.
See Also: all, Nested Actions,Primary Form, Relationships,
Secondary Form
For more information, see
Editing Formats: Addingand Modifying Fields in
Chapter 5 of this volume.
-^ This entry continues on the next page
6-139 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 303/395
DQL LEXICON
output (cont.)
To demonstrate the use of the output command. Example 1 shows a
query that appears in the entry for the for command.
Since its impossible to completely align information processed and printed
in sequence from two different forms, this query produces output that is
very difficult to read as shown below:
Examplel : for CUSTOMERS with account balance > 500 ;
list recordsLAST NAME in order .
end
for INVOICES ;
list recordsINVOICE # in order ;
ORDER TOTAL .
end
LAST NAME INVOICE # ORDER TOTAL
Adams
Cooper
Evans
Hill
Ivers
A00005
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 304/395
DATABASE REFERENCE MANUAL
output (cont.)
Example 2: output :
LAST NAME
for CUSTOMERS with account balance > 500list recordsLAST NAME in orderoutput :
[LAST NAME]
end
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 305/395
DQL LEXICON
output (cont.)
A common usage of the output command is to process records frommultiple secondary or tertiary forms. For example, assume your database
has 3 secondary forms: OFFICERS. DIRECTORS, and EMPLOYEES,that are all related to the Primary form: CORPORATION. The forms are
related by the field CO #. If you want to produce a report listing fields
from all these forms, you cannot use the all operator. However, you can
use the output command, as shown in Example 3.
Example 3:
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 306/395
DATAEASE REFERENCE MANUAL
output (cont.)
A sample printout from the query in Example 3 is illustrated below.
D. Vader, Inc.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 307/395
DQL LEXICON
percent
Keyword: percent
See Also: item, count
Type: Conditional Statistical Operator
Purpose: The percent operator calculates the percentage of records that
satisfy a condition specified by a comparison of two values.
Syntax: CONDITION : percent [other statistical operators]
Returns: A numeric value.
Example: for CUSTOMERS ;
list recordsLAST NAME in order
;
ACCOUNT BALANCE :
ACCOUNT BALANCE > 500 : item percent
.
end
This query tells DataBase: 1) Process all the CUSTOMERS records and
list each customer's LAST NAME in alphabetical order. 2) List each
customer's ACCOUNT balance. 3) For each customer, display a YES or
NO answer indicating if the ACCOUNT balance is over $500. 4) Display
the percentage of records that have a ACCOUNT BALANCE value greater
than $500 in the report output.
The output from this query might look as follows:
LAST
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 308/395
DATABASE REFERENCE MANUAL
periods
Keyword: periods
Type: Financial Function
Purpose: The periods function calculates how long a financial
transaction requires to reach a future target value given the
presentvalue, futurevalue, installment payment, and interest
rate.
Syntax: periods(presentvalue, futurevalue, installment, rate)
Returns: A numeric value (the number of periods needed to reach the
target futurevalue of the investment).
Usage: if the installment payment increases the value of the
investment (e.g., an annuity), the installment is expressed as a
positive amount. If the payment decreases the value of the
investment (e.g., loan amortization), the installment is
expressed as a negative amount.
The interest rate, installment payments, and time periods must
be based on the same terms. To determine periods as a
number of months, the rate is expressed as the annual rate /
12. To determine periods as a number of weeks, the rate is
expressed as 7 * annual rate / 365.
Examples: ceil(periods(10000, 0,
Returns: 89-150,8/12))
This example calculates how many months it takes to repay a loan of
$10,000 at 8% annual interest with monthly installment payments of $150.
The ceil function rounds up the result to the next integer.
cell(periods(0, 10000, 250, 10/12))Returns: 35
This example calculates how many months it takes to accumulate $10,000
in savings, if you begin with no money in the account, make monthly
deposits of $250, and earn 10% annual interest.
NOTE: DataBase financial functions are derived from the formula
shown below. (The double asterisks (meaning raise to the
power ) cannot he used in a query).
futurevalue = principal * ((1 + (rate/IOO)) ** periods) +(installmentl(ratellOO)) * (((1 + (rate/IOO)) ** periods) - I)
See Also: futurevalue,
installment, presentvalue, rate
When typing fractions like8 1 12. DataBase requires that
you type a space before andafter the division symbol (I).
6-145 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 309/395
DQL LEXICON
power
Keyword: power
Type: Scientific Function
Purpose: The power function raises a numeric value to a specified
power.
Syntax: power(BASE, EXPONENT)
Returns: A numeric value equal to the base raised to the exponent.
Usage: DataBase does not support ** as a symbol for exponentiation.
Use the power function instead.
Examples: power(12, 2)
Returns: 144
power(6, 3)
Returns: 216
power(8, 1/3)Returns: 2
See Also: exp, log, loglO,
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 310/395
DATAEASE REFERENCE MANUAL
presentvalue
Keyword: presentvalue
Type: Financial FunctionSee Also: futurevalue ,
installment, periods, rate
Purpose:
Syntax:
The presentvalue function calculates the required starting
amount for a financial transaction given the futurevalue,
installment payment, interest rate, and number of payment
periods.
presentvalue(futurevalue, installment, rate, periods)
Returns: A numeric value (the initial value before any installment
payments are made).
Usage: If the installment payment increases the value of the
investment (e.g., an annuity), the installment is expressed as a
positive amount. If the payment decreases the value of the
investment (e.g., loan amortization), the installment is
expressed as a negative amount.
The interest rate, installment payments, and time periods must
be based on the same terms. For example, if the periods are
expressed in months, the monthly interest rate is expressed as
the annual rate / 1 2.
Examples: presentvalue(0, -150, 7.9 / 12, 48)
Returns: 6156.12
This example calculates the auto loan amount you can afford to borrow at
an interest rate of 7.9% if you want to repay the loan in 48 monthlypayments of $150.
presentvalue(1 25000, 150, 10 / 12, 240)Returns: 1514.00
This example calculates the required starting balance for a savings plan
designed to accrue a $125,000 balance in 20 years based on monthly
payments of $150 and an annual interest rate of 10%.
NOTE: DataEa.se financial fiiiHiions are derived from the formulashown below. (The double asterisks (meaning raise to the
power ) cannot he used in a query).
futurevalue = principal * ((I + (rate/ 100)) ** periods) +(installment/date/ won * (((1 + (rate/ 100)) ** periods) - I)
When typing fractions like
7.9 1 12. DataBase requiresthat you type a space before anafter the division symbol (/).
6-147 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 311/395
DQL LEXICON
Primary Form
Keyword: Primary Form
Type: Concept
Purpose: The first form specified in a query is called the Primary
form for the query. The Primary form should be the form
that holds the key data you want to view or manipulate.
See Also: Ad-hoc
Relationship, all, output.Relationships, SecondaryForm
Usage: One form can be related to another form by either a
predefined or an ad-hoc relationship. A form related to the
Primary Form is called a Secondary form. A form related to
a Secondary form is called a Tertiary form, etc. There can be
any number of such relationship levels (see Figure 6-1 below).
When processing the records in a form, the data in another
form can be accessed if a relationship exists between these
forms. A relational operator (all, any, count of, highest of,
lowest of, mean of, or sum of) is used to access the data mthe related form. The all operator cannot be used to access
records in more than one form on any relationship level (i.e.,
no more than one Secondary form, one Tertiary form, etc.).
However, you can use the output command to access all
related records in more than one form on a particular
relationship level.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 312/395
DATAEASE REFERENCE MANUAL
Procedural Commands
Keyword: Procedural Commands
Type: Concept
Purpose: The DQL Procedural commands are used to organize and
control the flow of actions in a procedure.
Usage: Procedural commands can be used in both Processing
procedures and Control procedures.
Example: case (spellweekday(weekday(current date))
value MONDAY :
run procedure NEW WEEK .
value FRIDAY :
run procedure CLOSE WEEK .
others :
call menu MAIN .
end
This query tells DataBase: If the current date is a Monday, run the NEWWEEK procedure. If the current date is a Friday, run the CLOSE WEEKprocedure. If the current date is any other day of the week, display the
Main Menu.
See also: Control Procedure,Processing Procedure
Procedural Commands
output
messageif
else
endwhile
breakexit
case
value
others
define
assign
. (period)
6-149 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 313/395
DQL LEXICON
Processing Procedure
Keyword: Processing Procedure
Type: Concept
Purpose: A DQL Processing procedure can enter, delete, and modify
records, as well as create screen, disk, or printed output based
on the query instructions, the data stored in database forms,
and additional data input during the execution of the
procedure.
Usage: The Processing commands (shown at right) are used to create
a Processing procedure. These commands cannot be used in a
Control procedure, but they can be used within a Processing
procedure that is part of a Control procedure.
Example: for CUSTOMERS ;
list recordsLAST NAME in orderACCOUNT BALANCE .
end
See Also: Control Procedure
Processing Commands
list records
modify records
delete records
enter a record
for
lock
unlock
quer>' selection
input
This query tells DataBase: 1) Process all the CUSTOMERS records.
2) For each record processed, list the LAST name and the ACCOUNTBALANCE values and arrange the output in alphabetical order by LASTNAME.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 314/395
DATAEASE REFERENCE MANUAL
proper
Keyword: proper
Type: Text Function
Purpose: The proper function converts the first letter in each word in a
text value to uppercase, and subsequent letters to lowercase.
Syntax: proper(TEXT VALUE)
Returns: The specified text value with the first letter in each word
capitalized.
Usage: Any letter that is preceded by a space, hyphen, ampersand, or
a period is capitalized by the proper function as is the first
let ter in the parenthesized value. Other punctuation, includingthe apostrophe, does nor act as a delimiter for the proper
function.
A letter that is neither the first letter in a word nor the first
let ter in the specified value is converted to lowercase by the
proper function.
This function is commonly used in the derivation formula
for text fields during Form Definition. For example, if the
derivation for the field last name is:
proper(LAST .name)
you can enter the text in either case and DataBase converts it
to the proper format.
Examples:proper{ dr. watson )
Returns: Dr. Watson
properC'washington d.c )
Returns: Washington D.C.
proper(FULL NAME)Returns the value in the FLiLL NAME field in the proper
format for every record that is processed. If a record contains
the value sherlock homes, or SHERLOCK HOLMES, or even
SHeiLOck hOLniES. the function returns Sherlock Holmes.
See Also: firstcfirstlast,
firstwjointext, lastc, lastfirst,
lastw, length, lower, midc,midw, textpos, upper
6-151 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 315/395
DQL LEXICON
query selection
Keyword: query selection
Type:
Purpose:
Syntax:
Processing Command
The query selection command is functional only on a LAN(local area network). This command is used to override the
default locking rules specified on the System Configuration
form. It should only be used by a technical expert who is
very familiar both with DataBase and the LAN environment
in use. If you do not have expertise in LANs, you can rely on
the default locking rules to lock your data appropriately.
Before DataBase begins processing records for a query, it
must select the records to be processed. The query selectioncommand tells DataBase how to set locks prior to the start of
processing if records are being selected or sorted on an
indexed field. If records are not being selected or sorted on
an indexed field, the locking rule defined on the System
Configuration form for Record Processing applies.
query selection lock files| records |
nothing.
See Also: lock, lock db,
unlock, unlock db
The three syntax options that are used in conjunction with the
query selection command are explained below.
The query selection lock files command overrides the current default
Record Selection locking rule and locks the fonn(s) from which records
are being selected. Other users cannot add, modify, or delete records in
the form. They can view records in the form if the selected records will
only he listed hy the procedure (not modified or deleted). The formremains locked until the end of the procedure.
The query selection lock records command overrides the current default
Record Selection locking rule and locks any records that have beenselected for processing. Other users cannot modify or delete these
records. They can view the records if the selected records will only he
listed hy the procedure (not modified or deleted). Other users can view,modify, or delete records in the same form(s) that have not been selected.
Once processing begins, the locking rule defined on the SystemConfiguration form for Record Processing applies.
CAUTION .The query selection lock records command should he usedwith great care. It should only he used for procedures that
select very few records from very few forms. If this commandis used for many records, most LANs cannot support the
number of locks required. If this command is usedincorrectly, the integrity of your data can he compromised.
The default record selection
locking rules resolve anyconflict that might arise wother users attempt to view,
modify, or delete records
have been selected to beprocessed hy a report query.
For more information onLAN default locking rules,
LAN Multi-User LockingOptions in Volume 2, Chapt4, System Administration.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 316/395
DATABASE REFERENCE MANUAL
query selection (cont.)
The query selection lock nothing command overrides the current defaultRecord Selection loci<ing rule and unlocks the form(s) from which recordsare being selected. Other users can view, modify, or delete records that
have been selected for processing. Once processing begins, the lockingrule defined on the System Configuration form for Record Processingapplies.
The lock nothing command can be useful in situations where you need to
keep data available to many users even while running a procedure that
uses that data. However, with this command in effect, it is possible for auser to change a record that has already been selected for processing.
NOTE:
Usage:
If a lock all files command occurs as the first command in aquery, it overrides all locking commands specified on the
System Configuration form and any locking commandsspecified later in the query. A lock all files command locksall files used by the procedure until an unlock command is
encountered or the procedure ends, regardless of subsequentcommands. See the lock command earlier in this chapter formore information.
The query selection command overrides the LAN default
Record Selection locking rules assigned by the database
administrator. A query selection command is automatically
terminated at the end of a query.
Example: query selection lock nothing .
for CUSTOMERS with bonus points > 500 ;
modify recordsACCOUNT BALANCE := (ACCOUNT BALANCE * data-entryDISCOUNT) .
end
This query tells DataBase: 1) Override the default Record Selectionlocking rule so other users can view, add, delete, or modify the data in theCUSTOMERS form while records are selected to be processed by this
procedure. 2) Select all the CUSTOMERS records whose BONUS pointsare greater than 500. 3) Modify each selected record by multiplying theACCOUNT BALANCE amount by the value in the discount field on theData-entry form.
In this example many records may be selected to be processed. However,users can still access the CUSTOMERS form while the procedure is
processing. It is unlikely that any customer's bonus points will fall
below 500 while the query is being processed.
6-153 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 317/395
DQL LEXICON
random
Keyword: random
Type: Math Function
Purpose: The random function returns a random decimal value
between and 1 (inclusive). No value is required in the
function's argument.
Syntax: random(
Returns: A number between and 1 (inclusive).
Usage: The following steps are used to generate a random integer
using the random function:
1. Determine the range (number of possibilities) in which the
random number must fall. For example, if the desired range
is between 10 and 100, the range is 90.
2. Determine starting value (smallest integer) of the range.
In the example 10-100, the starting value is 10.
3. Use the following formula to generate a random integer.
(random( ) * RANGE) + STARTING VALUE
Examples: floor(random( )* 9)
Returns: A random integer between and 9.
floor(random( )* 90) + 10))
Returns: A random integer between 10 and 100.
In these examples, floor rounds down the result to the nearest integer.
See Also: abs, ceil, floor,
The result of the randomfunction is really apseudo-random numbercalculated by a formula, n
true random number.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 318/395
DATABASE REFERENCE MANUAL
rate
Keyword: rate
Type: Financial Function
Purpose: The rate function calculates the interest rate of a financial
transaction given the presentvalue. futurevalue. installment
payment, and the number of payment periods.
Syntax: rate{presentvalue, futurevalue, installment, periods)
Returns:
Usage:
Examples:
A numeric value (the interest rate).
If the installment payment increases the value of the
investment (e.g., an annuity), the installment is expressed as a
positive amount. If the payment decreases the value of the
investment (e.g.. loan amortization), the installment is
expressed as a negative amount.
The interest rate, installment payments, and time periods mustbe based on the same terms. If payments are made monthly,
periods is computed as the number of years * (multiplied by)
12 and rate is computed as 1/12 of the annual rate.
12 * rate(12000, 0, -289, 48)Returns: 7.3
This example calculates the annual interest rate on a $12,000 car loan to
be repaid in 48 monthly payments of $289.
12 * rate(0, 20000, 250, 60)Returns: 10.2
This example calculates the annual interest rate required to accumulate$20,000 in savings, if you begin with no money in the account and makemonthly payments of $250 over a period of 5 years.
NOTE: DataBase financial functions are derived from the formulashown below. (The double asterisks (meaning raise to the
power ) cannot be used in a query).
futurevalue = principal * ((I + (rate/ 100)) ** periods) +(installmentl(ralellOO)) * (((/ + (rate/100)) ** periods) - I)
See Also: futurevalue,
installment, periods,presentvalue
When typing fractions like
10 1 12, DataBase requires
that you type a space before andafter the division symbol (/).
6-155 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 319/395
DQL LEXICON
record entry
Keyword: record entry
Type: Control Command
Purpose: The record entry command tells DataBase to display the
Record Entry form for the specified database form.
Syntax:
Usage:
Example:
record entry FORMNAME
.
The record entry command allows records to be entered or
modified in the specified form at any point during a Control
procedure. You can enter as many records as you like, using
either Form View or Table View.
Unlike the input command, the record entry commandprovides all the functions available through the Record Entry
option on the Main Menu, including the ability to add, modify
and delete records.
When you finish entering records and press ESC, the Control
procedure resumes with the action following the record entry
command.
record entry CUSTOMERS .
run procedure PRINT INVOICES .
db status .
See Also: data entry, input
The record entry commandfunctions like selecting RecEntry (Option 2) on the MMenu and then selecting th
form you want to use fromRecords menu. For further
explanation, see Volume 1
Chapter 2, Record Entry.
This query tells DataEase: 1) Display the CUSTOMERS form so the
operator can enter new customer records. 2) When the operator finishes
entering records, run the PRINT INVOICES procedure. 3) After running
the procedure, display the status of the current database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 320/395
DATABASE REFERENCE MANUAL
Relational Statistical Operators
Keyword: Relational Statistical Operators
Type: Operator
Purpose: Relational Statistical Operators are used to generate statistical
information on the values in the specified field in a set of
records in a related form (i.e., a set of records that are related
to the record that is currently being processed, such as all the
invoices for an individual customer).
Syntax: relational statistical operator FORMNAME | RELATIONSHIP [named
UNIQUE RELATIONSHIP NAME ) [with (selection criteria)]
FIELDNAME ;
Usage: To generate statistics on a field in a related form:
1. Insert the Relational Statistical Operator followed by the nameof the related form or the name of the relationship.
2. Assign a unique name to the relationship if necessary using
the named operator.
3. Insert any desired selection criteria in parentheses.
4. Insert the field name followed by a semicolon or a period,
depending on the location of the statement in the query.
The Relational Statistical Operators are: count of, highest of,
lowest of, mean of, and sum of.
The count of operator counts the number of related records,
not field values. The field name is omitted at the end of the
count of statement.
The highest of and lowest of operators can be used on both
Text and Number fields, highest of returns the highest
ASCII field value in the set of related records, lowest of
returns the lowest ASCII field value.
The sum of and mean of operators are used on number fields.
sum of returns the total of the field values in the set of related
records, mean of returns the averaj-e of the field values in
the set of related records.
Each Relational Statistical Operator is treated as a separate
entry in this lexicon.
See Also: Conditional
Statistical Operators,
Statistical Operators
Relational Statistical
Operators
count of
highest of
lowest of
mean of
sum of
6-157 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 321/395
DQL LEXICON
Relationships
Keyword: Relationships
Type: Concept
Purpose: A Relationship is a link between two groups of records
whether in the same form or in two different forms. Whentwo groups of records are related, you can access information
in one group while processing records in the other group.
DataEase employs two types of relationships.
In a predefined relationship, the two groups of records are
related by a link entered on a Relationships form. The link
is created by specifying one or more fields that hold the same
information in both groups. Because this relationship is
stored in the database, it can be used in different procedures
whenever necessary.
An ad-hoc relationship is a relationship that is defined while
creating a query. Although an ad-hoc relationship can be
used like a predefined relationship to access information in
another group of records, the relationship isn't stored as a
part of the database. Therefore, it can only be used in the
procedure in which it is defined.
Usage: In a query, a value in a related form or group of records is
called a relationship value. A relationship value can be used
in a query wherever you can use a field, a constant value, or
a variable (such as in selection criteria, as a list item, or as a
value assigned to a temporary or global variable).
Once a relationship is established, the DQL Relational
Operators let you access and manipulate values in the related
form. For example, if the query is processing CUSTOMERSrecords, the statement:
sum of INVOICES ORDER total ;
sums the order total field for each related invoice (every
invoice with the same CUSTOMER # as the CUSTOMERSrecord that is currently being processed).
The use of each of the Relational Operators is covered in a
separate entry in this lexicon.
See Also: Ad-hoc
Relationship, all, any, countof, highest of, lowest of,
mean of, sum of
For more information on th
topic, see Define
Relationships in Volume 2
Chapter 2. Form Definition
and Relationships.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 322/395
DATAEASE REFERENCE MANUAL
reorganize
Keyword: reorganize
Type: Control Command
Purpose: The reorganize command reorganizes the specified form.
Syntax:
Usage:
LAN:
reorganize FORMNAME
Example:
The formname, which can be a constant or a variable, must be
enclosed in quotes.
When a form is reorganized, all records that have been
deleted since the last reorganization are permanently erased
and all indices used to organize the data in the form are
recreated.
If the form has become inconsistent (signalled by an error
message), the reorganize command reorganizes the records
in the form and returns the form to a consistent status.
On a LAN (Local Area Network), if another user is currently
using any resource required by the reorganize command,DataBase displays a Resource Conflict message. While this
message is displayed, DataBase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataBase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4, System Administration.
for more information on resource conflicts and Multi-User
Locking Options.
reorganize CUSTOMERS .
run report PRINT INVOICES .
This query tells DataBase: 1) Reorganize the CUSTOMBRS form.
2) When the reorganization is completed, run the PRINT INVOICESprocedure.
See Also: backup db. dbstatus, restore db
The reorganize commandfunctions like selecting
Reorganize a Form (Option
5) on the Form Definition
menu. For further explanation,
see Volume 2. Chapter 2,
Form Definition.
6-159 Voluine
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 323/395
DQL LEXICON
Report Format
Keyword: Report Format
Type: ConceptSee Also: Chapter 5 . RepoFormatting, in this manual.
Purpose: A Report Format tells DataBase how to physically lay out
the field values, statistics, titles, and other text generated by a
DQL Procedure. A report format consists of three elements:
Report Formatting Commands: Commands that tell DataBasehow to lay out the information generated by the procedure. Theeight Report Formatting Commands are: .header, .footer, .group header,
.items, .group trailer, .end, .page, and .call.
Form Text: Descriptive text such as the Report Title, Column Headers,
Page Numbers, Boundary Lines, etc. You enter Form Text in the formatdirectly where you want it to appear in the report output.
Fields: Locations where the field values from the records processed by
the procedure actually appear in the report output. To insert a field in a
report format, move the cursor to the position where you want the field
values to appear, press FIO FIELD, and then select the field from the
menu DataBase displays.
A sample report that indicates which elements in the output are controlled
by various Formatting commands is shown below. For complete
information on Report Formatting refer to Chapter 5 in this manual.
. header
.footer —
DOUN EAST COMPANYMonthly Report
October 1989
Marketing Departnent *-
Departnent Total
Grand Total
-» Page Z
- .group header
- . itens
.group trailer
- .end
Figure 6-2 — Sample Report Showing Formatting Commands
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 324/395
DATABASE REFERENCE MANUAL
restore db
Keyword: restore db (restore database)
Type:
Purpose:
Syntax:
Usage:
LAN:
Control Command
The restore db command recreates a database. Whenprocessing reaches a restore db command, DataBase displays
a series of prompts asking you to specify the drive on which
the database should be restored and how you want to handle
any errors that occur during the restore procedure.
Example:
restore db ,
When you backup a database using the backup db command,
DataBase copies the database using a special format. The
backup copy can only be used after it is restored using the
DataBase restore db command or Maintenance menu option.
When you backup and restore a database, all records that have
been deleted since the last backup and restore operation are
permanently erased.
On a LAN (Local Area Network), if another user is currently
using any resource required by the restore db command,
DataBase displays a Resource Conflict message. While this
message is displayed, DataBase automatically tries to execute
the command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataBase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4, System Administration.
for more information on resource conflicts and Multi-User
Locking Options.
record entry CUSTOMERS .
run procedure PRINT INVOICESbackup db .
restore db.
This query tells DataBase: 1) Display the CUSTOMBRS form so the
operator can enter new customer records. 2) When the operator finishes
entering records, run the PRINT INVOICES procedure. 3) Make a
backup copy of the current database. 4) When the backup procedure is
complete, begin the procedure to restore the database from the backup
copy.
See Also: backup db, dbstatus, reorganize
The restore db commandfunctions like selecting
Restore Database (Option 3)
on the Maintenance menu.For more information on the
database backup and restore
procedures, see Volume 1,
Chapter 4. DatabaseMaintenance.
6-161 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 325/395
DQL LEXICON
run procedure
Keyword: run procedure
Type: Control Command
Purpose: The run procedure command runs the specified procedure.
Syntax:
See Also: call menu, call
program
run procedure PROCEDURE NAME
Usage:
Example:
The run procedure command automatically loads and runs a
previously defined procedure. When the procedure is
finished, the Control Procedure automatically resumes with
the action following the run procedure command.
The procedure name can be a constant or any expression(including functions) that returns a text string.
record entry CUSTOMERS .
run procedure PRINT INVOICES .
db status .
The run procedure commanfunctions like selectini; RuProcedure (Option 1 ) on t
DQL or QBE - Quick Repormenu. For details see Chapt2, Defining, Modifying, an
Running Procedures in thi
manual.
This query tells DataBase: 1) Display the CUSTOMERS form so the
operator can enter new customer records. 2) When the operator finishes
entering records, run the PRINT INVOICES procedure. 3) Display the
status of the current database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 326/395
DATABASE REFERENCE MANUAL
I
seconds
Keyword: seconds
See Also: ampm. current.Type: Time Function hour, minutes, timeampm
Purpose: The seconds function extracts the seconds from a time value
expressed in 24-hour format.
Syntax: seconds(TIME VALUE)
Returns: An integer value from 00 to 59.
Examples: seconds(09:15:34)Returns: 34
seconds(02:53:20)Returns: 20
seconds(CHECK-ouT time)
Returns the seconds value in the checkout time field
for every record that is processed. If a recordcontains the value 07:30:25, the function returns 25.
6-163 Volumes
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 327/395
DQL LEXICON
Secondary Form
Keyword: Secondary Form
Type: Concept
Purpose: A form related to the Priman.' Form is cal led a Secondary
form.
Usage: One form can be related to another form by either a
predefined or an ad-hoc relationship. A form related to the
Primary Form is called a Secondary form. A form related to
a Secondary form is called a Tertiary form. etc. There can be
any number of such relationship levels (see Figure 6-3 below).
When processing the records in a form, the data in another
form can be accessed if a relationship exists between these
forms. A relational operator (all, any. count of. highest of.
lowest of. mean of. or sum of) is used to access the data in
the related form. The all operator cannot be used to access
records in more than one form on any relationship level (i.e..
no more than one Secondan,- form, one Tertiary form. etc.).
However, you can use the output command to access all
related records in more than one form on a particular
relationship level.
See Also: Ad-hocRelationship, all. output.
Primary Form, Relationships
Prinary Forn
Secondary Forn Secondary Forn
Tertiary Fern Tertiary Forn Tertiary Forn Tertiary Forn
Figure 6-3 - Forms and Relationship Levels
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 328/395
DATABASE REFERENCE MANUAL
Selection Criteria
Keyword: Selection Criteria
Type: Concept
Purpose: In a quer>', you can tell DataBase to selec t all the records in a
specified form, or only some of the records. The limiting
factors that determine which records are selected for
processing are called selection criteria.
The selection criteria tell DataBase to compare the value in the specified
field in each record to a comparison value that you specify in the query.
When the procedure is run, the records that meet the defined selection
criteria are processed. Records that do not meet the criteria are not
processed.
For example, the statement:
for CUSTOMERS with account balance > 500 ;
tells DataBase to process only the CUSTOMBRS records that have a value
greater than 500 in the ACCOUNT balance field.
There are two situations in which selection criteria must be enclosed in
parentheses:
Sec Also: and, or, with.
Comparison Operators
1 Criteria must be enclosed in parentheses when used with a
relational operator to select records based on the values stored in a
form other than the Primary form.
Example: for CUSTOMERS with (sum of INVOICES orderTOTAL > 500)
This statement tells DataBase to process only the CUSTOMBRS records
whose related INVOICBS have a combined ORDER TOTAL that is greater
than 500.
2. When two sets of selection criteria are combined with the and and
or operators, the criteria must be enclosed in parentheses to clarify
the meaning.
Example: for CUSTOMERS with (state = NY or state = NJ )
and account balance > 500 ;
This statement tells DataBase to process only the CUSTOMBRS who live
in either New York or New Jersey and who have an ACCOUNT balancethat is greater than 500.
6-165 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 329/395
DQL LEXICON
Sin
Keyword: sin
Type: Trigonometric Function
Purpose: The sin function calculates the sine of an angle expressed in
radians.
See Also: acos.asin.atan,
COS. cosh. sinh. tan. tanh
Syntax: sin(NUMERIC VALUE)
Returns: A numeric value.
Examples: sin(2.53)
Returns: 0.574172
sin(-3)
Returns: -0.14112
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 330/395
DATABASE REFERENCE MANUAL
sinh
Keyword: sinh (hyperbolic sine)
Type: Trigonometric Function
Purpose: The sinh function calculates the hyperbolic sine of an angle
expressed in radians.
See Also: acos, asin. atan,
cos, cosh, sin, tan, tanfi
Syntax: sinh(NUMERIC VALUE)
Returns: A numeric value.
Examples: sinh(2.53)Returns: 6.2369235
sinh(-4.4)
Returns: -40.71929
6-167 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 331/395
DQL LEXICON
Sorting
Sorting lets you process records and generate the resulting output in either
ascending or descending order based on the values in the specified field. ^^^ A/50; Grouping, in or
in reverseThe in order operator sorts records in sequence from least to greatest
value based on the type of field as follows:
• Text: alphabetical order ( A-Z)
• Number: least to greatest numerical value
• Date: earliest to latest date
• Time: earliest to latest time
• Choice: lowest to highest numbered choice
Example: for STATES :
list recordsSTATE NAME in Order
.
end
The output from this query might look as follows:
STATE NAME
AlabamaAlaskaArizona
Wyoming
The in reverse operator sorts records in greatest to least sequence.
For example, if we change the third line of the query to:
STATE NAME in reverse
The output is reversed:
STATE NAMEWyomingWisconsinWest Virginia
Alabama
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 332/395
DATABASE REFERENCE MANUAL
spellcurrency
Keyword:
Type:
Purpose:
spellcurrency
Spell Function
The spellcurrency function spells the monetary equivalent of
a numeric value.
Syntax:
Returns: A text value
Examples
spellcurrency(NUMERIC VALUE)
spellcurrency(36.25)Returns: Thirty Six Dollars and 25 Cents
spellcurrency(210.00)Returns: Two Hundred Ten Dollars and 00 Cents
spellcurrency(SALARY)Returns the spelled-out currency amount in the salaryfield for every record that is processed. If a recordcontains the value 605.75, the function returns SixHundred and Five Dollars and Seventy-Five Cents.
See Also: spelldate.
spellmonth. spellnumber,spellweekday
6-169 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 333/395
DQL LEXICON
spelldate
Keyword: spelldate
See Also: spellcurrency
.
Type: Spell Function spellmonth. spellnumber.spellweekday
Purpose: The spelldate function spells a date value in common form.
Syntax: spelldate(DATE VALUE)
Returns: A text value.
Examples: spelldate(07/01/89)Returns: July 1, 1989
spelldate( 12/31/89)
Returns: December 31, 1989
spelldate(highest of INVOICES date)Returns: The spelled-out value in the most recentinvoice's date field. If the most recent INVOICESrecord contains the value 10/31/89 in the date field,
the function returns October 31, 1989.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 334/395
DATABASE REFERENCE MANUAL
spellmonth
Keyword: spellmonth
Type: Spell Function
Purpose: The spellmonth function spells the name of the month that
corresponds to a numeric value from 1 (January) to 12
(December).
Syntax: spellmonth(NUMERIC VALUE)
See Also: spellcurrency.
spelldate. spellnumber,spellweekday
Returns: A text value.
Usage: The input value must be an integer between 1 and 12
(inclusive).
Examples: spellmonth(7)Returns: July
spellmonth(month(1 2/31/89)Returns: December
spellmonth(month(highest of INVOICES date))
Returns: The name of the month that corresponds to
the value in the most recent invoice's date field.
If the most recent INVOICES record contains thevalue 10/31/89 in the date field, the function
returns October.
6-171 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 335/395
DQL LEXICON
spellnumber
Keyword: spellnumber
Type: Spell Function
Purpose: The spellnumber function spells the integer portion of a
numeric value.
See Also: spellcurrency.
spelldate. spellmonth.
spellweekday
Syntax: spellnumber(NUMERIC VALUE)
Returns: A text value.
Usage: spellnumber accepts any number value up to 2,147.483.647.
spellnumber(999999999) returns Nine Hundred Ninety Nine.
Million, Nine Hundred Ninety Nine Thousand, Nine Hundred
Ninety Nine.
Examples: spellnumber(3.45)Returns: Three
spellnumber(323.45)Returns: Three Hundred Twenty Three
spellnumber(cusTOMER #)
Returns the spelled-out number in the customer #
field for every record that is processed. If
arecord
contains the value 309512, in the customer # field,
the function returns Three Hundred Nine ThousandFive Hundred Twelve.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 336/395
DATABASE REFERENCE MANUAL
spellweekday
Keyword: spellweekday
Type: Spell Function
Purpose: The spellweekday function spells the name of the day that
corresponds to a numeric value from 1 (Monday) to 7
(Sunday).
Syntax: spellweekday(NUMERIC VALUE)
See Also: spellcurrency.
spelldate. spellmonth,
spellnumber
Returns: A text value.
Examples: spellweekday(5)Returns: Friday
spellweekday(weekday(1 2/31/89)Returns: Sunday
spellweekday(weekday(highest of INVOICES date))
Returns: The name of the day that corresponds to the
value in the most recent invoice's date field.
If the most recent INVOICES record contains the
value 10/31/89 in the date field, the function
returns Tuesday.
6-173 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 337/395
DQL LEXICON
sqrt
Keyword: sqrt (square root)
Type: Scientific Function See Also exp. log. loglO.
powerPurpose: The sqrt function calculates the square root of a numeric
value.
Syntax: sqrt(NUMERIC VALUE)
Returns: A numeric value.
Usage: The sqrt function should only be used on a positive value. If
the input value is negative, the result is unpredictable.
Examples: sqrt(9)
Returns: 3
sqrt(16)Returns: 4
Sqrt(FLOOR SPACE)Returns the square root of the value in the floorSPACE field for every record that is processed. If arecord contains the value 16000 in the floor spacefield, the function returns 40.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 338/395
DATAEASE REFERENCE MANUAL
Statistical Operators
Keyword: Statistical Operators
Type: Operator
Purpose: Statistical Operators (shown at right) are used to generate
statistical information on number fields that appear as list
items in a query.
Syntax:
Usage:
FIELDNAME : statistical operator
To generate statistics on a field:
1. Insert the fieldname followed by a colon.
2. After the colon, insert the appropriatestatistical operators.
3. After the last operator, insert a semicolon or a period,
depending on the location of the operator in the query.
Statistical Operators can be used on any type of number
field (Dollar, Integer, Fixed Point, and Floating Point).
They cannot be used on Numeric String fields.
You may use as many operators as you want on a given field.
one after another, separating each by a space.
If you use any statistical operator and you want the field value
listed in addition to the statistical information, you must
include the item operator after the field name.
Each Statistical Operator is treated as a separate entry in this
Lexicon.
See Also: Conditional
Statistical Operators,
Relational Statistical
Operators
Statistical Operators
Item
maxmeanminstd.dev.
std.err.
sumvariance
6-175 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 339/395
DQL LEXICON
std.dev.
Keyword: std.dev. (standard deviation)
Type: Statistical Operator
Purpose: The std.dev. operator calculates the standard deviation (the
square root of the variance) in a set of data. The result
usually appears as a statistic in the summary area at the
end of a report.
See Also: item, max, mean,min, std.err.. sum. variance
Syntax: value : std.dev. [other statistical operators]
Returns: A numeric value.
Usage: Standard deviation is used as an indicator of variability in a
set of data (68% of the data set is contained in the first
standard deviation).
The std.dev. operator can also be used in Quick Reports. Togenerate the standard deviation in a Quick Report, type
std.dev. in the selected list field area.
Example: 500or CUSTOMERS with account balance >list recordslast name in order ;
ACCOUNT BALANCE ; item sum std.dev. .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the ACCOUNT BALANCE field. 2) List
the customers by LAST NAME in alphabetical order. 3) List each
customer's ACCOUNT balance amount, the sum of these amounts, and the
standard deviation in the report output.
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
AdamsCooperEvansHill
Ivers
$595.00$725.00$865.00$525.00$675.00
SUM ACCOUNT BALANCE $3,385.00STD.DEV. IN DATA SET $129.88
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 340/395
DATAEASE REFERENCE MANUAL
std.err.
Keyword: std.err.
Type: Statistical Operator
Purpose: The std.err. operator calculates the standard error (the
standard deviation divided by the square root of the number
of items) in a set of data. The result usually appears as a
statistic in the summary area at the end of a report.
See Also: item, max, mean,min, std.dev., sum, variance
Syntax: value : std.err. [other statistical operators]
Returns: A numeric value.
Usage: Standard error is used as an indicator of variability in a subset
of data; if the standard error of the mean of two data sets
overlap, the subsets may be considered to be members of the
same data set.
The std.err. operator can also be used in Quick Reports. To
generate the standard error in a Quick Report, type std.err. in
the selected list field area.
Example: for CUSTOMERS with account balance > 500 ;
list recordsLAST name in order
;
ACCOUNT balance I item sum std.dev. std.err. .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the ACCOUNT balance field. 2) List
the customers by last name in alphabetical order. 3) List each
customer's ACCOUNT balance and include the standard deviation,
standard error, and the sum of all the account balance amounts in the
report output. The output from this query might look as follows:
LAST NAME
AdamsCooperEvansHill
Ivers
ACCOUNT BALANCE
~$595T00$725.00$865.00$525.00$675.00
SUM ACCOUNT BALANCE $3,385.00STD.DEV. IN DATA SET $129.88STD.ERR. IN DATA SET $58.09
6-177 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 341/395
DQL LEXICON
sum
Keyword: sum
Type: Statistical Operator
Purpose: The sum operator adds the values in a specified field among
all the records that are processed.
Syntax: value : sum [other statistical operators]
See Also: item, max, mean,min, std.dev., std.err., varian
Returns: A numeric value
Usage: The value returned by the sum operator differs depending on
where it appears in the report format. The sum value is
defined by its position as follows:
Report Header: Not applicable
Header: Running total through the last item on
the previous page
Footer; Running total through the last item on
the current page
Items: Running total through the current item
Group Header: Not applicable
Group Trailer: Sub-total for group
End: Report grand total
for CUSTOMERS with ACCOUNT balance > 500 ;
list records
last name in order;
ACCOUNT balance item sum .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the ACCOUNT BALANCE field. 2) List
the customers by last name in alphabetical order. 3) List each
customer's ACCOUNT balance and include the sum of all the accountBALANCE amounts in the report output. The output from this query might
look as follows:
Example:
LAST NAME ACCOUNT BALANCE
AdamsCooperEvansHill
Ivers
$595.00$725.00$865.00$525.00$675.00
There's an important
difference hetv,een the
statistical operator sum anthe relational statistical
operator sum of.
sum returns the total of the
values in the specifiedfield
among the records being
processed, sum of returns
the total of the values in
the specified field among t
records related to the record
being processed.
SUM ACCOUNT BALANCE $3,385.00
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 342/395
DATAEASE REFERENCE MANUAL
sum of
Keyword: sum of
Type: Relational Statistical Operator
Purpose:
Syntax:
The sum of operator adds the values in a specified field in all
matching records in a related form. The result can appear as
a list item in the detail area of the report or as a statistic in the
summary area at the end of each group or the end of the
report.
sum of FORMNAME | RELATIONSHIP [named UNIQUERELATIONSHIP NAME ] [with (selection criteria)] FIELDNAME
;
See Also: all. any. count of.
highest of. lowest of, mean of,
named.
Returns: A numeric value.
Example: for CUSTOMERS ;
list recordsLAST NAME in order ;
sum of INVOICES order total .
end
This query tells DataBase: 1) FVocess all the CUSTOMERS records and
ist each customer's last name in alphabetical order. 2) For each
CUSTOMERS record processed, find all the related records in the
INVOICES form (those that have the same CUSTOMER #). 3) Lis t the sumof the ORDER total field for each customer in the set of matching
INVOICES records.
The output from this query might look as follows:
LAST NAME SUM OF INVOICES ORDER TOTAL
Adams $595.00Cooper $725.00Evans $865.00Hill $525.00Ivers $675.00
There's an important
difference between the
statistical operator sum andthe relational statistical
operator sum of.
sum returns the total of the
values in the specified field
among the records being
processed, sum of returns
the total of the values in the
specified field among the
records related to the records
being processed.
If you want to include the sum of this whole group of invoices, changethe
fourth line of the query to read:
sum of INVOICES order total : item sum .
6-179 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 343/395
DQL LEXICON
tan
Keyword: tan (tangent)
Type: Trigonometric Function
Purpose: The tan function calculates the tangent of an angle expressed
in radians.
See Also: acos, asin, atan,
cos, cosh, sin, sinh, tanh
Syntax: tan(NUMERIC VALUE)
Returns: A numeric value.
Examples: tan(2.53)
Returns: -0.701292
tan(-1.89)
Returns: -3.025665
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 344/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 345/395
DQL LEXICON
temp
Keyword: temp
Type: Keyword
Purpose: The keyword temp specifies a temporary variable.
Syntax:
See Also: assign, define,
global, variable
temp VARIABLE NAME
Usage: Tiie iceyword temp specifies a temporary variable.
A variable is used to store a value such as a text string or a
calculated result that can change during the processing of a
procedure. By specifying the variable's name, the stored
value can be used like any other value in a query.
The status of a variable can be global (denoted by the
keyword global) or temporary (denoted by the keyword
temp).
A temporary variable can only hold a value during the current
procedure.
A global variable can pass its value from one procedure to
another. To pass a value from one procedure to another, a
variable must be defined identically in each procedure.
Example: define temp DISCOUNT Number
.
for INVOICES with order total > 500 ;
assign temp DISCOUNT := (ORDER total * 0.15) .
modify recordsORDER total ;= (ORDER TOTAL - temp DISCOUNT) .
end
This query tells DataEase: 1) Create (define) a temporary variable called
DISCOUNT to store a number while processing the current query.
2) Give (assign) the DISCOUNT variable a number value determined by
multiplying the order total on each invoice by 15%. 3) Find all the
INVOICES records that have a value greater than $500 in the ORDERTOTAL field. 4) Modify these INVOICES records by subtracting the value
of the DISCOUNT variable from the value in the ORDER TOTAL field.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 346/395
DAT A EASE REFERENCE MANUAL
textpos
Keyword: textpos
Type: Text Function
Purpose: The textpos function returns the first position of a substring in
a specified text value.
See Also: firstcfirstlast,
firstw,jointext, lastc, lastfirst,
lastw, length, lower, midc,
midw, proper, upper
Syntax: textpos(TEXT value, substring)
Returns: An integer value that indicates the position where the
substring begins in the specified value.
Usage: The textpos function is not case sensitive (no distinction is
made between upper and lower case letters).
If the substring is contained in the specified text value, the
starting position of the first (leftmost) character in the
substring is returned.
If the substring is not contained in the text value, the function
returns 0. Intervening spaces and punctuation symbols are
included in the calculation. Trailing spaces are ignored.
Examples: textpos( DataEase , Ease )Returns: 5
textpos( DataEase International Inc. , national )Returns: 15
textpOS(BOOK TITLE, wi ),
Returns the first position of the string wi in everyrecord that is processed. If a record contains the
value Gone With The Wind in the book title field,
the function returns 6.
6-183 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 347/395
DQL LEXICON
timeampm
Keyword: timeampm
Type: Time Function
Purpose: The timeampm function converts a time value from a
24-hour format to a 1 2-hour format and appends the
appropriate AM or PM designation.
See Also: ampm, current,hours, minutes, seconds
Syntax: timeampm(TIME VALUE)
Returns: A text value representing the
of either AM or PM.
2-hour clock time with a suffix
Usage: Converts time values from midnight (00:00:00) to 1 1 :59:59 to
AM. Converts time values from noon (12:00:001 to 23:59:59
toPM.
Examples: timeampm(1 3:53:1 2)Returns 01:53:12 PM
timeampm(1 1:1 0:30)Returns: 11:10:30 AM
timeampm(CHECK-ouT time)
Returns the value in the checkout time field in the
12-hour clock format and adds the correct suffix for
every record that is processed. If a record containsthe value 19:30:25 in the check-out time field, thefunction returns 07:30:25 PM.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 348/395
DATAEASE REFERENCE MANUAL
Transaction Processing
Keyword: Transaction Processing
Type: Concept
Purpose: Transaction Processing is a technique that lets you enter.
modify, and delete records in multiple forms using input froma single form. A transaction processing procedure lets youupdate the information in the database without having to
physically enter the data into each form in record entry mode.Because it saves time and reduces the possibility of keying
errors, transaction processing is widely used for point-of-sale
applications to automate customer billing and inventory
maintenance.
Usage: With DataBase, each transaction is entered using theData-entry form or the input command. After the data is
entered, it is processed by a predefined DQL Procedure that
automatically posts the information into the appropriate
related forms.
The High Level Control procedure presented in Chapter 4 ofthis manual demonstrates the use of transaction processing in
a mail-order business that uses a special Order Entry form to
post information into several database forms (as shown below).
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 349/395
DQL LEXICON
unlock
Keyword: unlock
Type: Processing Command
Purpose: The unlock command is only functional when running
DataBase on a LAN (Local Area Network). The unlock
command unlocks locked forms or records allowing other
users full access to the data.
Syntax: unlock all files |file
| selected record
See Also: lock, lock db. qselection, unlock db
LAN:
The unlock all files command unlocks all forms referenced
by the procedure. If unlock all files is the first statement in
the query, the default locking rules are overridden and all datais locked by individual records. You may lock forms on a
selective basis using the lock file command.
The unlock file command unlocks the specified form for the
duration of the procedure, or until the same form is specified
in a lock command. In a query that begins with a lock all
files statement, the unlock file command lets you unlock
forms selectively, while the other forms referenced by the
query remain locked.
The unlock selected records command unlocks the recordthat is currently being processed. If the default locking rules
are overridden by an unlock all files or unlock file command,DataBase automatically locks a record from the time it is
selected for processing until the next record is selected.
Often, significant processing not involving the locked record
may take place. By using the lock and unlock selected
record commands, you can reduce the amount of time a
record remains locked.
On a LAN (Local Area Network), if another user is currently
using a resource required by the unlock command, DataBasedisplays a Resource Conflict message. While this message
is displayed, DataBase automatically tries to execute the
command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
-> This entry continues on the next page
The default LAN Multi-UserLocking Options entered
the System Configurationresolve conflicts that arise
when users attempt to view,
modify, or delete records
form at the same time the
is being accessed by a repo
queiy. For more information
see Volume 2. Chapter 4.
System Administration.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 350/395
DATABASE REFERENCE MANUAL
unlock (cont.)
LAN: When the required resource becomes available, DataEase
automatically resumes processing and executes the rest of the
procedure. See Volume 2, Chapter 4. System Administration.
for more information on resource conflicts and Multi-User
Locking Options.
Usage: The unlock command overrides the default query processing
locking rules assigned by the database administrator.
In order to override the default locking rules, the first
statement of the query must be either lock all files or unlock
all filesorms. If neither of these commands appears
at the start of the query, the default locking rules govern
LAN functioning until a lock or unlock command appears
in the query. All lock and unlock commands are
automatically terminated at the end of a query.
Example: lock form INVOICES shared .
for CUSTOMERS with (sum of INVOICESORDER TOTAL > 500) ;
lock selected record .
list recordsLAST NAME ;
ACCOUNT BALANCE .
unlock selected record .
end
for CUSTOMERS with (highest of INVOICESdated < 01/01/80) ;
delete recordsend
his query tell DataEase: 1) Lock the INVOICES form so other users can
iew records but cannot add, delete or modify INVOICES records during
he processing of this procedure. 2) Select all the CUSTOMERS records
whose related INVOICES records have a combined ORDER TOTAL greater
han $500. 3) Lock each record as it is selected for further processing.or each record selected, list the customer's last name and account
BALANCE. After each record is listed, unlock the record before continuing
o the next part of the query.
Locking the INVOICES form at the start of this procedure prevents other
sers from entering new records that might alter the sum of calculation.
Locking and unlocking each CUSTOMERS record as it is listed prevents
he ACCOUNT BALANCE information from being modified by another user.
-187 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 351/395
DQL LEXICON
unlock db
Keyword: unlock db (unlock database)
Type: Control Command
Purpose:
Syntax:
The unlock db command is only functional when running
DataBase on a LAN (Local Area Network). The unlock db
cancels the effect of the lock db command; it unlocks a
locked database.
unlock db .
See Also: lock, lock db, qselection, unlock
Returns: A confirmation message appears on the screen as soon as the
database is unlocked.
LAN: On a LAN (Local Area Network), if another user is currently
using a resource required by the unlock db command.
DataBase displays a Resource Conflict message. While this
message
is displayed. DataBase automatically tries to execute the
command at brief intervals. If you want to abort the
procedure during this time, you must reboot the computer.
When the required resource becomes available, DataBase
automatically resumes processing and executes the rest of
the procedure. See Volume 2. Chapter 4. SystemAdministration, for more information on resource conflicts
and Multi-User Locking Options.
Usage: Once a database is locked by the lock db command it remains
locked until an unlock db command is executed or until the
user who initiated the lock db command exits from DataBase.
Example: lock db .
record entry CUSTOMERS .
run procedure PRINT INVOICES .
unlock db .
This query tells DataBase: 1) Lock the current database. 2) Display the
CUSTOMBRS form so an operator can enter new customer records.
3) When the operator finishes entering records, run the PRINT INVOICBSprocedure. 4) Unlock the current database.
There's an important
dijference between the unlProcessing command andunlock db Control commanThe unlock Processing
command can he used to
unlock individual forms or
records during a Processing
procedure. The unlock dbcommand is used to cancel
effect of the lock db Control
command; it unlocks the
whole database.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 352/395
DATABASE REFERENCE MANUAL
upper
Keyword: upper
Type: Text Function
Purpose: The upper function converts each letter in a text value to
uppercase.
Syntax: upper(TEXT VALUE)
See Also: firstc.firstlast.
firstw.jointext. lastc. lastfirst,
lastw. length, lower, midc,
midw. textpos.
Returns: The specified text value with all the let ters in uppercase.
The upper function only affects the alphabetical letters A-Z.
Numeric values are noi converted to the ir Shift key
equivalents.
Examples: upper( DataEase )Returns: DATABASE
upper( Washington D.C. )
Returns: WASHINGTON D.C.
Upper(LAST NAME)Returns the value in the last name field in uppercasetype for every record that is processed. If a recordcontains the value holmes in the last name field, thefunction returns HOLMES.
6-189 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 353/395
DQL LEXICON
value
Keyword: value See Also: case, others
Type:
Purpose:
Syntax:
Usage:
Keyword
The value keyword is a component of the case commandsyntax. When processing a case command, DataBase
compares the expression that follows case to each of the
statements specified by the keyword value in the order these
appear in the query. When DataBase reaches the first true
comparison, it executes all the actions between that value
statement and the next.
If none of the specified value comparisons are true, DataBase
executes the actions specified after the keyword others. Assoon as the actions following any value or others statement
are executed, processing passes to the first action following
the end command for the case statement.
case (EXPRESSION)value COMPARISON 1 :
ACTION SERIES1.
[value COMPARISON 2 :
ACTION SERIES 2.1
[value COMPARISON N :
ACTION SERIES N][others :
OTHERS ACTION SERIES.]
end
Example:
The case command requires a case expression, one
comparison value, and an end command. Subsequent value
statements, actions, and the others keyword are optional. If
others is used, it must follow all the specified comparison
values.
case (current user name)value FRANK :
call menu ADMINISTRATION .
others :
call menu MAIN .
end
This query tells DataBase: If the current user is Frank, display the
Administration menu. If the current user is anyone other than Frank,
display the Main Menu.
The keyword value is
automatically inserted after
the case expression is
specified in High Level
Interactive Mode.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 354/395
DATABASE REFERENCE MANUAL
variance
Keyword: variance
Type:
Purpose:
Statistical Operator
The variance operator calculates the average of the squared
deviations from the mean (the average of the squared
difference between each item value and the mean value) in a
set of data. The result usually appears as a statistic in the
summary area at the end of each group or the end of the
report.
See Also: item, max, mean,mitt, std.dev., std.err.. sum
Syntax: VALUE : variance [other statistical operators]
Returns: A numeric value.
Usage: Variance is used as an indicator of variability in a set of data.
The variance operator can also be used in Quick Reports. Togenerate the variance in a Quick Report, type variance in the
selected list field area.
Example: for CUSTOMERS with account balance > 500;
list recordsLAST NAME in order
;
ACCOUNT BALANCE : item mean sum variance .
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the account balance field. 2) Lis t the
customers by last name in alphabetical order. 3) List each customer's
ACCOUNT balance and include the mean, sum, and variance of all the
account balance amounts in the report output.
The output from this query might look as follows:
LAST NAME ACCOUNT BALANCE
AdamsCooper
EvansHill
Ivers
$595.00$725.00
$865.00$525.00$675.00
MEAN ACCOUNT BALANCE $677.00SUM ACCOUNT BALANCE $3,385.00VARIANCE IN DATA SET $16,870.00
6-19 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 355/395
DQL LEXICON
variable
Keyword: variable
Type: Concept
Purpose: A variable is a substitute for another value.
In a query, a variable can be substituted for any expression
that returns a value or for any type of field except a Choice
field. Often a variable is used to store a numeric value that
can change during the processing of a procedure (like a
running total when adding a column of figures). The stored
value can be used like any other value in the query; it is
referenced by the variable's name.
Usage: The define command is used to create and name a variable.
The name of a variable can be any unique name you like, up
to 20 characters in length. The name must be enclosed in
quotes when it first appears in the define command.
The assign command is used to give a variable an initial
value. A variable can be assigned to hold any type of value
except a Choice field value.
The status of a variable is either current, global or temporary.
1 The current system variables are built-in variables that hold
commonly used system values such as current date, current
time, current user name, etc.
2. A global variable can pass its value from one procedure to
another. In order to do this, the variable must be defined
identically in each procedure in which it is used.
3. A temporary variable can only store a value during a single
procedure.
There is a separate entry in this lexicon for each of these
groups.
See Also: assign, current,
define, global, temp
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 356/395
DAT A EASE REFERENCE MANUAL
weekday
Keyword:
Type:
Purpose:
weekday
Date Function
The weekday function converts a date value to an integer that
corresponds to the day of the week from 1 (Monday) to 7
(Sunday).
See Also: current, date. day.
Julian, month, spelldate.
spellmonth. spellweekday,
year, yearday. yeanveek
weekday(DATE VALUE)yntax:
Returns: An integer value from 1 to 7.
Examples: weekday(l 2/31/89)
Returns: 7
spellweekday(weekday(1 2/31 /89))
Returns: Sunday
weekday(DATE)Converts the value in the date field into an integer
from 1 to 7 for every record that is processed. If a
record contains the value 10/31/89 (a Tuesday),
the function returns 2.
6-193 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 357/395
DQL LEXICON
while
Keyword: while
Type: Procedural Command
Purpose: Like the if command, the while command executes a ser ies of
actions based on whether a specified condition is true. Unlike
the if command, the while command creates a processing loop
in which actions are executed repeatedly as long as the
specified condition remains true.
When processing reaches a while command. DataBase
evaluates the condition that follows the keyword while.
If the specified condition is true. DataBase executes all the
actions that follow the keyword do until it reaches the
corresponding end command.
DataBase then reevalutes the original condition. If the
condition is still true, DataBase executes the do action series
again. If the condition is false, processing passes to the first
action foUowine the end command for the while statement.
See Also: case, for, if
Syntax: while CONDITION do
ACTION 1
ACTION 2
ACTION Nend
Usage: Brequently, a while command specifies an initial condition
that is modified during each pass through the loop (i.e., a
counter). Any action that modifies the value to be
reevaluated must be included in the loop (i.e., it must
precede the end command that terminates the loop.)
—> This entry continue on the next page
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 358/395
DATAEASE REFERENCE MANUAL
while (cont.)
Example: define temp SERIAL Numberassign temp SERIAL :=
while temp SERIAL < 1000 dotemp SERIAL := temp SERIAL + 1
list recordsjointext ( SYSTEM DISK , temp SERIAL) .
end
This query tells DataEase: 1) Create (define) a temporary variable called
SERIAL. 2) Give (assign) an initial value of to the SERIAL variable.
3) Print a series of labels joining the words SYSTEM DISK to the numberhat is the current value of the SERIAL variable. 4) While printing the
abels, increment the variable by one each time a new label is printed.
5) When the value of the variable reaches 1000, stop printing labels.
The while command tells DataEase to reevaluate the value of the variable
each time it prints a label. As long as that value is less than 1000,
DataEase prints another label. When the value of the variable reaches
1000, DataEase stops performing the action following the do keyword.
6-195 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 359/395
DQL LEXICON
with
Keyword: with
Type: Operator
Purpose: The with operator specifies the criteria for selecting records in
a form or a relationship.
Syntax:
Usage:
with (SELECTION CRITERIA)
The with operator tells DataBase to process some rather than
all the records in the specified form. The records that are
selected for processing are those that satisfy the selection
criteria that follow the with operator.
Example 1: for CUSTOMERS with account balance > 500 ;
This statement tells DataBase: Process only those CUSTOMERS records
that contain a value greater than $500 in the ACCOUNT balance field.
Example 2: delete records in INVOICES named OUTDATEDwith (DATE < 01/01/80) .
This statement tells DataBase: Delete the records in the OUTDATEDrelationship (the INVOICES records that are dated before 01/01/1980).
See Also: and, or, Selection
Criteria
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 360/395
DATABASE REFERENCE MANUAL
year
Keyword: vear
Type: Date Function
Purpose: The year function extracts the year from a date value.
Syntax:
See Also: current, dale, day,
Julian, month, spelldate,spellmonth, spellweekday,
yearday, yearweek
year(DATE VALUE)
Returns: An integer value from to 99 (inclusive). The date format
selected in System Administration changes the date sequence
but does not affect which value is returned by a Date function.
Examples: year( 12/31/89)Returns: 89 (North American Format)
year(31/12/89)Returns: 89 (European Format)
year(89/12/31)Returns: 89 (Metric Format)
year(DATE)Converts the year portion of the value in the date field
into an integer from to 99 for every record that is
processed. If a record contains the value 12/31/89 in
the DATE field, the function returns 89.
-197 Volume 3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 361/395
DQL LEXICON
yearday
Keyword: yearday
Type: Date Function
Purpose: The yearday function converts a date value to the Julian day
of the year (1-366).
See Also: current, date,
Julian, month, spelldate,spellmonth, spellweekday,
year, yearweek
Syntax: yearday(DATE VALUE)
Returns: An integer value from 1 to 366 (inclusive). The date format
selected in System Administration changes the date sequence
but does not affect which value is returned by a Date function.
Examples: yearday(1 2/31/89)Returns: 365 (North American Format)
yearday(31/12/89)Returns: 365 (European Format)
yearday(89/l2/31)Returns: 365 (Metric Format)
yearday(DATE)Converts the day portion of the value in the date field
into an integer from 1 to 366, representing the Julian
date, for every record that is processed. If a record
contains the value 12/31/88 (A Leap Year) in theDATE field, the function returns 366.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 362/395
DATABASE REFERENCE MANUAL
yearweek
Keyword: yearweek
ype: Date Function
Purpose: The yearweek function calculates the week number (1-53) of
a date value.
See Also: current, date, day,
Julian, month, spelldate,
spellmonth, spellweekday,year, yearday
yntax: yearweek(DATE VALUE)
Returns: An interger value from 1 to 53 (inclusive). The date format
selected in System Administration changes the date sequence
but does not affect which value is returned by a Date function.
Usage: This yearweek function always counts January 1st -7th as
Week1, January 8th- 14th as Week 2. etc. In a non-Leap
Year, the only day in Week 53 is December 31st. In a Leap
Year, December 30th is also counted in Week 53 (all dates
following February 28 are affected by leap year.)
Examples: yearweek(0 1/0 1/89)
Returns: 1
yearweek( 12/30/89)Returns: 52 (North American Format)
yearweek(30/1 2/89)Returns: 52 (European Format)
yearweek(89/1 2/30)
Returns: 52 (Metric Format)
yearweek(DATE)Converts the day portion of the value in the date field
into an integer from 1 to 53, representing the week of
the year, for every record that is processed. If arecord contains the value 12/30/87 (A Leap Year) in
the date field, the function returns 53.
6-199 Volume
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 363/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 364/395
DATABASE REFERENCE MANUAL
INDEXntries in this index are referenced hy the volumeumber followed hy the page numher(s). Forxample, the entry:
Database Status 1:4-2, 1:4-4- 1:4-6.3:6-57
means you can find information on database status in
Volume 1 on page 4-2 and pages 4-4 through 4-6 andVolume 3 on page 6-57.
ntries that contain the letters IG indicate that
nformation on that topic can also he found in the
stallation and New Features Guide.
multiplication sign
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 365/395
INDEX
cache buffer
effect on performance
optimum size
calculate
3:4-14-3:4-15,3:6-38
2:A-2
2:D-3
2:A-2
2:2-64, 2:2-73
2:3-3,3:6-35
3:6-36 - 3:6-37
2:3-12
3:6-39,3:6-190
3:6-40
2:3-3,2:3-8.2:3-29
2:5-4. 2:5-57
1:1-3
2:2-52
call menucall program
calling menucase
ceil
Chain menuChange the Database Namechapter narrative sections
chapter reference sections 1:1-3
characters per inch 2:4-33
Check Data Disk 1:4-27
ChoiceField Type
Choice Description
Choice field
advantages
changing choice order 2:2-102-
choice 1:, choice 2: etc.
choice numbersduring field definition
during Import
during Record Entryl :2-5. 1 :2-34 - 1 :2-35
entering choice valuesin report ordering
limitations
modify 2:2-55.2:2-102-
2:2-55
2:3-9
2:2-52 - 2:2-55
2:2-54
2:2-104
3:5-12.
3:5-9.
modifying choice values 2:2-102-
optional choice type nameselecting a choice 2:2-52
Columnar format 1 :3-4. 1 :3-28. 1 :3-35
3:5-4-3:5-5,3:5-8
group headers and trailers
line length
spacing
statistics
commandslist
restrictions
types
commentscomparison operators
< (less than)
<= (less than or equal to)
2-55
2-55
2-52
5-14
2-53
2-552-55
2-53
2:2-104
2:2-104
2:2-54
-2:2-53
- 1:3-36
-3:5-11
1:3-36
1:3-36
3:5-8
3:5-12
3:4-1
3:4-1
3:4-1
3:4-1
3:6-17,3:6-41
3:3-5,3:6-15,3:6-42
3:6-15
3:6-15
= (equal)
as a record selection operator
> (greater than)
>= (greater than or equal to)
between
not
compatibility with version 2. 1
conditional processing 3:1-3, 3:6-62 -
3:6-194-3:6-19
conditional statistical operators 3:6-43 -
count
item
percent
configuration
See Define Configuration, System Configurati
constant value
context-sensitive help
control commandsbackup dbcall menucall program
db status
import
install appl
lock dbrecord entry
reorganize
restore db
run procedureunlock db
control procedure
3:3-5.
3:4-1.3:6
3:6-36-3:6-
3:6-113-3:6-11
2:3-3.3:1-3.3:4-1.
3:4-21 -3:4-24,3:6-4
High level example
control strings
convert an application 2:5-37, 2:5-46
conversion procedure
dBASE 2:5-37. 2:5-46
files converted
installing a converted application
Lotus1-2-3
2:5-37.2:5-46Lotus Symphony 2:5-37, 2:5-46
messages displayed during conversion
Paradox 2:5-37. 2:5-46
performing the conversion
selecting Lotus ranges to convert
selecting the files to convert
specifying the source directory
converting a Quick Report to a
DQL Procedure 1:3-50
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 366/395
DATABASE REFERENCE MANUAL
opy block
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 367/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 368/395
DATABASE REFERENCE MANUAL
grouping
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 369/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 370/395
DATAEASE REFERENCE MANUAL
processing commands
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 371/395
INDEX
exception files
during Import
exit
EXIT menuin Form Definition
in Record Entry
expexpanded memory
effect on performance
use of
Export
Export formats
DIEFixed Length ASCIIGrafTalk
Lotus 1-2-3
MailMerge
MultiMateVariable Length ASCIIWordPerfect
exporting data
extended character set
external program calls
field
2:2-100
2:5-16
3:6-67
2:2-17 - 2
1:2-17- 1
3
2-18
2-18
6-68
2:A-3, 2:D-3
1:1-7. 2:A-3
1:3-4
1:3-28,3:5-5.3:5-27
3:5-27, 3:5-39
3:5-38
3:5-33-3:5-34
3:5-27, 3:5-35
3:5-27
3:5-27.3:5-303:5-36-3:5-37
3:5-27,3:5-31 -3:5-32
3:5-27
2:2-26
2:A-3
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 372/395
DATABASE REFERENCE MANUAL
Field Per Line tornia
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 373/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 374/395
DATABASE REFERENCE MANUAL
reater than or equal to
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 375/395
INDEX
inconsistent form
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 376/395
DATABASE REFERENCE MANUAL
oad Procedure
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 377/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 378/395
DATABASE REFERENCE MANUAL
2:2-45
naming conventions
for forms 2:2-14
nested actions 3:4-6,3:6-134
not 3:6-135
null value 3:6-33
NUMLOCK key 1:1-16
Numbercurrent page
Field Type
Number field
compared to Numeric String
digits of precision
during Import 2:5-14,
Fixed Point
Floating Point
in Record Entry
Integer
modify
system provided characters
numeric keypad
description of
Numeric String
Field Type 2:2-43 - 2:2-44
formatted 2:2-43 - 2:2-44
other format 2:2-44
phone no. 2:2-43
soc. sec. no. 2:2-43
special punctuation 2:2-44
Numeric String field 2:2-43 - 2:2-44. 2:2-46
comparedto
Numberfield 2:2-46
during import 2:5-14
in calculations 2:2-44
in Record Entry 1:2-32 - 1 :2-33
modify 2:2-97
3
2
2
2
2:
2:5-26 - 2
2:
2
1
2
2
2
6-52
2-45
2-46
2-46
2-45
5-27
2-45
2-45
2-34
2-45
2-97
2-45
1:1-16
One-time Import
operators
assignment
boolean
comparisongrouping 3:6-81
logical
relational
sorting
optional choice type nameoptional relationship names
or
2:5-6
3:6-42-3:6-44,3:6-136
3:6-14
3:6-25
3:6-173:6-92
3:6-25
3:6-26
3:6-94
2:2-54
:2-109.
:2-129
:6-i37
3:6-15-3:6-82.3:6-91 -
3:6-22.
3:6-93 -
2:2-105.2
2:2-127 - 2:
3:^
as a record selection operator
order
ordering
in Quick Reports
others
output
1:3-3.
3:6-
3:6-38,3
3:5-1.3:5-40,3
139-3:6-143,3
1:3-13
1:3-20
1:3-20
:6-138
5-59,
:6-l60
See also Define Format
page break
page dimensions
page length
page numbering in a report
page size
page width
parameter substitution
paritypassword
paste text
percent
performance factors
periods
permanent relationships
port numberwhen defining configuration
power
predefined format
Predefined Relationship
presentvalue
Prevent Data-entry field 2:2-5. 2:2
in Record Entry
modify
primary form
3:5-53. 3:5-69
3:5-70.3:5-76
3:5-76
3:6-52
3:5-69
3:5-76
2:3-23 - 2:3-24
2:4-19
1:1-8- 1:1-9
2:2-21
3:6-144
2:D-1 -2:D-33:6-145
2:2-10
1:2-42- 1
3:3-3-3:3-
print form definition
example
Print Procedure Definition
Print Report Definition
an example
in Quick Reportsprint style specification
CPI spacing
default margin settings
default typestyle settings
disk 1:3-4,1:3-39,1:
examples
highlights
in Quick Reports
2:4-17
3:6-146
3:5-2
2:2-10.2:2-109
3:6-147
-35.2:2-70-2:2-71
1:2-5. 1:2-40
2:2-100
:2-44, 1:3-8. 1:3-22
4,3:6-148.3:6-164
2:2-86-2:2-87
2:2-87
3:2-4. 3:2-27
1:3-2. 1:3-5- 1:3-6
1:3-49
1:3-48
3:5-1.3:5-70-3:5-82
3:5-78
3:5-77
3:5-78
3-41,3:5-73.3:5-82
3:5-80 - 3:5-82
3:5-78
1:3-4
XV
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 379/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 380/395
DATABASE REFERENCE MANUAL
otected mode
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 381/395
INDEX
specifying ranges as
selection criteria
Text fields
wild card characters
See also selection criteria
record selection locking rules
lock files
lock nothing
lock records
record separator character
recovering a deleted field
recovering deleted records
1:3-13 1:3-15
1:3-12
1:3-12
1:2-79
1:2-77, 1:2-79
:2-77- 1:2-78
2:5-22
2:2-95
1:2-9
2:2-110.2:2-116-2:2-126
1:2-78
1:2-44, 1:3-22
1:3-17
1:2-42
1:1-4
referential integrity
refresh
related form
in Quick Reports
relational database
definition
relational database management system
definition ''
^
Relational Operators 3:3-9 - 3:3-10. 3:4-1 1. 3:4-20
all3:6-22
any3:6-26
in Derivation Formulas 2:2-68
named 3:6-132-3:6-133
relational statistical operators 3:6-157
count of3:6-51
highest of 3:6-84
lowest of 3:6-118
mean of 3:6-121
sum of 3:6-179
relationship concepts _.--iu^
relationship form names 2:2-1 12
relationships3:6-158
active 1:2-45.2:2-111
ad-hoc 2:2-10.2:2-109,3:4-12,
3:6-20-3:6-21.3:6-158
advantages 2:2-109
between forms 2:2-10
definition 2:2-10.2:2-109delete a relationship -— - 1 30
0-'> 1 1 7form names _._-ii-
in a lookup formula 2:2-65
levels3:6-164
many-to-one -'' '
Match fields 2:2-113-2:2-115
modify a relationship 2:2-130TO. 109name -- ' ^
one-to-many 3:3-1
optional relationship names
permanent
predefined 2:2-10,2:2
relationship levels
specifying form names
the Relationships form
using more than three Match fields
view a relationship
Relationships form
Remove the Database
renaming a database
reorganize
reorganize a form
2:2-127
•-).
LAN considerations
procedure
when to reorganize
replace a field
report data locking rules
exclusive
shared
report definition file
DOS filename extension
report destination
report field definition
report formats 3:5-
active function keys
Columnar 1:3-4,1:3-28.
CustomExport
Formatting CommandsField Per Line
GrafTalk Chart
long:text fields
Mailing Labels
Record Entry
system defined
Template
See also Format
Report Formatting Commands
See also Formatting Commands
report margins
REPORT menuin Record Entry
report ordering
for Choice fields
report output
report spacing
2:2
2
109,3:6-1
3:
2:
2:
2:2
2:5-4.
2:5-4,
3
1:2-70,2:2-10-2:2-11.
2:2-132-2:2-133.2:2-138
2
2
2
1:2-81
1:3-52-
3:5-70-3:5-
3:5-6.3:5-42.3:6-160
1:3-35-1:3
1:3-4.
1:3-4,
1:3-27,1:3
1:3-4,1
1:3-4,1
1:3-4,
1:3-4,1
1:3-4,
1:3-27,3:5
3:5-49,3:
1:2-17,
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 382/395
DATAEASE REFERENCE MANUAL
port statistics
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 383/395
user restrictions
when changing a database name
when defining menus
when defining users
when removing a Database
2:3-7
2:5-4
2:3-6
2:4-8
2:5-4
selection criteria
sequence
sequenced fields
serial printer port
a note about serial pnnters
additional questions
baud rate
parity
protocol
stop bits
word lengthSign On screen
signing on
sin
sinh
sort memorysorting
sorting and grouping operators
Soundex search
source form
special 1
special 2
special effects
special 1
special 2
specifying ranges as selection criteria
examples
spell functions
spellcurrency
spelldate
spellmonth
spellnumber
spellweekday
spellcurrency
spelldate
spellmonth
spellnumber
spellweekday
sqrt
standard deviation
standard error
Start New Procedure
Start New Report
3-3-2. 3:3-4. 3:3-11.
3:6-165.3.6-196
2-2-64. 2:2-66
1:2-82
9-4-19-2:4-21
2:4-20
2:4-19
2:4-19
2:4-19
2:4-19
2.4-19
2:4-19
1:1-7
1:1-7
3:6-166
3:6-167
2:A-4
3-6-94. 3:6-168
3:3-7
l-->-8.1:2-58-1:2-60
9-5.3 ^-5-10.2:5-13.2:5-17.2:5-32-^ ^- - -
2:4-34
2:4-34
2:4-342:4-34
2:4-34
1:3-14
3:6-169
3:6-170
3:6-171
3:6-172
3:6-173
3:6-169
3:6-170
3:6-171
3:6-172
3:6-173
3:6-174
3:6-176
3:6-177
3:2-3. 3:2-6
1:3-3.1:3-10.3:4-1
starting DataBase
command line options
Start-up menu
statistical operators
item
max
meanminstd.dev.
std.err.
sumvariance
statistics
in procedures
in Quick Reports
status
as a function type
Status reportFormsImport Specifications
Procedures
std.dev.
in Quick Reports
See also standard deviation
std.err.
in Quick Reports
See also standard error
stop bits
SubformAutomatic Form
Automatic Table
Custom Form
modify
Subform Definition screen
sumin Quick Reports
sum of 3:3-10.3:4-
summary report
suppress zero padding
in Numeric Strings
syntax scan
Svstem Administration
Define Configuration
7.1:1
IG.
9-3- ' 2:3-5.2:4-12
3:6
3-6-101-3:6-102
3:6
3:6
3:6
3:
3:
3:
3
3
1:3-20-1:3-2
1-4-4.1:4-7-1:4-101-4^,1:4-12-1:4-13
1:4-4.1:
1:3-3.3:6-
1:3-3.3:6
2:2-9. 2:2-27
Define Printers
Define Screen Styles
Define Users 2:4-7
System Configuration screen
2-2-27
1:3-3.
1 V4-13. 3:4-20.
7-9-46
1:1
4-14 2:4-16
2.4-35
2:4-32
2:4-37
-2:4-8.2:4-11
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 384/395
DATABASE REFERENCE MANUAL
ystem t'omis 1:2-
Configuration
Dictionary
DOS filenames
in Record Entry
MenusPrinters
Relationships
Screen Styles
status
Users
ystem menusaccess from a custom menu
TABLE menuin Record Entry
able Viewcursor movement keys
of records in a file
n
nh
rget form
emp 3
emplate format 1 :3-4.
emporary variable
rtiary form
ext
delete
Field Typeext field
during Import
in Record Entry
maximum length
modify
multiple line
valid data
xt functions
firstc
first last
firstw
jointext
lastc
lastfirst
lastw
length
lower
midc
- 1:2-2, 1:2-14, 1:4-8,
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 385/395
INDEX
3:6-186-3:6-187
1:4-3. 1:4-33
3:6-188
2:3-26
2:5-13
IG, 1:1-1,2:1-1
3:6-189
;:2-35. 2:2-72 - 2:2-74
2:2-74
2:2-100
2:2-74
2:2-73
2:2-73
unlock
unlock database
unlock db
as a function type
update matching
upgrade information
upper
Upper Limit 2:2-6.
formula syntax
modify
using constants in formulas
using Lookup for limits
valid formulas
Upper/Lower Limit field
entering valid data
in Record Entry 1 :2-6.
user file encryption
Users formmodify
view
user menuas a function type 2:3
user nameuser password
limitations
when changing the database namewhen removing a database
user-defined forms
status reportutilities
as a function type 2:3-20
2-38
2-38
4-26
2-762:4-6
2:4-6
2:3-3,2:3-12-2:3-13
1:1-8- 1:1-9
2:4-7
2:5-57
2:5-58
1:2-1
1:4-7. 1:4-10
value 3:6-38,
Variable Length ASCII export format 3:5-36 -
variables 3:4-8.
assign commandcurrent
define
global 3:4-8, 3:6-80, 3
temporary 3:4-8,3:6-182,3
variance 3
in Quick Reports
view a form
View Security 1:2-41, 2:2-6. 2:2-35. 2:2-75 -
viewing a field definition 2:2-7.
Viewing Imports
viewing records 1:2-7. 1:2-51 -
:6-190
3:5-37
:6-192
3:6-28
3:6-52
3:6-59
6-192
6-192
6-191
1:3-21
2:2-9
2:2-76
2:2-95
2:5-30
2-52
by record number
displaying a table of records in a file
in indexed order 1 :2-8,
in order saved 1:2-22,1:2-51-
in related forms 1 :2-8. 1 :2-25,
1:2-42-
in reverse order 1 :2-23,
searching for a particular record 1 :2-53
searching in unchecked modeusing ad-hoc multiforms
view last record
viewing a particular number record
virtual field 2:2-70 -2:2-71. 2:2-99 -
weekdaywhile
wild card character*
for an indexed search
search limitations
wild card search
window menuwith
word length
WordPerfect
export format
work area
Write Security
year
yearday
yearweek
Yes or No
Field TypeYes or No field
as a Choice field
in Record Entry
valid entries
w
3:6-62.3:6-194-3:6-195
1:2-7, 1:2-57.
1:2-57. 1:2-62.
1:2-57.
1:2-57,
1:2-57
1:2-7,1
3:3-4,3:4-3,3:4-19,3:6-196
3:5-31
2:2-6,2:2
2:2-75-2:2-76,
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 386/395
DATAEASE REFERENCE MANUAL
Addendum
e following pages contain additional documentation for subjectsvered in Volume 3 of the DataBase Reference Manual. Eachject covered in this addendum references the related chapter in
first paragraph and employs the same stylistic conventions as
chapter.
Addendum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 387/395
DEFINE FORMAT/PRINT STYLE: DESIGNING REPORT OUTPUT
Addendum - CrossView Format
DataEase 4.0 includes a ninth output format for use with
DataBase's new business analysis product, CrossView.
This addendum describes the CrossView format. For moreinformation on using DQL formats, see Chapter 5, Define
Format/ Print Style, in Volume 3 of the DataEase Reference
Manual. For more information on using CrossView, see the
CrossView Tutorial and Reference Manual.
The CrossView format is the last choice on the Formats menu,which is accessed through the Define Format option of the DQLmenu. The CrossView format lets you easily gather information
stored in DataEase and apply the multidimensional analytical powerof DataEase CrossView to it. To use this format, the DataEase and
CrossView program files must be installed in separate directories,
and both programs must be located in the DOS PATH.
The CrossView format automatically sends data generated by a
Quick Report or DQL Procedure to CrossView, so you can analyze
that data on the CrossView Display Screen. For example, suppose
you've defined a DQL Procedure that lists each customer's full
NAME, ACCOUNT BALANCE. ADDRESS, CITY, STATE, and ZIP CODE. Thequery looks like this:
Query
for CUSTOMERS ;
list records
FULL NAME ;
ADDRESS ;
CITY :
STATE ;
ZIP ;
ACCOUNT BALANCE
.
end
CrossView lets you quickly analyze data from different
perspectives without rerunning the report. Assume you want to
group and analyze these statistics by account balance, city.
STATE, or ZIP CODE. Instead of defining a new query using the
DQL grouping commands, you can send the data generated by this
procedure directly to CrossView and use its page and hyperpagedimensions to group and display the data for detailed analysis.
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 388/395
DATABASE REFERENCE MANUAL
Addendum - CrossView Format (cont.)
When you select the CrossView format, DataEase produces an
utput format that includes a .call command to invoke CrossView.
A sample format for the preceding procedure is shown below:
Format
tems
endall prexvu %mhe transformation is performed by a special CrossView program
amed PREXVU (the program specified in the .call command one last line of the format). If you edit the DataEase format, do not
hange this line. The %mparameter creates a temporary filename
r the output and passes this name to PREXVU. This temporarye is automatically erased when the data is transformed
When CrossView is invoked, DataEase temporarily relinquishes
ntrol to CrossView and the output is automatically transformed
to CrossView format. You can then use CrossView to analyze
e DataEase output just like any other CrossView data file.
When you press ESC to exit CrossView, you are automatically
turned to DataEase.
Addendum
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 389/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 390/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 391/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 392/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 393/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 394/395
8/10/2019 DataEase Reference Manual
http://slidepdf.com/reader/full/dataease-reference-manual 395/395