Chapter 1 - An Introduction To Synon/2E Data Modeling: Objectives
Chapter 1 - An Introduction To Synon/2E Data Modeling: Objectives
Objectives:
This chapter will introduce you to the details of Synon Data Modeling Concepts:
This is the Synon/2E Edit Database Relations Panel used to define the fields (attributes) and files (entities)
which comprise a Synon/2E Data model.
The Synon Data Model, that is, the Edit Database Relations screen shows the following items:
1-1
Synon Made Simple Data Modeling
User Class - *DSNR or *PGMR (Designer or Programmer). Only two types of users are allowed to edit
the Synon Data Model, Designers or Programmers. A Designer is mainly responsible for the contents of the
data model or the data relations. Only one Designer is allowed in the model at any given time. Whenever a Designer is
using the model, everyone else is locked out. A Programmer, on the other hand, cannot modify the Data base relations
found in the Data Model. A programmer can specify programs, subroutines, and access paths. Unlike the Designer,
multiple programmers can be in a data model at the same time.
Current Model - The Name of the Data model you have selected is displayed. In our example, the name of
our model is SYN51MDL.
Work Station ID - Time/Date - The ID of the Work Station editing the data model.
You will also notice the data and time in the upper right hand corner. Sorry, the time is not dynamic. To get a current
time, you must press F5=Reload.
Positioning Fields - Above the Type, Object, Relation, and Referenced object fields are what appears to be
blank lines. These lines are actually positioning fields. These fields are used by the user (programmer or designer) to
selectively display specific detailed information about the data model. For example, to see all of the Objects beginning
from the letter 'J', position the cursor above the Object field, enter a 'J' and Press ENTER.
Let's talk about the Synon/2E Data Model, the foundation of Synon/2E application development.
1-2
Synon Made Simple Data Modeling
A Synon/2E Data Model is a structured, organized description of a set of data and its relationships of a
business or organization. Data models are intellectual and sometimes graphical tools representing logical data
relationships. A Data model does not comprise in itself a true representation of all the business's information, but, is a
simplified view of it.
Comprehensive - Every item of information (field) that is relevant to the organization should be identified.
Non-Redundant - Every item of information should appear once and only once. This elimination of
repeating groups of data is one of the elements of what is commonly known as Normalization.
The Edit Database Relations screen allows you to describe the data portion of an application. The data portion
consists of entities (files), attributes (fields), and data relations.
Data Relation - A logical association between two Synon entities or a Synon entity and
a Synon field.
The Synon data model explicitly declares relationships between files, and files and fields. These statements are
known as Data Relations. There are eight Data Relations in the Synon/2E product. However, we will focus our
attention on five of those relations at this time.
The Data Relations we will use are the Defined As, Known By, Has, Owned By and Refers To.
1-3
Synon Made Simple Data Modeling
Defined As - The Defined As data relation declares or defines a file (entity) to the Synon Data Model. Whenever you
enter data relations into a file, the Defined As relation, is not a relation you have to remember to enter, it happens
automatically. Unlike the other Synon Data Relations, the Defined As relation does not appear on the screen without
requesting that to happen. To see Defined As relations, position the cursor in one of the selection or position field
called Relation Level (Rel lvl) and enter "ALL" or "DFN" and Press ENTER. All files currently defined in the data
model will be displayed.
The last item you must know about the defined as relation is that it must be removed BEFORE any file is
deleted from the model.
Known By - The Known By relation defines a field to be present on a file as a key field, usually the Primary Key.
This is a File-to-Field relation.
Has - The Has relation defines a field to be present on a file as a non-key or data attribute field. This is a File-to-Field
relation.
Owned By - The Owned By relation causes the key fields of the owning file to be included among the key entries of
the owned file as major or superordinate keys. For example, if the Employee file is owned by the Company file, then the
key field(s) of the Company file would be included as keys on the Employee file. The key fields of the Company file
would appear before the key fields of the Employee file, making them the major or superordinate keys. This is a File-
to-File relation.
Refers To - The Refers To relation causes the key fields of the referenced file to be included as non-key fields on the
referring file. For example, if the Employee file Refers To Job Master file, the keys of Job Master file will be included
as non-key fields on the Employee file. This is a File-to-File relation.
A Data Model defines explicit relations of the data. This means that all fields and files are defined, and data
relationships declared BEFORE any programming or construction begins. This is known as the Data Driven
Philosophy. A Data Driven Philosophy places the emphasis on the data. If the data has been correctly designed, and
the relationships have also been correctly stated, then the program design specifications (based on that correctly
designed data model) will also be correct.
If a change to a data element is ever needed, simply make the modification at the data model level. That
change is automatically reflected in every function and/or entity using that field.
By contrast, a Process Driven Philosophy does not concentrate on the Database being well designed or
explicit data relations stated. Instead, a Process Driven application focuses around the process (program). For example,
the automatic business rules like Automatic Referential Integrity that is the result of precise business rules being stated in
the data model does not exist in a Process Driven system. The programmer would have to remember to include the
subroutine performing this validation in every program.
One of the greatest advantages of using a Data Driven Design is that specific methods of handling certain types
of data are built directly into the data model. These specific methods are also known as Business Rules. Whenever
business rules are specified in a data model, these rules are automatically propagated into the programs or functions.
This means that instead of remembering to validate the Customer number field against the Customer Master file each
and every time it's used in a program, specify this business rule in the data model and whenever a function (program) is
created (built over the file containing the Business rule) that validation AUTOMATICALLY appears in the program.
1-4
Synon Made Simple Data Modeling
Business rules can be as simple as specifying the file to be used for validating a foreign key, assigning specific
values or conditions to a field, or defining an access path used to validate an involution data base relation.
Remember, the more Business Rules you can define or place into the data model, the less you will need to
place into Synon/2E functions. Defining Business Rules in the Synon Data Model is a way to "Work Smarter...Not
Harder".
To define the Entities, Attributes, and Data Relation in Synon, you specify this information in the Object,
Relation, and Referenced Object fields on the Edit Database Relations screen.
The Object specifies the English-like name of the file or entity you are defining. Up to twenty five characters
may be used to name the file. In this example, the Item Master file is being defined.
The Relation field defines the Data Relation of the object to the Referenced Object. In this example, the
Known By data relation specifies the Primary Key of the file being defined.
The Referenced Object field contains the name of the attribute (field) or entity (file) you're working with. If
the relationship you are defining is a File to File, you may place a ? in the field or position the cursor on the field and
press F4, and a listing of all the entities defined in the model will appear for your selection.
In this particular example, Item Number is being defined a the Primary Key in the Item Master file.
Before we begin creating Synon/2E Entities, let's take a look at two categories of Data Relations, the File to
File and File to Field relations.
File To File Relations - Whenever a file to file relationship is established, the Object and Referenced Object
fields contain the names of entities. Synon takes the key entries of the Referenced Object and makes them apart of the
file specified in the Object field. The Owned By and Refers To data relations are examples of file to file relations.
A File to File relation allows the user to get a selection list of all possible values or conditions being referenced
by using F4 or ? prompting. It also performs automatic referential integrity checking (a business rule). Automatic
referential integrity checking means that if a value is entered into a field (established by a file to file relation) Synon will,
AUTOMATICALLY, verify that value is contained in the Referenced object or file.
File to Field Relations - The file to field relation states a field is present on a file. The Object field contains
the name of the file containing the field and the Referenced object contains the name of the field. The Known By and
Has relations are examples of file to field relations.
1-5
Synon Made Simple Data Modeling
Now that we have discussed the concepts behind Synon Data Modeling, let's take a few minutes and put it into
practice. We will be defining three files, the Company Master file, the Department Master file, and the Job Master file.
When this step is completed, you have entered your first Synon Data Relation. Congratulations. We have
defined the key to the Company Master file. Let's add another field to this file.
Pretty simple isn't it? Specifying a file or entity in Synon is simply identifying the English-like File Name (in
the object field), the Data Relation (Owned by, Has, Refers To, or Known By), and the field or appropriate file name in
the Referenced object field. Remember, all Synon files (compiled OS/400 or S/38 objects) must have, at least, one key
field included in the definition, otherwise it will not generate.
Let's create a few more files, the Department Master and Job Master files.
1-6
Synon Made Simple Data Modeling
>>> Enter the following data relations on the next available lines of the screen:
1-7
Synon Made Simple Data Modeling
Your screen will have the entries under Object and Referenced Object highlighted in reverse image. Notice the
message at the bottom of the following screen, " 'Company Master' type FIL not found." Synon is indicating you have
referred to or defined new objects (files and fields) and it now requires more information.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
'Company Master' type FIL not found.
This is the Define Objects Screen. It displays the names of all the files and fields needing to be defined to
Synon. These objects were specified on the Edit Database Relations Screen. Here, you tell Synon very specific
information about the entities and attributes being defined. You will notice the English-like names defined on the
previous screen have been brought forward AUTOMATICALLY.
F3=Exit
1-8
Synon Made Simple Data Modeling
The first file we will define is the Company Master. We must specify the type of file in the Object Attribute
field.
There are two types of files used in Synon. The CAPTURE file and the REFERENCE file.
The CAPTURE file can be thought of as a transaction file, containing data that changes on a regular basis.
Three functions are created whenever a Capture file is defined.
The REFERENCE file is another name for a Master file. It contains data that is permanent or less likely to
change on a regular basis. Company Master is an example of a Master file.
Please NOTE the only real difference between a Capture and Reference file is the number of functions
automatically created. They are physically implemented the same way. I have attended meetings where great debates
have emerged on whether to make a file a Capture file or a Reference file. The secret is...it really does not matter!
>>> Enter 'REF' in the object attribute field next to Company Master.
Fields are specified in much the same way files are. In the Object type field, FLD indicates the object being
defined is a field. Object Name is the name of the object described on the Edit Database Relations screen. Object
attribute describes the field type or category a field may belong to. Keep in mind there are really only two types of
fields, alpha and numeric. Field types contain predefined attributes such as field length, type (alpha or numeric), default
edit codes, and even number of decimal places.
>>> Position the cursor on the Object Attribute field (next to Company ID). Press F4 or enter a '?' to see a
selection list of the available predefined Synon field types. Press ENTER.
F3=Exit
1-9
Synon Made Simple Data Modeling
The Display Object Attributes Screen lists the various groupings or categories a field may be assigned.
Some groupings or field types are alpha, others are numeric. These predefined field lengths may be as small as 1 or as
large as 30. Some numeric fields allow decimals, others do not.
It's important to NOTE Synon field types are created with default characteristics, and may be changed
(globally or on a field by field basis) as needed.
Synon has extensive Narrative documentation on each field type. Today, we will review three of the field
types listed. Let's start by looking at the CDE or CODE field type.
>>> Page up to return to the first page of field types. Place an 'N' in the selection field to the left of the CDE
field. Press ENTER.
1 - 10
Synon Made Simple Data Modeling
The narrative for each field type is usually displayed on several screens. We have taken the contents of those
screens and have assembled the information on one page.
NOTE: If you were viewing these screens in Synon, you would use the Page Up and Page Down keys to move from
one screen to another. At the end of the display, you would select F3 to return to the previous screen.
Description
The Synon/2E CDE field type is used for Synon/2E fields that represent
codes.
- Product code.
- Currency code.
- Warehouse location code.
- Customer code.
- Region code.
- Cost centre code.
- Country code.
.________________________________________________________________.
| | | Model | Model | Device |
| Data attribute | Default | Default | Field | Field |
| | | Override | Override | Override |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| DDS name | xxCD | - | Y | N |
| System data type | Alpha | N | N | N |
| External length | 6 | Y | Y | N |
| Internal length |as external| - | - | - |
| Decimal places | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Headings |Field name | N | Y | Y |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Keyboard shift | N | N | Y | N |
| Allow lowercase | N | Y | Y | N |
| Mandatory fill | N | Y | Y | N |
| Valid System name | N | Y | Y | N |
| Mod 10/11 check | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Check condition | *NONE | N | Y | Y |
| Translate values | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Field Edit option | Y | Y | N | Y |
| Edit codes: Input | - | - | - | - |
| Output| - | - | - | - |
| Report| - | - | - | - |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
1 - 11
Synon Made Simple Data Modeling
Now let's look at the Narrative for the Narrative (NAR) text field.
>>> Enter 'N' next to the NAR field type and Press ENTER.
1 - 12
Synon Made Simple Data Modeling
Description
The Synon/2E NAR field type is used for Synon/2E fields that represent
narrative text.
- Order comments.
- Address lines.
- Full product description.
- Customer's job title.
.________________________________________________________________.
| | | Model | Model | Device |
| Data attribute | Default | Default | Field | Field |
| | | Override | Override | Override |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| DDS name | xxNA | - | Y | N |
| System data type | Alpha | N | N | N |
| External length | 30 | Y | Y | N |
| Internal length |as external| - | - | - |
| Decimal places | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Headings |Field name | N | Y | Y |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Keyboard shift | N | N | Y | N |
| Allow lowercase | Y | Y | Y | N |
| Mandatory fill | N | Y | Y | N |
| Valid System name | N | Y | Y | N |
| Mod 10/11 check | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Check condition | *NONE | N | Y | Y |
| Translate values | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Field Edit option | N | Y | N | Y |
| Edit codes: Input | - | - | - | - |
| Output| - | - | - | - |
| Report| - | - | - | - |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
Discussion
The last field type we will review is the Number field (NBR).
1 - 13
Synon Made Simple Data Modeling
1 - 14
Synon Made Simple Data Modeling
Description
The NBR field attribute is used for fields that contain purely
numeric data values, i.e. fields which are numeric, but do not possess
a standard dimension that is covered by an existing standard type (e.g.
price, quantity, value).
.________________________________________________________________.
| | | Model | Model | Device |
| Data attribute | Default | Default | Field | Field |
| | | Override | Override | Override |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| DDS name | xxNB | - | Y | N |
| System data type | Packed | N | N | N |
| External length | 5.0 | Y | Y | N |
| Internal length |as external| - | - | - |
| Decimal places | N | Y | Y | N |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Headings |Field name | N | Y | Y |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Keyboard shift | N | N | Y | N |
| Allow lowercase | - | - | - | - |
| Mandatory fill | N | Y | Y | N |
| Valid System name | - | - | - | - |
| Mod 10/11 check | N | Y | Y | N |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Check condition | *NONE | N | Y | Y |
| Translate values | - | - | - | - |
|~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|~~~~~~~~~~|
| Field Edit option | Z | Y | N | Y |
| Edit codes: Input | 4 | Y | Y | Y |
| Output| 3 | Y | Y | Y |
| Report| 3 | Y | Y | - |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
Discussion
'Numeric fields with dimension' (VAL, QTY, PCT, PRC) should be used
for numeric data fields that have a standard dimension (e.g. currency,
stock units, percentage) since they provide a more precise specifica-
tion.
1 - 15
Synon Made Simple Data Modeling
Now we have reviewed some of the attributes of the field types, it's time to select the field type to be associated
with Company ID.
1 - 16
Synon Made Simple Data Modeling
The field type selected on the Display Object Attributes screen has been returned to the Defined Objects
screen.
F3=Exit
You will notice the Object Attribute field for the remaining fields has been highlighted. This indicates these
fields must also be defined.
F3=Exit
1 - 17
Synon Made Simple Data Modeling
>>> To define the remaining fields, enter the following in the Object Attribute field:
The next field we will define is the Salary/Hourly Code. It is a special type of field called a STATUS FIELD.
A status field is unique in that it contains discrete values.
>>> Enter 'STS' in the Object Attribute field and 'Y' in the Edit field column. Press ENTER to define the
Salary/Hourly Code as a Status field.
Field Details
The next screen displayed is the Edit Field Details screen. It contains detailed information about the field we
are evaluating. It's attribute, size (internal length) and data type (alpha, packed, or signed), as well as the Synon
generated field name.
This screen also shows if Lowercase letters are allowed in alpha fields.
The English-like field name is the basis for default headings for Text, Left hand side text, and Column
headings. Each heading may be changed or overridden as needed. Any change made on this screen will be reflected
throughout the model.
1 - 18
Synon Made Simple Data Modeling
If you had specified the field name or field type (Attribute) incorrectly on the Edit Database Relations Screen,
you can change either entry by Pressing F8. The protection for those fields is removed and you can modify as needed.
Field Conditions
A Status field type is unlike any other Synon field types in that specific values or multiple values may be
assigned to it. These values are called CONDITIONS. Multiple values grouped together is known as a LIST OF
CONDITIONS. Conditions or Lists may be assigned to a status field type to expedite processing or used as select/omit
criteria in access path selection.
>>> Press F9 to go to the Edit Field Conditions Screen. This screen will allow us to assign conditions to this field.
The Edit Field Conditions Screen allows you to enter English-like names for conditions and specify their
discrete single values or multiple values.
In this example, we are creating a condition called Hourly Position, the type of condition is a VAL or Value.
'Hourly Position' in the ENTER CONDITION field, and 'VAL' in the TYPE field. Press
ENTER.
1 - 19
Synon Made Simple Data Modeling
When the condition and type values have been entered, it's time to define the Status or File value used to
represent the English-like condition name. The Status or File value is the actual character found in the database
file. In this example, we will use 'H' as the status value.
F3=Exit
F3=Exit
Condition 'Hourly Position' added.
1 - 20
Synon Made Simple Data Modeling
>>> Enter the next condition name, 'Salary Position' by keying over 'Hourly Position'. The field value used will
be 'S'. Press ENTER to continue.
F3=Exit
Condition 'Hourly Position' added.
F3=Exit
Condition 'Salalry Position' added.
1 - 21
Synon Made Simple Data Modeling
You will notice the Hourly Position and Salary Position conditions have been added plus another condition
called `*All values'. *All values is a list (LST). A list is a grouping of one or more predefined VAL conditions.
As you may have guessed, the *All Values condition list contains ALL condition values specified for the Salary/Hourly
code field.
1 - 22
Synon Made Simple Data Modeling
It is important that only the condition values assigned to this field are entered. As this field is currently defined,
any value entered would be accepted. To assure only the condition values specified are permitted to be entered in this
field, specify the name of a condition (single value or list) in the Check Condition field. Synon will automatically
validate whatever is entered in this field against the predefined condition or list of conditions specified in the Check
condition field.
>>> Enter a '?' in the Check condition field to display a selection list of the conditions available for this field.
Press ENTER.
All of the conditions associated with this field will be used as validation criteria.
>>> Select the condition list *ALL values by placing an 'X' in the subfile selection field.
Press ENTER.
1 - 23
Synon Made Simple Data Modeling
The condition, *ALL Values, has been returned to the Check condition field. By specifying this "business
rule" at the field or data model level, every Synon function or program containing this field will AUTOMATICALLY
execute the same validation routine. The Synon developer does not have to remember to insert this routine into each
data entry or file maintenance function containing this field.
1 - 24
Synon Made Simple Data Modeling
F3=Exit
We will define the remaining Pay Rate-Low field as a Price (PRC) field type.
The remaining fields, Pay Rate-Mid and Pay Rate-High have the same physical attributes as Pay Rate-
Low. Synon allows us to specify or base the physical attributes of one field on another by using a special object
attribute, REF or Reference. Whenever one field references another, the physical attributes (field type, length, decimals,
allow lower case, as well as conditions and lists) carry over to this newly defined field. Fields that are based upon
common fields are said to share the same DOMAIN.
>>> To allow Pay Rate-Mid and Pay Rate-High to reference or share the same domain as the field Pay Rate-
Low, Enter REF on the object attribute of these fields, and specify the field (Pay Rate-Low) to be REFerenced in
the Referenced field for each of these fields.
The last item we will discuss is the Field Usage field. There are only two values for this field, CDE and
ATR. CDE indicates the field is the primary key of a defined file and ATR indicates the field is a non-key field. A field
can only have a field usage of ATR or CDE, but not both. Do not confuse the field type CDE with the Field usage CDE.
In this example, Company ID, Department ID, and Job ID are CDE type fields, and also have a field usage of CDE.
When the definitions of all fields and files are complete, Synon takes you back to the Edit Database Relations
Screen.
1 - 25
Synon Made Simple Data Modeling
We have completed the definitions of the entities and attributes specified in the Synon Data model. We can
take a closer look at the physical layout and characteristics of the file by placing an 'E' in the subfile selection field next
to any data relation.
>>> Let's review the physical record layout of the Company Master file by placing an 'E' in the subfile selection
field to see the ENTRIES for that file. Press ENTER to continue.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
Key Structures
The Edit File Entries screen displays the physical layout of the entity being examined.
This screen shows the English-like field names of the fields, the field type or attribute. It also shows if the field
is used as a key field (K) or a non-key field (A).
The Edit File Entries Screen displays the Key structure (KSQ). A key field is designated by a 'K' in the 'Et'
field. A key field with a '1' would be the first or major key field for that file, a '2' would be the second, and so on. In this
example, a single key exists.
1 - 26
Synon Made Simple Data Modeling
The Synon data model is usually configured to automatically generate the names of files, fields, and record
formats.
Many IBM midrange shops have very strict standards when it comes to the naming of files, fields, programs,
and the like. Often when an IBM midrange programmer is introduced to Synon generated field names (shown below),
the generated field names may be confusing and contrary to the generally accepted standards used in the naming of
fields, programs, files, etc.
The Synon field naming algorithm is based upon the field type or attribute, and when the field is defined in
the Synon data model.
Synon field types or attributes are generic groups or categories of fields having similar characteristics. We
looked at the NAR, NBR, CDE and STS fields.
Each of these field types has an associated mnemonic code. The mnemonic codes, like the field types, are
predefined in Synon. Here are samples of the field types and mnemonics:
Status STS ST
Code CDE CD
Number NBR NB
Quantity QTY QT
1 - 27
Synon Made Simple Data Modeling
Synon determines the type of field and uses the corresponding mnemonic as the last two characters of the
generated field name.
To determine the first two characters of the field name, Synon uses an internal file containing the field types as
the key, and a field containing the next two characters to be used in the naming algorithm.
Synon initializes each field type with a prefix of AA. The first field defined for each field type will begin with
AA.
The Mnemonic code for the CDE field type is CD. The Company ID field is made up of the field prefix AB
and the mnemonic CD, the field ABCD is generated. Synon, then, increments the file containing the next available
prefix to AC. When the next CDE field is defined, the prefix is incremented to AD, until it reaches all 1296 possible
combinations within a single field type.
You can change the Synon generated algorithm to allow more than 10,000 names per field type. We will
discuss how to do this in the Synon Made Simple - Power Tools book.
Field Length
The last item we will point out on this screen is the length of each field displayed. Here we see the Company
ID and Company name fields have respective lengths of 6 and 25. These field lengths are default lengths for the CDE
and TXT field types.
The Synon Data Modeling facility is very dynamic. Whenever an attribute of a field is changed, that change is
reflected right away. Let's demonstrate this.
>>> Zoom into the Company Name field. Place a 'Z' in the subfile selection field. Press ENTER.
1 - 28
Synon Made Simple Data Modeling
>>> Change the length of the internal field length from 25 to 15. Press ENTER, then Press ENTER, again.
The new field length is dynamically reflected on the Edit File Entries screen (and every place else it is found).
While we are here, let's also change the name of the field from Company Name to New Company Name.
>>> Place a 'Z' in the subfile selection field next to Company Name. Press ENTER.
1 - 29
Synon Made Simple Data Modeling
Control . . . . . . :-
Default condition : *NONE
>>> Press ENTER to record the changes. Notice the Text and Left hand side text fields have also changed.
1 - 30
Synon Made Simple Data Modeling
Whoops!!! We forgot to change the field back to the original name and size. We can make the change from
here.
>>> Place a 'Z2' in the subfile selection field on the 'Company Master Has New Company Name' relation.
Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
>>> Change the field length from 15 back to 25. Press ENTER. Now Press F8, change the field name from New
Company Name to Company Name. Press ENTER to record the change. Press ENTER, again, to return to the
Edit Database Relations screen.
1 - 31
Synon Made Simple Data Modeling
>>> Place an 'E' in the subfile select field for any data relation for the Job Master file. Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
Notice the same information is being displayed as before. However, Pay Rate-Mid and Pay Rate-High have
the REFerence attribute. To see the field these fields are referencing, place a 'Z' in the subfile selection field and ZOOM
into the details.
1 - 32
Synon Made Simple Data Modeling
The Edit Database relations screen may have several files displayed at a single time.
>>> To select a specific file, place an 'S' next to the file. Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
The name of the file selected will appear in the Object (file) positioning field.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
>>> To redisplay all of the files once again, blank out 'Job Master *' from the positioner field. Press ENTER.
The files will be redisplayed in alphabetical order.
1 - 33
Synon Made Simple Data Modeling
We have described the Company, Department, and Job Master files. Let's look at the various files supporting
the Company Master entity.
>>> Place a 'Z' in the subfile selection field next to Company Master to ZOOM into the details of the file. Press
ENTER.
The Edit File Details screen contains several valuable pieces of information. It shows the Name of the file, the
attribute (or type) of file (Reference or Capture).
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUABREP NONE ATR ONLY
_ UPD Update index UUABREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUABREL1 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
This screen shows the name of the Source library containing the Data description specifications for this file.
This screen contains the two character RPG format prefix characters which are concatenated with the four letter field
name. For example, if the field we're working with is ACTX, if it is joined with this file, the Company Master file,
whose prefix is AB, the name of the field associated with this file would be ABACTX.
1 - 34
Synon Made Simple Data Modeling
Messages
Whenever a file is created in Synon, two error messages are automatically created. These messages are used if
a requested record is not found, or if a record, attempting to be added, already exists. Synon also determines the
associated Message IDs.
Three access paths (the Physical, the Update and the Retrieval) are automatically created whenever a file is
specified in Synon. An access path defines a view of the data which specifies 1) the order in which the records are read
2) the criteria used for selecting and/or omitting records and 3) which fields from the file are included in the specified
view.
The Physical (PHY) access path is the access path that contains the physical records and fields in a file. Only
one Physical access path exists per file. Records in the Physical access path are Non-keyed and are arranged in Arrival
Sequence. Records from the Physical Access Path are read or updated with one of the associated logical files (such as
the Retrieval or Update access paths).
The Update (UPD) access path is one of the default access paths created by Synon. The update access path is a
keyed access path. The keys of the Update access path are unique and will always be the same as the Primary key(s)
defined in the Data Model. This access path, by default, contains all of the data fields specified in the data model. It
contains no virtual fields (more on virtual fields, later). However, multiple Update access paths may be specified
containing only a selected subset of fields. It is one of two access paths used in a Synon maintenance program. The
update access path is used to lock a record when it is being updated or changed in a file.
The Retrieval Access path (RTV) is one of the default access paths created by Synon. The Retrieval access
path is a keyed access path. The key(s) of the Retrieval access path are unique and will always be the same of the
Primary key(s) specified on the file (over which the Retrieval access path) is based in the Data Model. Unlike the
Update access path, the retrieval access path contains both virtual and data fields. This access path, by default, contains
all of the fields (both virtual and data) specified for this file in the data model. However, multiple Retrieval access paths
may be specified containing only a specified subset of fields. The Retrieval access path may contain one or more sets of
selection criteria.
1 - 35
Synon Made Simple Data Modeling
Let's take a look at each of the Access Path types we have defined in a bit more detail.
>>> Place a 'Z' next to the Physical (PHY) Access Path and Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
Z PHY Physical file UUABREP NONE ATR ONLY
_ UPD Update index UUABREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUABREL1 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
SEL: Z-Details, G/J-Generate, E-STRSEU, D-Delete, L-Locks, O-Overrides
H-Hold/Release, T-Trim, V-Virtualize, U-Usage, F-Func refs., N-Narrative
F3=Exit F5=Reload F7=Functions F8=Change name F17=Services F20=Narrative
The Edit Access Path Details Screen appears. It contains information related to the Record format. Let's Zoom
into the details of the format and see more detailed information about the Access path format entries.
1 - 36
Synon Made Simple Data Modeling
The Edit Access Path Format Entries screen is displayed. It contains all of the fields associated with this
file. You will notice it contains much of the same information displayed on the Edit File Entries screen. Let's take a
closer look at the details for the field Company ID. Since the PHY access path does not contain any keys, Company ID
(the primary key in the data model) is specified as an attribute (non-keyed) field.
>>> Place a 'Z' in the subfile selection field next to Company ID. Press ENTER.
1 - 37
Synon Made Simple Data Modeling
The Edit Field Details screen, once again, is displayed. This screen shows the detailed information and
defaults associated with a data field. Changes made on this screen will be reflected throughout the entire data model.
>>> Press F3 until you return to the Edit File Details panel.
>>> Place a 'Z' in to the subfile selection field next to Update access path (UPD).
Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUABREP NONE ATR ONLY
Z UPD Update index UUABREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUABREL1 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
1 - 38
Synon Made Simple Data Modeling
The Edit Access Path Details screen appears with more information than presented for the PHY access path.
This panel will display information about the file. It will show if the Key structure is unique, how the file is maintained
(Immediate, Delay, or Rebuild) the record format name, etc.
>>> Place a 'Z' in the subfile selection field next to the format name. Press ENTER.
The fields found on the Update Access path are displayed on the Edit Access Path Format Entries screen.
Notice, the Company ID field is designated as a Key field.
>>> Press F3 until you return to the Edit File Details panel.
1 - 39
Synon Made Simple Data Modeling
>>> Place a 'Z' in the subfile selection field for the RTV Retrieval index. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUABREP NONE ATR ONLY
_ UPD Update index UUABREL0 UNIQUE IMMED ATR ONLY
Z RTV Retrieval index UUABREL1 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
Many of the same options exist for the Retrieval Access Path and Update Access Path.
>>> Place a 'Z' in the subfile selection field next to the record format name. Press ENTER.
1 - 40
Synon Made Simple Data Modeling
All fields associated with this access path are displayed. Keyed and non-keyed fields are identified.
>>> Press F3 until you return to the Edit Database Relations panel.
We are going to define another file, the Employee Master file. There is not enough room left on this screen to
completely define all of the relations.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 41
Synon Made Simple Data Modeling
>>> Let's Roll up or Page Down (depending upon your keyboard) to get a blank screen.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 42
Synon Made Simple Data Modeling
The first relation we will define will be the Owned By relation. The Owned by relation will bring the key(s) of
the owning file down to become the primary or superordinate key of the file being defined.
In our Example, the Employee Master file will be Owned by the Company file. If you did not know or had
forgotten the exact name of the Company file, you could place a '?' in the Referenced Object field and all of the files or
entities defined will be displayed.
>>> Key in 'Employee Master', ' Owned By' and '?' on the first relation line. Do not Press ENTER until all of
the remaining relations have been entered.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
>>> When you have completed the first relation, enter the relations displayed above.
You will notice we have taken a short cut when describing the relation. Simply enter the first character of the
relation (K for Known By, R for Refers To, H for Has and O for Owned by) and Synon does the rest. On the
Employee Master Refers to Job Master and Department Master a sequence number will be used. This sequence number
will position the fields at the end of the record.
1 - 43
Synon Made Simple Data Modeling
The '?' entered on the previous screen will prompt the Display Objects Screen to be displayed showing all of
the entities defined in the data model.
>>> Press F10 to Define the Employee Master file and its' associated fields.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
'Employee Master' type FIL not found.
1 - 44
Synon Made Simple Data Modeling
>>> Enter the values as shown on the panel below. Notice that selected fields will be edited. Press ENTER.
F3=Exit
Employee State has been defined with a field type of CDE. The length of this field type is 6. However, the
correct size for this field is 2.
>>> Position the cursor on the Internal length field and change it from 6 to 2. Press ENTER.
1 - 45
Synon Made Simple Data Modeling
The Edit Field Details screen showing the Employee Status field will be displayed. We will add two conditions to this
field.
Control . . . . . . :-
Default condition : *NONE_________________________
The first condition we will enter will be the Active Condition with a file value of 'A'.
>>> Enter 'Active' in the 'Enter condition' field, 'VAL' in the 'type' field. Press ENTER.
1 - 46
Synon Made Simple Data Modeling
>>> Now enter 'A' in the Status value field. This value ('A') will be the actual value found in the data file.
Condition. . . . . : Active___________________
Type . . . . . . . : VAL
F3=Exit
To enter the second condition, simply key over the condition just entered.
>>> Enter 'Terminated" in the Condition field, VAL in the Type field, 'T' in the Status value field. Press
ENTER. There are no more conditions to enter. Press F3 to Exit.
Condition. . . . . : Terminated_______________
Type . . . . . . . : VAL
F3=Exit
Condition 'Active' added.
1 - 47
Synon Made Simple Data Modeling
The last thing we need to do, is to specify the business rule that only the values for the conditions specified will
be allowed to be entered in this field.
>>> Enter '*ALL values' in the Check condition field. Press ENTER. Press F3.
1 - 48
Synon Made Simple Data Modeling
The next screen displayed will allow us to enter conditions for the field, Manager Status Code. We will want
to enter three conditions, Executive, Middle Management and Supervisor. When these conditions have been entered, we
will create a group to contain all three conditions called a List.
1 - 49
Synon Made Simple Data Modeling
The first condition we will enter is Executive. The condition type is VALue.
>>> Enter 'Executive' in the Enter condition field and 'VAL' in the type field.
Press ENTER.
Condition. . . . . : Executive________________
Type . . . . . . . : VAL
F3=Exit
1 - 50
Synon Made Simple Data Modeling
The screen will display a message indicating the condition Executive has been added.
>>> Change the condition name from 'Executive' to 'Middle Management' and the status value from 'E' to 'M'.
Press ENTER.
F3=Exit
Condition 'Executive' added.
Again, you will get a message indicating the condition "Middle Management" has been added.
>>> Change the condition name from 'Middle Management' to 'Supervisor'. Change the value of the status
value field from 'M' to 'S'. Press ENTER.
Condition. . . . . : Supervisor_______________
Type . . . . . . . : VAL
F3=Exit
Condition 'Middle Management' added.
1 - 51
Synon Made Simple Data Modeling
Condition. . . . . : Supervisor_______________
Type . . . . . . . : VAL
F3=Exit
Condition 'Supervisor' added.
>>> Enter 'Managers' in the Enter conditions field and 'LST' in the type field. Press ENTER.
1 - 52
Synon Made Simple Data Modeling
The Edit List Condition screen is displayed. This screen shows all of the Value Conditions for the Manager
Status Code field.
>>> Place a '+' next to each condition to be included in the Managers List. Press ENTER.
File
? Condition value
+ Executive E
+ Middle Management M
+ Supervisor S
You will notice each condition selected will be highlighted and marked with an '*'.
File
? Condition value
_ * Executive E
_ * Middle Management M
_ * Supervisor S
1 - 53
Synon Made Simple Data Modeling
The list 'Managers' has been added to the list of conditions and lists.
>>> Press F3. On the Edit Field Details panel, change the Check condition value from '*NONE' to 'Managers'.
This will ensure that whenever a value is entered into the Manager Status Code field, the value entered must be
one of the conditions found in the Managers list.
1 - 54
Synon Made Simple Data Modeling
Involution
The next data relation example we will look at is somewhat complex. There is a lot of basic employee
information found in the Employee Master file. A new requirement for data just arrived. The Employee ID and Name
of each supervisor must appear in each employees' record.
Synon does not allow duplicate relations within an entity. How do you specify such an unusual relation?
Occasionally, there is the need for a file to refer to itself. This type of relation is called INVOLUTION.
Before we begin this topic, we need to select the Employee Master file.
>>> Place an 'S' next to any relation on the Employee Master File. Press ENTER.
1 - 55
Synon Made Simple Data Modeling
An additional line , called Extended Text, is displayed. To make this field unique, a prefix must be entered.
1 - 56
Synon Made Simple Data Modeling
>>> Now, blank out the positioning field containing Employee Master and Press ENTER. The following screen
appears.
More
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 57
Synon Made Simple Data Modeling
>>> Place an 'S' next to any data relationship for Employee Master and Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
Let's look at the file entries to see how Synon resolved the Involution.
>>> Place an 'E' in the subfile selection field next to Employee Master and Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 58
Synon Made Simple Data Modeling
Notice, Synon resolved the Employee Refers To Employee relation by using the information supplied on the
extended relation field, "For:" Manager. Manager was the prefix specified to make the field unique.
If the extended relation had not been used, Synon would have resolved the relation by creating a new field
"Employee ID 93950". The field is a combination of the field name and a unique 5 digit surrogate number. (Ugly, isn't
it ??)
1 - 59
Synon Made Simple Data Modeling
Virtual Fields
Whenever a file to file relationship (Refers to or Owned by) exists between File A and File B, Synon allows
you to specify data from File B to logically appear on File A. These fields are known as a Virtual Fields. The concept
of a virtual field is that a Field is physically present in only one place, but can be logically present in many places.
Virtual fields are "read only" fields, and cannot be updated.
The Advantages of a virtual field are they are always up-to-date or current because the field is maintained in a
single place, it takes up less disk storage.
However, the disadvantages of virtual fields may outweigh its advantages. A virtual field is implemented as a
Join Logical file. A join logical file may, depending upon the size of the file, cause performance degradation. If a field
is added to a file containing a virtual field, all associated Joined files and all associated programs (from each of the
joined files) must be recompiled. The amount of work involved in maintaining virtual fields can be tremendous. Unless
a shop is very well managed and disciplined and has a full time database administrator constantly monitoring the Synon
model, I discourage the use of virtual fields. If used correctly, virtual fields are very powerful and can save much time
as you develop application functions. Let's take a closer look at this controversial topic.
A virtual field may only appear on a File to File relation, such as an Owned By or Refers To relation.
Suppose we would like to have information from the Department Master, Job Master, and Employee Master
(supervisor information) appear on the Employee Master Record.
>>> Place a 'V' in the subfile selection field on the Employee Master Refers To Job Master data relation. Press
ENTER.
The Edit Virtual Fields Entries screen is displayed showing all of the fields existing on the file specified on
the file to file relation. In our case, the Job Master file.
1 - 60
Synon Made Simple Data Modeling
>>> Place a '+' next to each field that is to appear on the Referring file (Employee Master) and Press ENTER. In
our case, we will select the job description field to appear on the Employee Master file.
The fields selected to be virtualized will be highlighted and marked with a '*'. To remove a virtual field, place
a '-' next to the field and Press ENTER.
1 - 61
Synon Made Simple Data Modeling
>>> Place a 'V' next to the File to File relation as shown below.
Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
>>> Select the field(s) to be virtualized by putting a '+' in the subfile selection field. In our case, select the
Department name field. Press ENTER.
1 - 62
Synon Made Simple Data Modeling
The field(s) selected will be highlighted. An asterisk (*) will appear next to the field indicating it has been
selected for virtualization.
Whenever a file refers to itself, the relation should be the last relation specified for that file. That is done by
placing a sequence number in the data relation.
>>> Place a 'V' next to the Employee Master Refers To Employee Master relation. Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 63
Synon Made Simple Data Modeling
>>> For our example, select Employee Name. Place a '+' next to the Employee Name field. Press ENTER.
The field(s) selected will be highlighted. An asterisk (*) will appear next to the field indicating it has been
selected for virtualization.
1 - 64
Synon Made Simple Data Modeling
Now, let's see how Synon handles Virtualized fields for Refers to relations.
>>> Place an 'E' next to the Employee Master file to look at the entries or layout of the file.
Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
Notice, there is another type of field in this file, the Virtual field. Department Name, Job Description, and
Manager Employee Name are all virtual fields. Virtual fields are indicated with a 'V'.
1 - 65
Synon Made Simple Data Modeling
Notice, the Employee Name field we virtualized, has assumed the prefix of 'Manager' (specified on the
Involution relation).
Now let's see what happens to the Update and Retrieval access paths when field(s) are virtualized.
>>> Place a 'Z' in the subfile selection field next to any of the Employee Master Data relations. Press ENTER.
Bottom
Z(n)=Details F=Functions E(n)=Entries S(n)=Select F23=More options
F3=Exit F5=Reload F6=Hide/Show F7=Fields F9=Add/Change F24=More keys
1 - 66
Synon Made Simple Data Modeling
We will Zoom into the Update and Retrieval access paths and see the effect of specifying virtual fields in the
Data Model.
>>> Place a 'Z' in the subfile selection field for the Update and Retrieval access paths. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
PHY Physical file UUAEREP NONE ATR ONLY
Z UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
Z RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
>>> Zoom into the format on the Edit Access Path Details Screen. Enter 'Z' in the subfile selection field. Press
ENTER.
1 - 67
Synon Made Simple Data Modeling
You will notice only the data fields, that is, the fields physically on the access appear on the Update Access
Path. There are no virtual fields on this access path.
>>> Press F3 until you return to the Edit Access Path Details panel for the Retrieval index.
1 - 68
Synon Made Simple Data Modeling
Now let's look at how virtual fields affect the Retrieval access path.
>>> Zoom into the format by placing a 'Z' in the subfile selection field. Press ENTER.
1 - 69
Synon Made Simple Data Modeling
Now, you can see all the virtual fields, selected earlier appear on the Retrieval Access path.
Remember, virtual fields are physically present in only one place, but can be logically present in several places. Since
the Update access path contains only fields physically present on that record, the virtual fields do not appear.
>>> Press F7 to review the data relations for this file. The relations are very similar to the relations found on the
Edit Database Relations display.
_ * Known by Employee ID
1 - 70
Synon Made Simple Data Modeling
>>> Press F3 until you return to the Edit File Details screen.
1 - 71
Synon Made Simple Data Modeling
A Resequence Access Path allows you to order or sequence data differently than specified in the Data Model.
We will create a Resequence Access Path to display the Employee Master File by Employee Name. The type of access
path will be RSQ, the access path name is Employee Master By Name.
>>> Position the cursor on the next blank line and enter the information as displayed below. Press ENTER to
confirm your choice.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name__
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
As before, Synon determines the name of the source member for the new access path.
1 - 72
Synon Made Simple Data Modeling
>>> Let's Zoom into the details of the access path. Here we will change the key structure of the access path.
Place a 'Z' in the subfile selection field. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
Z RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
>>> Place a 'Z' in the subfile selection field (as shown in the panel below). Press ENTER.
1 - 73
Synon Made Simple Data Modeling
We see the key structure for this file is the same as the Employee Master file in the data model. Now we want
to change it.
>>> Blank out of keys (shown below as 1 and 2 under the Key no. Heading).
>>> Now place a '1' in the Key no. field for the Employee Name field. Press ENTER.
1 - 74
Synon Made Simple Data Modeling
The Employee Name has been selected as the primary key for this file. This is done by the designation of a '1'
under the Key no heading.
>>> Press F3 until you return to the Edit File Details Panel.
1 - 75
Synon Made Simple Data Modeling
The last access path type we will discuss in this section is the Query Access Path. It is implemented as an
OPNQRY (Open Query) file.
The QRY access path is unlike the other access paths we have discussed in that the Query Access Path is the
only one that allows virtual fields to be key fields. The Query access path is, according to Synon documentation, is
only allowed with Print Object and Print File functions.
Let's create a QRY access path. The access path type is QRY. The name of the Access path is Open Qry by
Job Descption. The QRY ACP we will create will have a key by Job Description. You will recall the Job Description
field is a field that has been virtualized. Let's see what is involved.
>>> Enter the fields to create the QRY access path as listed below. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
_ QRY Open Qry by Job Descption
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
1 - 76
Synon Made Simple Data Modeling
>>> Place a 'Z' next to the QRY access path to Zoom into the details. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
Z QRY Open Qry by Job Descption
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
>>> Now let's zoom into the format. Place a 'Z' in the subfile selection field (as shown below). Press ENTER.
1 - 77
Synon Made Simple Data Modeling
Synon has defaulted the key structure to that as defined in the Data Model. We want to change it use the Job
Description field as the key. Before we can use the job description as the new key field, we first much remove Company
ID and Employee ID as the key fields. Next, we must add the Job Description field to the access path. Finally, we will
change the access path to reflect the Job Description field as the new key.
>>> Blank out the '1' & '2' under the Key no. fields. Press ENTER. Press F7 to look at the Relations panel.
The Edit Access Path Relations panel appears. The first panel displays the fields we’ve defined so far
(Employee ID, Employee name, etc). Roll up to see the next panel. We want to look at the Refers to Relations for
the Job Master, Department Master, and Employee Master files.
* Known by Employee ID
1 - 78
Synon Made Simple Data Modeling
Release 5.0 of Synon, virtual fields do not automatically appear on the access path, we must explicity add
them.
To add these fields, we’ll place a 'V' next to each of the Refers To relations.
>>> Place a 'V' next to each Refers to relation, as shown below. Press ENTER.
>>> Place a '+' next to the Job Description field. Press ENTER.
This action indicates to Synon this virtual field should be added to the Access path.
1 - 79
Synon Made Simple Data Modeling
An asterisk (*) now appears indicating this virtual field has been added.
>>> Press F3. The same panel appears for the Department Master.
1 - 80
Synon Made Simple Data Modeling
>>> Place a '+' next to the Department name field. Press ENTER.
An Asterisk (*) appears indicating this field has been added to the access path.
>>>Press F3 to exit.
1 - 81
Synon Made Simple Data Modeling
>>>Once again, we'll place a '+' next to the Manager Employee name field. Press ENTER.
An asterisk (*) appears, indicating this virtual field will be included on the access path.
1 - 82
Synon Made Simple Data Modeling
As we return to the Edit Access Path Format Entries panel, we can see the virtual fields have been added to this
panel as all as the access path.
1 - 83
Synon Made Simple Data Modeling
>>> Place a '1' in the key no. field next to Job Description. Press ENTER.
Notice the Job Description field has been designated as type 'V' for virtual field.
Notice, when a virtual field is specified as a key field, the type changes from 'V' to 'W' (not to a 'K' as with
the other access paths). The Job Description field is now designated as a key field with a '1' under the Key no. field.
>>> Press F3 until you return to the Edit File Details panel.
1 - 84
Synon Made Simple Data Modeling
We are now going to create another access path, Managers Only. This access path will be a retrieval access
path containing only records of Employees with the condition of Executive, Middle management, or Supervisor in their
Manager Status code.
>>> On the next available line, key in 'RTV' (retrieval) and 'Mangers Only' for the name of the access path.
Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
_ QRY Open Qry by Job Descption UUAEREL3 FIFO ATR ONLY
_ RTV Managers Only
_ ___ _________________________
_ ___ _________________________
_ ___ _________________________
SEL: Z-Details, G/J-Generate, E-STRSEU, D-Delete, L-Locks, O-Overrides
H-Hold/Release, T-Trim, V-Virtualize, U-Usage, F-Func refs., N-Narrative
F3=Exit F5=Reload F7=Functions F8=Change name F17=Services F20=Narrative
1 - 85
Synon Made Simple Data Modeling
Synon automatically assigns the name of the source member to the Managers Only access path. Remember,
the key structure for a retrieval access path is fixed. That is, it is a reflection of the primary key structure specified in the
Data model.
>>> Let's Zoom into our newly created access path. Place a 'Z' in the subfile selection field next to the Managers
Only access path. Press ENTER.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
_ RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
_ QRY Open Qry by Job Descption UUAEREL3 FIFO ATR ONLY
Z RTV Managers Only UUAEREL4 UNIQUE IMMED ATR ONLY
_ ___ _________________________
_ ___ _________________________
We will be selecting only records with the conditions of Executive, Middle Management, or Supervisor in the
Manager Status Code field. When specifying the criteria to select a set of records, you must indicate the method by
which the selection should occur. This is specified in the Allow select/omit field. To do so, determine if the selection
criteria is Static or Dynamic.
Static - The access path will have its own separate index. It will only include records that satisfy the
select/omit criteria. Whenever there is an update, the system will determine whether or not the access path should reflect
the change.
Dynamic - The access path includes all records, regardless of whether or not they meet the select/omit criteria.
The selection of records when the program reads the data from the access paths. Anytime virtual fields (join logical
files) have been selected, you MUST specify Dynamic selection.
1 - 86
Synon Made Simple Data Modeling
>>> Place a 'D' in Allow select/omit for Dynamic selection. Place an 'S' in the subfile selection field next to the
record format to indicate record selection is being defined. Press ENTER.
The Edit Access Path Select/Omit screen is displayed. This screen allows you to specify multiple selection
groups within the access path. For our purpose, we will set up only one.
>>> Place a 'Z' in the subfile selection field, an 'S' in the Select/Omit (S/O) field, and write a description of the
selection group you are entering. This Text description is free format. When this is complete, Press ENTER.
1 - 87
Synon Made Simple Data Modeling
The Edit Access Path Conditions screen allows you to select field(s) and associated conditions that will be used
as the selection criteria for the selection group defined on the previous screen.
>>> If you do not remember the exact name of the field, or the exact condition or list, place a '?' in each field and
Press ENTER.
>>> Place an 'X' next to the Manager Status Code. Press ENTER.
GEN
? Field Name Type
_ Company ID CDE ABCD K
_ Employee ID CDE AECD K
_ Employee Name TXT AETX A
_ Employee Address TXT AFTX A
_ Employee City TXT AGTX A
_ Employee State CDE AFCD A
_ Employee Status STS ACST A
_ Employee Zip Code NBR ABNB A
_ Rate of Pay PRC ADPR A
X Manager Status Code STS ADST A
_ Job ID CDE ADCD A +
1 - 88
Synon Made Simple Data Modeling
All of the conditions or lists of conditions for that field are displayed.
>>> Select the list Managers. Place an 'X' next to Managers. Press ENTER.
The fields and conditions selected on the previous screens are returned to the Edit Access Path Conditions
Screen. It's important to recognize that with Select/Omit criteria as well as any other aspect of Synon, whenever you
condition or select specific values for a field, the selection or condition must be made on the English-like name of the
field, NOT THE ACTUAL VALUE(S).
In our example, a list of values, called 'MANAGERS' was selected, not the actual values (E,M, or S) found in
the file.
>>> Press ENTER to confirm. Then press F3 until you return to the Edit File Details screen.
1 - 89
Synon Made Simple Data Modeling
You will recall we set a file to file relation (Employee Master Refers To Employee Master) so the Employees
manager ID is contained and validated within that record. But there is a problem. The standard Synon Retrieval access
path contains records for all employees (management and non-management). So when the Employee Master Refers To
Employee Master relation was set up, nothing was done to insure the automatic referential integrity checking is checking
against managers only. The traditional way of performing this validation, is to create a subroutine and copy it from
program to program. With Synon, this validation or BUSINESS RULE can be specified directly in the access path.
? Typ Access path Source mbr Key Index options Auto add
_ PHY Physical file UUAEREP NONE ATR ONLY
_ UPD Update index UUAEREL0 UNIQUE IMMED ATR ONLY
Z RTV Retrieval index UUAEREL1 UNIQUE IMMED ATR ONLY
_ RSQ Employee Master by Name UUAEREL2 FIFO IMMED ATR ONLY
_ QRY Open Qry by Job Descption UUAEREL3 FIFO ATR ONLY
_ RTV Managers Only UUAEREL4 UNIQUE IMMED DYNSLT ATR ONLY
_ ___ _________________________
_ ___ _________________________
>>> Zoom into the Retrieval index access path. Press ENTER.
1 - 90
Synon Made Simple Data Modeling
Now let's look at the access paths used or associated with the Retrieval access path.
>>> Place an 'R' in the subfile selection field, next to the format name. Press ENTER.
The Edit Access Path Relations screen displays the actual Data relations specified in the data model.
_ * Known by Employee ID
1 - 91
Synon Made Simple Data Modeling
Now you will see the Refers To relations. You will notice the Employee Master (from the Employee Master
Refers To Employee Master) uses the default retrieval access path for validation. This access path contains all employee
records (management and non-management), therefore, any valid Employee ID could be entered in the Manager
Employee ID field and validated. To insure the validation is performed against an access path containing only
managers, the default Retrieval access path must be changed.
>>> Place an 'A' in the subfile selection field next to the 'Refers To Employee Master'. Press ENTER.
The Display File Access Paths screen shows all of the Retrieval access paths defined for the file being referred
to.
>>> Place an 'X' in the subfile selection field for Managers Only. Press ENTER.
Access path
_________________________ <== Position display
? Typ Access path Source mbr
X RTV Managers Only UUAEREL4
_ RTV Retrieval index UUAEREL1
1 - 92
Synon Made Simple Data Modeling
The Edit Access Path Relations screen, now shows the access path used for the Refers To Employee
validation is the Managers Only access path.
>>> Press F3 until you return to the Edit Database Relations panel.
1 - 93