Type in the name of the DATA DICTIONARY to be used with this structure. If a new structure is being created, the default data dictionary name will be the same as the structure name. The default extension is .DEF. This is illustrated in Section 16.2.2, Database Engine.
As with the data set, the same data dictionary can be used for a number of structures. In fact, any combination of definition, data and structure files can be created:
structure files data set data dictionary CUSTOMER.STR CUSTOMER.DEF \ / \ / \ / \ / \CUSTOMER.ARS/ / \ / \ / \ / \ SALES.STR SALES.DEF
The data dictionary name can be any Windows file specification.
After you have selected the structure and data dictionary that you will be working with, the other options in the Structure Definition window can be used to perform SETUP procedures.
Inside the STRUCTURE DEFINITION WINDOW click on [Properties]. The FIELDS window will appear.
|Example 16-6 Structure Definition Window|
The options inside the Fields window will enable you to perform the following procedures in SETUP on the selected data dictionary:
|Example 16-7 Fields Window|
Clicking on [ADD] will open the FIELD DEFINITION window. This selection is used to add data fields to new or existing data dictionaries. Here you can enter in the following information for each data field:
|Example 16-8 Field Definition Window|
When you have completed adding all of the field information inside the Field Definition window, click on [DONE]. The field definitions will then be added to the DATA DICTIONARY. You will be returned to the Fields window where you can either perform other functions or choose [Finish].
If this is a new structure, the new structure file will be created after you click on [Finish].
Enter the data field NAME inside the NAME input field. For example, name a data field "CUST_ID" that will store customer identification information.
The field name:
Note that the Description, Prompt Text and Report Heading fields will default to be the same as the data field name. This default may be changed.
The CLASSIFICATION input field should be left blank at this time.
The Description input field will default to the same as the data field NAME that was entered. Any "$", "%", "_" characters will be changed to spaces.
You may type in any description you want for this data field. This description is shown when viewing the data dictionary.
The description can consist of any characters on the keyboard and be up to 30 characters long.
Beside the DATA TYPE input field, click on the down arrow to select a data type. The data type is the internal representation of the data.
The most common data type is CH (character) which is the default. Use CH as the data type when defining names, addresses, money, date/times.
The other datatypes that follow such as IN (integer), IU (integer unsigned), ... are provided for special cases where there is pre-existing binary data that must be defined.
When developing new applications, use the CH datatype.
The data type will be one of the following:
|AC||ASCII counted string|
|AP||Pointer to ASCII counted|
|C3||COBOL comp-3, also known as packed decimal|
|DS||Date stamp (length=8)|
|RS||Right sign separate|
|ZN||Zoned numeric; used by DIBOL|
The DATE (DS) attribute is currently only used by applications and has no effect within SheerPower.
Enter the STARTING POSITION for this data field. The first field starting position will be defaulted as position 1.
Fields generally follow each other directly. Therefore, the first position of a new data field is usually one more than the last position used. If the last position used was ten, the next data field would start at eleven. SheerPower automatically defaults the starting position of each data field to the correct sequential position.
Defining Existing ARS File Fields
When defining data fields for an existing ARS file, keep in mind that the starting position of an ARS file record is 0 and in SheerPower, the starting position is 1. (ARS is 0 oriented, whereas SheerPower is 1 oriented.) For example, if the ARS file data field starts in position 0, when you define this data field in SheerPower, you must define the data field as starting in position 1. If the ARS data field starts in position 20, you would use 21 as the starting position, etc.
Enter the LENGTH required for the field. The default value shown for every data field added is 1 character. The length should be the maximum number of character positions that data in this data field may contain. Data fields can be any length. The length must be given as an integer number.
If a CH or UN data type field has a first position that starts at or before the end of a record (row), that field will have its length adjusted upon reference. The new length will reflect the actual end of the record (row).
For example, if you made a data field called ALL, and it started in position one with a length of 5000 bytes---and the actual record length was 1200 bytes, referencing the ALL field would return just 1200 bytes.
Inside the OCCURS input field, type in the number of times that this data field occurs in the data record. The default number of occurrences is 1. If the data field being defined is an array, enter the number of elements in the array. Otherwise, leave the default value of 1.
Enter the PROMPT TEXT for this data field. The prompt text will be used when data is entered for this field. The prompt text:
The default prompt text will be the data field NAME you entered for this field.
Enter the SEMANTICS (attributes) that apply to this data field. The semantics describe what type of data will be in the field.
The default semantic is UC (uppercase). To change semantics, or to add/remove from the list, click on [Change]. The semantics window will open. Place a checkmark beside a semantic you want to add, and remove the checkmark from beside any semantic you want to remove.
For example, if a dollar amount will be stored into this field you would select MONEY. This will set the semantics for this field to NUM:2 (numeric field with two decimal places) and RJ (right justified).
|Example 16-9 Semantics|
Setting/defining semantics is optional. If you do not want any pre-defined semantics for the field, remove the UC semantic and click okay to leave the semantics list blank.
The semantics options are:
|NUMERIC||Indicates a numeric field which allows only numbers. The semantic RJ, right-justified, is automatically appended when NUMERIC is selected. If you select this you will also fill in Decimal Digits to define how many decimal places the field contains.|
|MONEY||Specifically sets the field up as a numeric dollar field with two decimal places and right-justified.|
|RJ||The data will be right-justified in the field.|
|UC||All letters will be stored in upper-case format. Additionally, field comparison data will be upper-cased prior to any comparison.|
|ZF||The data will be zero filled.|
|ZS||Causes all leading zeros to be suppressed.|
|DATE[:YMD|MDY]||This field contains a date. The field must be six or eight digits long. The default date format is YMD. You can enter DATE or optionally, specify the date format. The date format is currently only used by applications. SheerPower does NOT automatically switch date values into or out of the format specified.|
|FULLTIME||Indicates that the field contains a date-time stamp and the time value is to be preserved. By default, SheerPower stores/retrieves only the date portion of a date stamp field.|
|APPLICATION:name||This is a user defined semantic and is not used by SheerPower. A user can assign a name to indicate that the field is related to a specific application (i.e. accounting). Application programs can then ask for the application name and perform some action based on the data.|
|DBFLD:fieldname||This is a special semantic for augmented definition files only. The DBFLD semantic is used to associate an augmented field definition with an actual database field. Fieldname is the actual name of the field in the database.|