Information Technology Reference
In-Depth Information
hierarchy. More importantly, it also gives one a way of calculating the locations of
DVs and sub-structures and a way of referencing them.
DVs in a binary data file are in a sequence (one after the other), but the intended
structure is usually a logical tree. Figure 7.8 shows a tree structure of several DVs,
here only the size in bits of the DVs is important but for clarity sake we have indi-
cated that the element is the start of the data file (at 0 bits and zero size and can also
be considered as a record), boxes marked “<Element DV n>” are individual values,
those marked “<Element Records>” are containers or records (zero size) and those
marked “<Element DV(s) n>” are arrays of values.
One can think of walking through the tree starting at the location <Start of Data>
and then going directly to <Element Record> and then to <Element DV 3>. Using
this information it is possible to provide a simple statement (path statement) that
represents this walk-through by separating each element name with a $ sign, so
for this example (Example 1 in Fig. 7.8 ) the path statement would be $<Start of
Data>$<Element Record>$<Element DV 3>. Given the tree structure and the path
statement you can reference a data element uniquely.
This path statement can be related to the exact location of the DV in the data
file. To do this we first have to realise that elements in the same column in the
tree (vertically aligned) that appear above the element we are trying to locate are
located directly before it in the data file (as long as they are part of the same record).
In this case <Element DV(s) 2> is in the same column and record in the tree as
<Element DV 3> but it above it and so appears before it in the data file. <Element
DV(s) 2> is actually an array of values and so there are in fact five 64-bit DVs
before it.
Adding a predicate to the path statement can allow the selection of an individual
element of the array, for example, $<Start of Data>$<Element Record>$<Element
DV(s) 2>{2}, where the predicate represented as {2} indicated that the second
element of the array should be selected.
7.3.2.3 Conditional Data Values
Elements or records in the logical structure may be conditional, which means
that they may or may not exist, depending on the result of a logical expression
(true if it exists or false if it does not exist). There may also be a choice of ele-
ments or records in the data from a list, where only one of the choices exists in
the data.
A logical expression may consist of one or more DVs combined using the logical
operators AND, OR, NOT etc. Typically the DVs in the expressions are either a
Boolean PDT or and integer data type that is restricted to have the values 0 or 1,
they could also be the string “true” or “false”. The result of evaluating the expression
will either be true or false (0 or 1) and will indicate whether the value exists (true) or
not (false). The expressions are dynamic as they contain DVs, so one data file may
contain a given element or record but another may not depending on the DV in the
specific data file.
Search WWH ::




Custom Search