Creating Attribute-Defining Items

Now that the file is created, the attribute-defining items can be created.

ud addresses f.name

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 1

:

:

:

:

: T

: 10

:

:

:

: First Name

:

:

 

:

 

ud addresses l.name

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 2

:

:

:

:

: T

: 15

:

:

:

: Last Name

:

:

 

:

 

ud addresses addr

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 3

:

:

:

:

: T

: 30

:

:

:

: Address line-1 (street address)

:

:

 

:

 

ud addresses city

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 4

:

:

:

:

: T

: 30

:

:

:

: City

:

:

 

:

 

ud addresses st

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 5

:

:

:

:

: T

: 2

:

:

:

: State

:

:

 

:

 

ud addresses zip

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

 

 

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 6

:

:

:

:

: N

: 10

:

:

:

: Zip code

may be : 00000

or : 00000-0000

:

:

 

:

 

ud addresses phone.category

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

 

 

 

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 7

: Category

:

:

: a7(tPHONE.CATEGORIES;c;;1)["1","5"]

: L

: 5

: iPHONE.CATEGORIES;a1

:

:

: Telephone number "category"

(show only the 1st 5 characters)

Translate to another file to keep the

categories.

:

:

 

:

This requires a separate file to be built for phone.categories. Zero is the category code and one is the category description.

The description is entered in the phone.category attribute-defining item. It gets the item-ID of that item, and the attribute-defining item correlative translates the item-ID into the description stored in attribute 1.

The phone.categories file needs an index built on attribute 1 to work with the Update Processor.

create-index PHONE.CATEGORIES a1

ud addresses phone.no

 

 

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

 

 

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

 

 

 

 

18 hotkey.all

19 hotkey1

:

28 hotkey0

: a

: 8

:

:

:

: aif 8(mcn) = 8 then if 8(L7) = “1” then 8(MR###-

####) else if 8(L10) = “1” then 8(MR###-###-

####) else 8

: R

: 12

:

:

:

: Telephone Number

If nonnumeric, then “special”. Show it as-is.

If 7 digits, then “local”.Format as: ‘000-0000’

If 10 digits, then “area code”.Format as:’000-

000-0000’

:

:

 

:

In the processing codes above, a telephone number is defined to be either seven or ten digits. If anything else is entered, it is regarded as special and is stored as is. In this way, extensions may be entered as 261-7425 ex. 100.

That defines all of the attributes but a few additions make this even better:

ud addresses lf.name

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: s

: 0

:

:

:

: a2:”, “:1

: T

: 27

:

:

:

: Last Name, comma, First Name

:

:

 

:

 

ud addresses fl.name

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

18 hotkey.all

19 hotkey1

:

28 hotkey0

: s

: 0

:

:

:

: a1:” “:2

: T

: 27

:

:

:

: First Name and Last Name

:

:

 

:

 

ud addresses address

01 dictionary-code

02 attribute-count

03 substitute-header

04 structure

07 output-conversion

08 correlative

09 attribute-type

10 column-width

14 input-conversion

15 macro

16 output-macro

17 description

 

 

18 hotkey.all

19 hotkey1

:

28 hotkey0

: s

: 0

:

:

:

: a3:” “[“1”,”30”]: 4:”, “:5:” “:6

: T

: 30

:

:

:

: Show:

street.addr

city, st zip

:

:

 

:

The additional attribute names lf.name, fl.name, and address allow several attributes to be combined.

See Also

Sample Database Design and Creation

Deciding on Attributes and Definitions

Creating the File

Editing the File-Defining Item

Creating Indexes

Connecting to the Database