• Keine Ergebnisse gefunden

ACCESS AND THE PILE STRUCTURE

Im Dokument The Picl(System (Seite 190-194)

TYPE II VERB The type II verbs

6.6 ACCESS AND THE PILE STRUCTURE

ACCESS is designed to take advantage of the file structure available on this machine. Usually, the data is in the data section of the file and the data definition items are in the dictionary of the file.

ACCESS files are made up of elements found in files, and values related to the actual data to be retrieved. The verb definition, file definitions, modifiers and relational operators must be in the master dictionary.

Attribute definition items are normally found in the dictionary of the data file to which they relate.

6.6.1 THE USING CONNECTIVE.

The USING connective allows the specification of the file to be used as the dictionary in the ACCESS sentance in place of the standard dictionary.

FORMAT:

USING DICT FILENAME USING FILENAME

The first references the dictionary of the file FILENAME; the second references the data-level file FILENAME. Note that the data-level file may be of the form FILENAME,SUBFILENAME. In these cases all data definition items will be taken from the file referenced by the USING connective, except those data definition items which default to the master dictionary, as below.

Only one USING connective is allowed in an ACCESS sentence. The USING connective must be immediately followed by either DICT FILENAME or FILENAME. The source of the data processed remains specified by the conventional file name element in the sentence.

CHAPTER 6 - ACCESS Copyright (c) 1985 PICK SYSTEMS PAGE 177

LIST WORKFILE USING DICT TESTDICT The data source will be WORKFILE.

The data definition items will be retrieved from DICT TESTDICT.

The default data definition items will be used.

LIST DICT WORKFILE USING DICT WORKFILE

The data and data definition items have the same source.

Examples of the USING connective.

6.6.2 MASTER DICTIONARY DEFAULT

If the data definition item is not found in the dictionary specified for the file, then the ACCESS compiler will search the master dictionary for the data definition item, and will include it if found.

6.6.3 SEQUENCE OF RETRIEVAL (items from files)

The ACCESS compiler takes two passes to retrieve all the definitions from files which it needs to execute a sentance. The first pass uses the master dictionary to find the file names and all modifiers and relational operaters in the sentence. Any data defintion items found in the master dictionary will be ignored on this pass. When the input string is exhausted, the compiler proceeds to look up all undefined terms in the dictionary-level file either implicitly defined by the sentence or explicitly defined by the USING connective. Items which are found are included in the string in the proper location. If an item is not found in the specified dictionary, then the compiler will look it up in the master dictionary. If it still does not find the item in the master dictionary, it will concatenate a blank and the next data definition item-id in the string to the missing item-id. The compiler will attempt to look up this new key in the dictionary-level file and the master dictionary. This process will terminate either when a data definition is retrieved or the list of data definition items is exhausted.

The compiler does not look up elements in the string which are enclosed in quotes, single quotes, or back-slashes. These are taken to be literals rather than variables. They have the effect of terminating a string of data definition item-ids.

6.6.4 ITEM-ID DEFINITIONS WITH Q-POINTERS

The file definition item in an ACCESS sentence allows the use of attributes 7, 9, and 10 as meaningful elements in the data definition.

The label comes from the D- or Q-pointer name because attribute 3 of the D- or Q- pointer is in general otherwise occupied. Attribute 2 is obviously forced to O. Note that the selection, sort and output processors all ignore attribute 8. The selection and sort processors take the item-id as it is; the output processor allows the use of an attribute 7 conversion.

CHAPTER 6 - ACCESS Copyright (c) 1986 PICK SYSTEMS PAGE 178

The justification is of importance to both the sort and output processors;

the field length is of importance to the output processor, especially if the item-ids are significantly longer than the file name or its nominal field length, and especially in the columnar processor. Note that item-ids do not fold, unlike other data processed by the columnar processor.

All of the characteristics of item-id handling may be got around by using a data definition item which references data attribute 0 with ID-SUPP. If a Q-pointer is used to reference a file, the contents of attributes 7, 9, and 10 in the Q-pointer definition take precedence over the those attributes in the D-pointer if they exist in the Q-pointer. Those that do not exist in the Q-pointer will be retrieved from the D-pointer. In the case that they do not exist in either, attribute 7 will be defined as null, attribute 9 will become L and attribute 10 will become 9. These defaults will be taken for all data definition items processed by the ACCESS compiler.

This allows the creation of multiple Q-pointers which treat the item-id field in different ways.

6.6.6 DELIMITERS AND ITEM-ID STRUCTURES

In TeL the universal del1miter 1s & blank. Verbs, file names, connectives and data definition names are normally delimited by blanks. Non-ACCESS verbs which reference files and items will take a string of characters which is delimited by blanks to be the file name or one of the item names, depending on its location in the command se~uence.

If one constructs an ACCESS sentence which references a data definition item which it cannot find in either the specified file dictionary or the master dictionary, it will then generate another item-id by taking the item-id for which a record did not exist and concatenate the next string delimited by blanks in the sentence to it, with a blank between the two character strings. This will now be used as an item-id. This is why the error message which is trying to tell you that the data definition item is not on file may includes more elements of the ACCESS sentence. For example, if in the example below, the data definition item DOG is not on flle,

LIST MD CAT DOG RAT The error message

[24] THE WORD "DOG RAT" CANNOT BE IDENTIFIED Will be returned.

The se~uence of concatenated strings will terminate at the end of the sentence, or at the first connective, value, or item-id which succeeds the unidentified word.

This means that a blank is, in general, a character which is allowable for item-ids in the system. If you wish to EDIT a item-id which includes one or more blanks, enclose the string in one of the value delimiters above.

You may also use the delimiters within a string Simply use a delimiter which is not part of the surrounding delimiter.

enclosed in delimiters.

item-id as the

value-CHAPTER 6 - ACCESS Copyright (c) 1986 PICK SYSTEMS PAGE 179

EXAMPLE:

If DOG RAT is &n &ttribute definition item in MD, then

LIST MD DOG RAT Will return the one &ttribute definition item whose n&me

is DOG RAT.

In order to modify the item DOG RAT, use the form

EDIT MD "DOG RAT" Which will obt&in the item.

If you have an item named O'HARA, use the form LIST MD "O'HARA"

Simil&rly, the form

This will return the item O'HARA.

SELECT CUSTOMERFILE WITH LASTNAME "O'HARA"

Will find &11 the O'HARAs in the file CUSTOMERFILE.

Ex&mples of infrequent but leg&l item-ids.

CHAPTER 6 - ACCESS Copyright (c) 1985 PICK SYSTEMS PAGE 180

Im Dokument The Picl(System (Seite 190-194)