Anda di halaman 1dari 109

Page 2151

Chapter 7

Extracting Data
In this Chapter

Introduction
Desurveying Data
Cross-Referencing Data
Creating the Extraction File
Using the Extraction File

Introduction
Some functions within Gemcom for Windows require the creation of
a subset of data called an extraction file. The extraction file is a file
that contains data that has been extracted from the workspace. The
file is used in Gemcom for Windows for the following functions:

Univariate statistical analysis (see Chapter 12: Statistical


Analysis).

Three-dimensional semi-variogram analysis (see Chapter 13:


Semi-Variogram Analysis).

Symbol plot creation (see Chapter 20: Symbol Plane Plots).

Grid creation (see Chapter 24: Gridding and Contouring).

The extraction file can also be used by other Gemcom systems (such
as PC-MINE) for grid creation, surface topography modelling and
block model creation.

Exploration

Chapter 7: Extracting Data

Page 2152

The extraction file only contains information about point data.


Therefore, data that is stored in the workspace in other workspace
types (such as data in traverse, drillhole and polygon workspaces)
must be converted into point form when the data is extracted from
the workspace. This conversion process in traverse and drillhole
workspaces is called desurveying as it involves converting the
survey data into coordinate form. Desurveying takes place
automatically when you extract data.
The extraction file has a very limited capability for extracting
different data types and data quantities. The file can contain the
coordinates of each point extracted and data from up to three fields.
The file is restricted to the following items:

The location of the point extracted. This information is


extracted automatically.

A single real data type, extracted from a field with a real,


double, coordinate, integer, or angle data type from the header
table or the tables identified as the extraction source and crossreference tables.

A single integer data type, extracted from a field with an


integer data type from the header table or the tables identified
as the extraction source and cross-reference tables. Note that
this integer is limited to values in the range -32767 to +32767.

A single character string with up to six characters, selected


from the header table or the tables identified as the extraction
source and cross-reference tables.

If you need to create text files with more extensive data types using
selection criteria, you can do this using the reporting tools.
Each record in the extraction file contains data from one record in
the workspace. Data can be extracted from the workspace provided
that it satisfies a set of selection criteria. There is no limit to the
number of points that may be stored in an extraction file. Records
in the workspace that do not contain data in all of the specified
extraction fields will not be extracted.

Section II: Workspaces

Gemcom for Windows

Page 2153

There may be some limits imposed on the number of points in an


extraction file by the individual applications that process the
extraction file. See the appropriate chapters in this manual that
describe the applications that process extraction files for these
limits.

You can create as many extraction files as you want by giving each
extraction file a unique file name.

Desurveying Data
When you extract data from any workspace, the location of the
record being extracted will be determined. This location is either
determined from the contents of a coordinate field in the table
being extracted, or it is calculated by desurveying a combination of
data in other workspace tables.

Point Workspaces
If you are creating an extraction file from a point workspace, the
location of the sample in the extraction file comes directly from the
contents of a coordinate field called LOCATION. This field must be in
the table being extracted.

Traverse Workspaces
Traverse workspaces are used to describe data located along
straight lines in two- or three-dimensional space. These lines can be
defined using a starting coordinate, a traverse length, and an
azimuth and optional dip angle; or a starting and an ending
coordinate. Samples are stored in the header table in length, length
and dip, or location format.

Exploration

Chapter 7: Extracting Data

Page 2154

Data in the header table. All the data stored in this table
describes the traverse as a whole. When extracting data from
this table, one point is extracted per traverse. The coordinate of
this point is obtained directly from a coordinate field called
LOCATION.

If your traverse workspace has secondary tables, data will be


extracted from these tables as described below:

Secondary table data in distance format. This format is


used to describe data at points along the traverse line. The
value stored in each record in the DISTANCE field defines the
distance of the point sample from the start of the traverse. Each
record in this table will create one point in the extraction file.
The coordinate of each point is determined by simple geometry,
using the starting point of the traverse, the direction of the
traverse, and the distance along the traverse to the sample.
Plan View

N
Azimuth (+ optional dip)
Distance to
each sample

Samples at points
along traverse

Known coordinate
(X, Y, optional Z)

Traverse Type 1
Distance to
each sample

Samples at points
along traverse
Known coordinate
(X, Y, optional Z)

Known coordinate
(X, Y, optional Z)

Traverse Type 2

Figure 7-1: Traverses in distance format

Secondary table data in interval format. This format is


used to describe data that is recorded for intervals along each

Section II: Workspaces

Gemcom for Windows

Page 2155

traverse line. The value stored in each record in the FROM field
describes the distance from the starting point of the traverse to
the start of the interval. The value stored in the TO field
describes the distance to the end of the interval. Each record in
this table will create one point in the extraction file.

The coordinate of each point is determined by simple geometry,


using the starting point of the traverse; the direction of the
traverse; and either the FROM value (the start of the interval),
the TO value (the end of the interval), or the average of the
FROM and TO values (the mid-point of the interval).
Plan View

Azimuth (+ optional dip)


FROM Distance
TO Distance

Samples over intervals

Known coordinate
(X, Y, optional Z)

Traverse Type 1
FROM Distance
TO Distance

Samples over intervals


Known coordinate
(X, Y, optional Z)

Known coordinate
(X, Y, optional Z)

Traverse Type 2

Figure 7-2: Traverses in interval format

Secondary table data in point format. This format is used


to describe data at points along the traverse line. The value
stored in each record in the LOCATION field defines the 2D or 3D
coordinates of the point sample. Each record in this table will
create one point in the extraction file.

Exploration

Chapter 7: Extracting Data

Page 2156

Drillhole Workspaces
Drillhole workspaces are used to describe data that is located along
surveyed lines. These lines are located in three-dimensional space
by a starting point with a known location (generally the collar of
the drillhole), and survey data consisting of azimuth and dip angles
measured at intervals along the drillhole. Samples are stored in the
header table or in secondary tables in distance, interval or point
format.

Data in the header table. All the data stored in this table
describes the drillhole as a whole. When extracting data from
this table, one point is extracted per drillhole. The coordinate of
this point is obtained directly from a coordinate field called
LOCATION.

Secondary table data in distance format. This format is


used to describe data at points along the drillhole. The value
stored in each record in the DISTANCE field defines the distance
of the point sample from the start of the drillhole. Each record
in this table will create one point in the extraction file.

The coordinate of the point in the extraction file is obtained by


calculating a complex three-dimensional line, using the collar of
the drillhole, the survey data and the distance along the drillhole to
the sample. This three-dimensional line undergoes smoothing to
ensure a gradual curve is introduced between each survey point.

Secondary table data in interval format. This format is


used to describe data that is recorded for intervals along each
drillhole. The value stored in each record in the FROM field
describes the distance from the collar of the drillhole to the
start of the interval. The value stored in the TO field describes
the distance from the collar of the drillhole to the end of the
interval. Each record in this table will create one point in the
extraction file.

Section II: Workspaces

Gemcom for Windows

Page 2157

Section View

Hole-ID
Collar of hole
Known coordinate
(X, Y, Z)
Distance along
hole to sample
Drillhole trace

Samples at points
along drillhole

Survey points
(known dip, azimuth,
and distance from
collar)

Figure 7-3: Drillholes in distance format


Section View

Hole-ID
Collar of hole
Known coordinate
(X, Y, Z)

TO distance
FROM distance

Drillhole trace

Survey points
(known dip, azimuth,
and distance from
collar)

Samples at points
along drillhole

Figure 7-4: Drillholes in interval format

Exploration

Chapter 7: Extracting Data

Page 2158

The coordinate of the point in the extraction file is obtained by


calculating a complex three-dimensional line. This requires the
collar of the drillhole; the survey data; and either the FROM
value (the start of the interval), the TO value (the end of the
interval), or the average of the FROM and TO values (the midpoint of the interval). This three-dimensional line undergoes
smoothing to ensure a gradual curve is introduced between
each survey point.

Secondary table data in point format. This format is used


to describe data at points along the drillhole. The value stored
in each record in the LOCATION field defines the 2D or 3D
coordinates of the point sample. Each record in this table will
create one point in the extraction file.

Polygon Workspaces
Polygon workspaces are used to describe data that refers to
polygons as complete entities. For this reason, data in polygon
workspaces is generally not appropriate for extraction files, which
store data for individual points.

Cross-Referencing Data
When working with drillhole or traverse workspaces, you can
extract data from secondary tables other than the table being
extracted. You can also define selection criteria for one field in one
table other than the table being extracted. This is done by crossreferencing to another table.
There are two relationships between records in different secondary
tables:

Through the header table. Each record in a secondary table


is owned by a record in the header table. This is done through
the one-to-many relationship defined by the hierarchical nature

Section II: Workspaces

Gemcom for Windows

Page 2159

Interval Interval

Interval Distance

Distance Interval

Distance Distance

Circled values are cross-referenced


Figure 7-5: Cross-referencing between tables
of the workspace. A record in one secondary table can only be
related to a record in another secondary table if they are both
owned by the same record in the header table.

Through the location of the records. The data in each


record in a secondary table defines a unique location along the
traverse or drillhole. These locations are defined by the values
in either the DISTANCE fields (distance format) or in the FROM
and TO fields (interval format). A record in a secondary table is
only related to a record in another secondary table provided
that they are owned by the same header record and one of the
following conditions is met:

Both secondary tables are in interval format. The average of


the FROM and TO values in the first table lies between the
FROM and TO values in the second table.

The first table is in distance format and the second table is in


interval format. The value in the DISTANCE field in the first
table lies between the FROM and TO values in the second table.

Exploration

Chapter 7: Extracting Data

Page 2160

The first table is in interval format and the second table is in


distance format. The value in the DISTANCE field in the second
table lies between the FROM and TO values in the first table.

Both tables are in distance format. The value in the


DISTANCE fields in both tables must be equal.

If cross-referencing is being used to define the data to be extracted,


the values in the various fields in one record in the extraction file
will be obtained from the cross-referenced records in the workspace.
This is illustrated in the following example.
Table to be extracted
Real value to be extracted
Integer value to be extracted
String value to be extracted
LITHOLOGY

ASSAYS
ASSAYS:GOLD
LITHOLOGY:ROCK-CODE
HEADER:HOLE-ID

ASSAYS

Values in extraction file


REAL

INTEGER

Figure 7-6: Example of cross-referencing


In this case, the ASSAYS table is the controlling table. The crossreference table is the LITHOLOGY table. Each record in the
extraction file will come from each record in the ASSAYS table. The
real value in the extraction file will come directly from the value in
the GOLD field in the ASSAYS table. The integer value in the
extraction file will come from the integer field called ROCK-CODE in

Section II: Workspaces

Gemcom for Windows

Page 2161

the LITHOLOGY table, using the record whose FROM and TO values
are less than and greater than the average of the FROM-TO values in
the ASSAYS table.
If cross-referencing is being used to define selection criteria, the
values in the cross-referenced record and field will be used to
determine whether the record in the table being extracted will be
selected or not.
Using the same example as above, the following cross-reference
selection criteria has been added:
Cross-reference table
Cross-reference field
Matching string

LITHOLOGY
ROCK-TYPE
PY*

Records from the ASSAYS table will now only be extracted when the
string value in the ROCK-TYPE field in the LITHOLOGY table for crossreferenced records starts with the characters PY. If the string in the
ROCK-TYPE field starts with any other character combination the
ASSAYS table record will not be extracted.
LITHOLOGY

ASSAYS

Values in extraction file


REAL

INTEGER

Figure 7-7: Example of cross-referencing with selection criteria

Exploration

Chapter 7: Extracting Data

Page 2162

Creating the Extraction File


To create an extraction file from within Gemcom for Windows,
follow these steps:
1. Select Workspace } Extract a Subset of Data } Create Extraction File.
2. The Define Extraction Parameters dialog box will appear.
This dialog box consists of four parts, represented by four tabs:

File name. Specify the file name and path for the
extraction file.

Data. Define the tables and fields from which the data is to
be extracted.

Location. Limit the data extracted to a specific area in space.

Filter. Limit the data extracted using specific parameters.

Each of these tabs will have a number of parameters that must


be entered, as explained in detail in the sections below.
3. When all appropriate parameters have been entered, click OK.
4. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
5. A status window will appear, displaying the progress of the
extraction file creation. When the process is complete, click OK.

File Name
This part of the Define Extractions Parameters dialog box is where
you will specify the target name and path of your extraction file. Enter
the following parameters:

Extract File Path. All extraction files are saved in the


\GCDB**\EXTRACT subdirectory unless you define a different

Section II: Workspaces

Gemcom for Windows

Page 2163

Figure 7-8: Define Extraction Parameters dialog box (File Name


tab)
path. If you wish to save the file to a different directory or
subdirectory, you can click the Select button to bring up a file
creation dialog box, which you can use to select the desired
path.

Extract File Name. Enter a name for your extraction file.


Extraction files are given the default suffix .MEX by the
program. Do not change this default. If you change the suffix,
Gemcom for Windows and other Gemcom systems will not
recognize the file as an extraction file, and thus will not be able
to use it.
If you wish to overwrite or append data to an existing
extraction file, you can click the Select button beside the
Extract File Name parameter to bring up a file selection
dialog box. Use this dialog box to choose the name of the file you
wish to use.

Exploration

Chapter 7: Extracting Data

Page 2164

Description. Enter a brief description of your extraction file, if


desired.

Extraction Options. Select one of the following two options:

Overwrite. Select this option if you wish to overwrite an


existing extraction file of the same name.

Append. Select this option if you wish to append extracted


data to an existing extraction file of the same name.

Data
In this part of the Define Extraction Parameters dialog box, you
will define which data is to be extracted. Enter the following
parameters:

Data to be Extracted from Table. Select the name of the


table which contains the data to be extracted. This table
controls how the locations of each point in the extraction file are
calculated. See Desurveying Data on page 2153.
For example, in a drillhole workspace, you may define the
ASSAYS table as the table being extracted. This means that each
point in the extraction file will consist of a single record from
the ASSAYS table.

Cross Reference to Table. Select the name of the table (if


any) to which you wish to cross-reference extraction data. For
more information, see Cross-Referencing Data on page 2158.

Reference position. If the workspace is a drillhole or traverse


type of workspace, you can control the location of the point
being extracted within the sample. See Desurveying Data on
page 2153. Select one of the following three options:

Section II: Workspaces

Use FROM. Select this option to use the value in the FROM
field for each record.

Gemcom for Windows

Page 2165

Figure 7-9: Define Extraction Parameters dialog box (Data tab)

Use Middle. Select this option to use an average of the


values in the TO and FROM fields for each record.

Use TO. Select this option to use the value in the TO field for
each record.

Occurrences to be extracted. If the workspace is a drillhole


or a traverse type, you can control the number of occurrences of
samples within each drillhole or traverse. Select one of the
following options:

First Occurrence. Select this option to extract the first


sample from each drillhole or traverse.

Last Occurrence. Select this option to extract the last


sample from each drillhole or traverse.

All Occurrences. Select this option to extract all samples


from each drillhole or traverse.

Exploration

Chapter 7: Extracting Data

Page 2166

Nth Occurrence. Select this option to extract the nth


sample from each drillhole or traverse. If you select this
option, you will also have to enter the following parameter:
Occurrence Number. Enter a number to
determine which sample along each drillhole or
traverse will be extracted.

In the area of the data tab entitled Extraction Source, you can
assign fields to the real, integer and character fields in the
extraction file. You are not, however, required to extract all three
kinds of data. Enter the following parameters for each type of field
you wish to add to the extraction file:

Table Name. Select the table which contains the field values
you wish to extract. You can select fields from the table
designated as the extraction table, the table designated as the
cross-reference table, or the header table. If one of these tables
is not listed, it is because that table does not contain any fields
of the specific type you are extracting. If you do not wish to
extract this type of data, select NONE.

Field Name. Select the field which contains the values you
wish to extract. Only fields of the appropriate type will appear
in the list.

Default. If you have not selected an extraction source for a


particular field type, you can specify a default value to be
entered in the extraction file in the column for that field type.

Location
In this part of the Define Extraction Parameters dialog box, you
can define upper and lower bounds for the northing, easting and
elevation coordinates for extracted data. In this way, you can limit
the data extracted to a specific location in space.
If upper and lower bounds are left at their default values of
99999999.00 and -99999999.00, data from all locations will be
Section II: Workspaces

Gemcom for Windows

Page 2167

Figure 7-10: Define Extraction Parameters dialog box (Filter tab)


extracted, subject to any filtering restrictions set under the Filter
tab.

Filter
This part of the Define Extraction Parameters dialog box allows
you filter extracted data by specifying selection criteria for any of
the fields in the Header table and the tables selected under the
Data tab as the extraction table and the cross-reference table (if
indicated): Only data from records meeting these selection criteria
will be extracted to the file.
If the parameters under this tab are left blank, data will be
extracted from all records (subject to any spatial restrictions set
under the Location tab).

Exploration

Chapter 7: Extracting Data

Page 2168

Enter the following parameters as required for each field you wish
to use to filter the extraction data. Note that the fields selected here
do not have to be the fields which contain data to be extracted.

Field. Select the name of the field which contains the data you
wish to use to limit data extraction.

Axis. Select X, Y or Z if you specified a coordinate field above.

Lower Bound and Upper Bound. If the field you specified is


any type of field other than a character or logical field, you can
specify lower and upper bounds for the data. Any records
containing data in the field that fall outside of these bounds will
not be added to the extraction file.

Matching String. If the field you specified is a character or


logical field, you can specify a character string which the field
must contain in order for data from that record to be extracted.
You can use the wild card characters * and ? in matching
strings.

Viewing the Extraction File


To view or print a Gemcom for Windows extraction file, follow these
steps:
1. Choose Workspace } Extract a Subset of Data } View Extraction File.
2. From the list that appears, select the extraction file you wish to
view and click OK.
3. The Select Report Destination dialog box will appear. Select
the option you wish to use (send report to file, to printer or to
screen) as outlined in Chapter 4: Dialog Boxes, Volume I: Core.

Section II: Workspaces

Gemcom for Windows

Page 2169

Using the Extraction File


The extraction files can be used in a number of functions in
Gemcom for Windows as well as in other Gemcom systems.

Gemcom for Windows


You can use the extraction file in Gemcom for Windows to define
subsets of data that will form input for the following functions:

Symbol plots. You can prepare plots with symbols at each


point, annotated with values from any of the fields in the
extraction file on plan views, vertical sections, inclined sections
or surface maps. For more information, see Chapter 20: Symbol
Plane Plots.

Univariate statistical analyses. You can calculate univariate


statistics, frequency distribution analyses, prepare histograms,
cumulative frequency graphs and probability plots from any of
the numeric fields in the extraction file. For more information,
see Chapter 12: Statistical Analysis.

Three-dimensional semi-variogram analyses. You can


calculate up to twelve three-dimensional experimental semivariograms on the point elevation, the real field or the integer
field of the extraction file. See Chapter 13: Semi-Variogram
Analysis for more information.

Grid creation. Create gridded surfaces on plan views, vertical


sections, inclined sections or surfaces from the points and
values in any numeric field in the extraction file. See
Chapter 24: Gridding and Contouring for more information on
creating grids with extraction files.

Exploration

Chapter 7: Extracting Data

Page 2170

Other Systems
You can use the extraction file in Gemcoms PC-MINE system to
perform the following functions:

Create three-dimensional block models. The extraction file


is used as input for the grade modelling functions in PC-MINE.
Models are created from assay or composite data extracted from
drillhole workspaces.

Create surface topography models. As an alternative to


creating the surface topography models in Gemcom for
Windows (see Chapter 19: Creating Plane Plots) you can create
surface topography models in PC-MINE using a variety of
gridding techniques.

Create layer models. Layer or seam models can be created in


PC-MINE using information about geological contacts between
layers extracted from drillhole workspaces.

Create other gridded models. The two-dimensional grid


creation and manipulation tools in PC-MINE use extraction files
as input.

See the PC-MINE User Manual for more complete requirement


descriptions.

Section II: Workspaces

Gemcom for Windows

Page 2171

Chapter 8

Validating Data
In this Chapter

Introduction
Validating Drillhole and Traverse Data
Checking Duplication of Field Data

Introduction
Gemcom for Windows has two commands that allow you to validate the
data in your workspace. The Validate Drillhole or Traverse Data
command allows you to verify the validity of data in any drillhole or
traverse workspace by checking data for inconsistencies, duplication,
and missing values, and the Check Duplication of Field Data
allows you to check any type of workspace for duplicate data. The
validation process will produce a record by record report of all
inconsistencies. The report may be directed to the printer, to the
screen, or to a text file.
The validation process will not try to correct any inconsistencies.
You will have to edit the workspace manually to resolve any
problems that may be reported.

It is a good idea to validate data on a regular basis if you are making


frequent changes to the data, as problems with the data could affect
the results of a number of Gemcom for Windows functions, especially
statistical and other analyses. Additionally, before you try to calculate

Exploration

Chapter 8: Validating Data

Page 2172

any composites from a workspace, you should validate the intervals in


the source tables that you intend to use.

Validating Drillhole and Traverse Data


The Validate Drillhole or Traverse Data command allows you
to verify the validity of data in any drillhole or traverse workspace.
Validating tables will check for the following:

Any interval, length or distance that is less than or equal to


zero. This occurs when the TO value in a given record is less
than or equal to the FROM value in the same record, or when the
LENGTH or DISTANCE values are negative or zero.

Any interval that is out of sequence. This occurs when the value
in the FROM or the TO field is less than the corresponding value
in the previous record, or when the FROM value in a given
record is less than the TO value in the previous record.

Any portion of a drillhole that does not have an interval


defined. This occurs when the FROM value in a given record is
greater than the TO value in the previous record.

Any interval or distance that is greater than the hole length.


This occurs when the TO or DISTANCE value is greater than the
hole length.

DISTANCE, FROM, TO, LENGTH and coordinate fields that do not


have values entered.

Follow this procedure to validate drillhole or traverse workspace


data:
1. Choose Workspace } Validate Data } Validate Drillhole or Traverse Data.
2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.

Section II: Workspaces

Gemcom for Windows

Page 2173

3. The Select Report Destination dialog box will appear. Select


the option you wish to use (send report to file, to printer or to
screen) as outlined in Chapter 4: Dialog Boxes, Volume I: Core.
4. In the list that appears, select the table(s) containing the data
that you wish to validate and click OK.
5. Click Yes or No in response to the prompt asking whether you
want only the error messages printed.
6. The Drillhole Data Validation status window will appear,
displaying the progress of the validation process. When the data
validation is complete, click OK to clear the window from the
screen. If you elected to send the report to screen in step 3, the
text editor specified by Gemcom for Windows will be used to
display the report.

Checking Duplication of Field Data


The Check Duplication of Field Data command allows you to
test any workspace for duplicates of any field within key (header)
tables, or duplicates of spatial data (coordinate fields, etc.) in any
other tables.
1. Select Workspace } Validate Data } Check Duplication of Field Data.
2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
3. A dialog box entitled Select Method for Checking will
appear. Select one of the following two methods:

Check Duplicate on Header Table.

Check Spatial Duplicate on Any Table.

Exploration

Chapter 8: Validating Data

Page 2174

If you selected Check Duplicate on Header Table:


4. From the list that appears, select the field in the header table
that you wish to check for duplicates and click OK. Only one
field can be chosen at a time.
5. Gemcom for Windows will perform the data validation, and the
Select Report Destination dialog box will appear. Select the
option you wish to use (send report to file, to printer or to
screen) as outlined in Chapter 4: Dialog Boxes, Volume I: Core.
6. The report will be processed, and a window will appear
displaying the report status. Click OK to remove the status
window from the screen and to display the report, if you elected
to print your report to screen in step 5.

If no duplicates were found, a message saying so will be


displayed in the status window, and no report will be created.

If you selected Check Spatial Duplicate on Any Table:


4. From the dialog box that appears, select the table which
contains the data you wish to check for duplicates and click OK.
Only one table can be chosen at a time.
If you select the header table, you will also be asked to select a
field. Select the desired field and click OK.
5. The Define Checking Parameter dialog box will appear. The
parameters that are displayed will depend on the structure of
the selected table. Enter the following parameters, as available
and appropriate:

Section II: Workspaces

Reference Position. Select one of the following three


options:

Use FROM. Select this option to use the value in the


FROM field.

Use MIDDLE. Select this option to use the mid-point


between the values in the FROM and TO fields.

Gemcom for Windows

Page 2175

Use TO. Select this option to use the value in the TO


field.

Tolerance (distance apart). Enter a tolerance level. Any


distances less than this tolerance level will be reported as
spatial duplicates.

6. Gemcom for Windows will perform the data validation, and the
Select Report Destination dialog box will appear. Select the
option you wish to use (send report to file, to printer or to
screen) as outlined in Chapter 4: Dialog Boxes, Volume I: Core.
7. The report will be processed, and a window will appear
displaying the report status. Click OK to remove the status
window from the screen and to display the report, if you elected
to print your report to screen in step 6.

If no duplicates were found, a message saying so will be


displayed in the status window, and no report will be created.

Exploration

Chapter 8: Validating Data

Page 2177

Chapter 9

Filters and Key Indices


In this Chapter

Introduction
Using Expressions
Filters
Key Indices

Introduction
Many of the workspace management tools and applications in
Gemcom for Windows let you work with subsets of data from the
workspace. You can define these subsets of data in three ways:

Extraction files. An extraction file is a file containing a subset


of data from the workspace in Gemcoms standard extraction
file format. Extraction files are described in Chapter 7:
Extracting Data.

Filters. Filters are sets of logical expressions that you can


define and store, then apply to the workspace during an
application.

Key indices. A key index is an external index to the workspace


that contains a list of record names (key fields) from the header
table. You can create a key index by using filters or other key
indices, by manually selecting specific records, or by any
combination of these three methods.

Exploration

Chapter 9: Filters and Key Indices

Page 2178

Using Expressions
In order to create useful filters and key indices, it is important to
have a good understanding of expressions and how to use them.
Expressions are simple formulae that you can create to define
selection criteria for data in the workspace. There are two types of
expressions: math expressions, which always result in a numeric
value, and logical expressions, which always result in a true or
false condition.
Math expressions consist of up to three components: field specifiers,
constants, and math operators.
Logical expressions are made up of two math expressions separated
by a logical operator.

Field Specifiers
You can reference data stored in any of the workspace tables and
fields using field specifiers. These define the table and field that the
data is to come from.
Field specifiers are defined by using the table and field names that
you selected when you first created the workspace. The following
format must be used:
Table Name:Field Name:Subfield
Names must be entered inside double quotation marks () and must
be separated by a colon. The subfield is only required for coordinate
fields and consists of either an X, Y or Z.
For example, HEADER:HOLE-ID will select the field HOLE-ID from
the table called HEADER. HEADER:LOCATION:Y will select the Y
coordinate from the LOCATION field in the table called HEADER.
ASSAYS:CU % will select the field called CU % from the table called
ASSAYS.

Section II: Workspaces

Gemcom for Windows

Page 2179

Constants
Constants are fixed values that do not change during a process.
There are two types of constants: system constants that are defined
and used internally by Gemcom for Windows, and user constants
that you can define yourself with an expression.

System Constants
There are seven predefined system constants, or special values:

Below detection limit. The name of this constant is @BDL@.

Above detection limit. The name of this constant is @ADL@.

Not entered. The name of this constant is @NE@.

Not sampled. The name of this constant is @NS@.

Not calculated. The name of this constant is @NC@.

Insufficient sample. The name of this constant is @IS@.

Error. The name of this constant is @ERR@.

User Constants
There are three types of user constants:

Character strings. A collection of characters surrounded by


single quotes, for example, PCX-001 or GRANITE. Character
strings must be entered in upper case letters only.

Integers. A numeric constant with no decimal places, for


example, 100 or 789.

Numbers. A numeric constant with decimal places, for


example, 12.345 or 0.12.

User constants are not assigned names.


Exploration

Chapter 9: Filters and Key Indices

Page 2180

Mathematical Expressions
Mathematical expressions consist of combinations of field
specifiers, variables and constants with an operator. The result of a
mathematical expression is always a numeric value.

Syntax
The general syntax of a mathematical expression is in the following
form:
<Descriptor> [<Operator> <Descriptor>]
where:
<Descriptor>

consists of either a field specifier,


constant or variable.

<Operator>

consists of any of the mathematical and


trigonometric operators.

An example of a mathematical expression is


ASSAYS:GOLD
or
0.95
or
ASSAYS:GOLD * 0.95
or
(ASSAYS:TO-ASSAYS:FROM) * COS (ASSAYS:DIP)

Section II: Workspaces

Gemcom for Windows

Page 2181

Mathematical Operators
Mathematical operators perform simple math operations on
numeric fields (integer, real, double, coordinate, angle, date) and
constants (integer and number) and generate numeric results.
Gemcom for Windows is able to interpret the following
mathematical operators:
+

Addition

Subtraction

Multiplication

Division

Exponentiation

LOG

Logarithm to base 10

LN

Logarithm to base E

()

Parentheses for grouping

Trigonometric Operators
Trigonometric operators generate numeric results from numeric
fields. Gemcom for Windows is able to interpret the following
trigonometric operators:
SIN

Sine function

COS

Cosine function

TAN

Tangent function

ASIN

Arc sine function

ACOS

Arc cosine function

ATAN

Arc tangent function

Exploration

Chapter 9: Filters and Key Indices

Page 2182

Numeric values used with the SIN, COS and TAN functions should be
angles and should have integer, real, double or angle data types.
Use of values other than these will generate errors.

Logical Expressions
Logical expressions consist of mathematical expressions and logical
operators. The result of a logical expression is either true or false.
When used in a data manipulation, a true result will mean that the
first math expression will be used and a false result will mean that
the second math expression will be used.

Syntax
The general syntax of a logical expression is in the following form:
<Math Expression> <Operator> <Math Expression>
where:
<Math
Expression>

consists of a mathematical
expression as defined above.

<Operator>

consists of a logical operator.

An example of a logical expression is


ASSAYS:GOLD LE 1.5
or
(ASSAYS:TO - ASSAYS:FROM) * COS (ASSAYS:DIP) GT
10.0

Section II: Workspaces

Gemcom for Windows

Page 2183

Logical Operators
There are six different logical operators which you can use to
compare two expressions:

LT. If the result of the first expression is less than the result of
the second expression, the logical operation is true.

LE. If the result of the first expression is less than or equal to


the result of the second expression, the logical operation is true.

GT. If the result of the first expression is greater than the


result of the second expression, the logical operation is true.

GE. If the result of the first expression is greater than or equal


to the result of the second expression, the logical operation is
true.

EQ. If the result of the first expression is equal to the result of


the second expression, the logical operation is true.

NE. If the result of the first expression is not equal to the result
of the second expression, the logical operation is true.

There are two additional logical operators that you can use when
you want to compare more than two expressions at the same time:

AND. This combines the results of two logical expressions. The


net result is true if the results of both logical expressions are
true.

OR. This combines the results of two logical expressions. The


net result is true if either one of the results of the two logical
expressions are true.

When you want to use more than one logical expression at a time,
each set of logical expressions must be surrounded by parentheses.
(ASSAYS:GOLD GE 1.0) AND (ASSAYS:SILVER GE 5.0)

Exploration

Chapter 9: Filters and Key Indices

Page 2184

Levels of Precedence
All expressions have sets of rules that govern the order in which
operations are performed within the expression. These are referred
to as levels of precedence.
Levels of precedence for mathematical and trigonometric operators
are as follows:
1. Logarithms, trigonometric functions
2. Exponentiation
3. Multiplication and division
4. Addition and subtraction
Levels of precedence for logical operators are as follows:
1.

AND

2.

OR

When more than one type of operation are used within a single
expression, the precedence levels are as follows:
1. Mathematical and trigonometric
2. Logical
All operations at the same precedence level within an expression
are performed in order from left to right. Parentheses can be used
to override the order in which operations are performed.

Filters
Filters are sets of logical expressions that you can define and store.
In Gemcom for Windows, you can apply filters to any table in the
workspace when using some of the workspace management tools
and in all the applications that directly access data in the

Section II: Workspaces

Gemcom for Windows

Page 2185

workspace. The following examples illustrate some common types


of filters and the data they are intended to select.

assays:copper ge 0.25. This means that the filter will only


pick up records with values greater than or equal to 0.25 in the
COPPER field of the ASSAYS table.

lithology:rocktype eq KZ. The filter will only pick up


records in which kz is entered as the value in the ROCKTYPE
field of the LITHOLOGY table.

(header:length ge 100) and (header:length le 300). The


filter will only pick up records with values between 100 and 300
(i.e., greater than or equal to 100 and less than or equal to 300)
in the LENGTH field of the HEADER table.

Creating Filters
You can create two kinds of filters in Gemcom for Windows:
Gemcom filters and SQL filters. Gemcom filters are used with data
from Gemcom for Windows workspaces, and are the type you will
use most. SQL filters are specialized filters which allow you to
incorporate data from other SQL databases.

Gemcom Filters
You can use the Filter Editor to create new Gemcom filters or modify
existing Gemcom filters. To create a new filter, follow these steps:
1. Select Workspace } Filter Data } Define Gemcom Filters. The Filter
Editor dialog box will appear.
2. Click Add. Type in a name for your filter and click OK.
3. Enter a brief description of the filter in the Description
parameter, if desired.
4. Enter the body of the filter in the Filter editing area. You can
do this either by typing in the filter using the syntax outlined in
Exploration

Chapter 9: Filters and Key Indices

Page 2186

Figure 9-1: Filter Editor dialog box


the previous section, or you can use the five buttons below the
Filter area. These buttons allow you to select field specifiers,
system constants, and operators from lists rather than having
to remember the syntax and enter it manually.

Field. Use the Field button to enter a field specifier as a


Descriptor. Clicking it brings up a list of available tables.
Select the table that contains the field you wish to use, and
then select the field from the next list. Click OK to enter the
selected field specifier into the Filter editing area at the
current cursor location.

Constant. This button allows you to enter one of the seven


pre-defined system constants as a descriptor. Click this
button to bring up a list of the system constants, select the
desired constant, and click OK to enter the selected system
constant into the Filter editing area at the current cursor
location.

Operator. Use this button to enter a mathematical or


logical operator by selecting from a list of the following
operators:

Section II: Workspaces

Gemcom for Windows

Page 2187

Plus (+)
Minus (-)
Multiply (*)
Divide (/)
Exponent (^)
Less than (LT)
Less than or Equal (LE)
Greater than (GT)
Greater than or Equal (GE)
Equal (EQ)
Not Equal (NE)

AND

OR

Parentheses

Select the desired operator and click OK to enter it into the


filter editing area at the current cursor location.

F ( ). This button allows you to enter trigonometric


operators and selected mathematical operators into the
Filter editing area. Clicking it brings up the following list:

Log Base 10 (LOG)


Log Base E (LN)

SIN

COS

TAN

ASIN

ACOS

ATAN

Select the desired operator and click OK to enter it into the


filter editing area at the current cursor location.
Alternatively, you can highlight the descriptor(s) or
expression to which you want to apply the operator and
click the desired operator to have it automatically applied to
the highlighted selection.

Exploration

Chapter 9: Filters and Key Indices

Page 2188

Undo. Click this button to undo your last edit to the logical
expression displayed in the filter editing area.

5. When you have finished, click Save.


6. Click Exit to close the filter editor dialog box.

SQL Filters
You can use the SQL Filter Editor to create new SQL filters or
modify existing SQL filters. These filters are similar to Gemcom
filters except that they use the following SQL command as the filter
for your data:
SELECT

<list> WHERE <where>

The List clause is the set of tables and fields that will be used when
the program is loading data. It includes fields from the loading and
display profiles, and some fields from the header and survey tables.
You can only affect the List by adding fields to the loading or
display profiles.
In the SQL Filter Editor, you enter the Where clause that will limit
which records are loaded.
To create a new filter, follow these steps:
1. Select Workspace } Filter Data } Define SQL Filters. The Filter
Editor dialog box will appear.
2. Click Add. Type in a name for your filter and click OK.
3. Enter a brief description of the filter in the Description
parameter, if desired.
4. Enter the Where clause of the filter in the Filter editing area.
You can do this either by manually typing in the field
information using the appropriate SQL syntax, or you can use
the buttons below the Filter area.

Section II: Workspaces

Gemcom for Windows

Page 2189

Figure 9-2: SQL Filter Editor dialog box

Field. This button allows you to enter field information


from lists and have the appropriate SQL syntax
automatically applied to the field.
From the lists, select the necessary table from the available
tables, the desired field in that table, and if necessary, an
axis for coordinate fields. Click OK to enter the selected field
into the Filter editing area at the current cursor location.
The Workspace name is used as a prefix in the new field
name.

Undo. Click this button to undo your last edit in the filter
editing area.

5. When you have finished, click Save.


6. Click Exit to close the SQL Filter Editor dialog box.

Exploration

Chapter 9: Filters and Key Indices

Page 2190

Using Filters
Filters are used by many of the workspace tools and all the
Gemcom for Windows applications that directly process data from
the workspace. Filters are used to select subsets of data from the
workspace, and can also be used to create key indices.
You can use a different filter on each of the tables in the workspace.
After you have defined and stored a filter, you can use it by
referring to it by name whenever you are given an option of
selecting data using a filter.
When you are using a filter on a table, the application will check
the data values defined in the filter against the conditions defined
by the logical expression. This is done on a record by record basis. If
the result of the expression is true, even for one subrecord of a
header table record, the application will use all the data from the
record. If the result of the expression is false, the application will
not use any of the data from the record.
Let us say, for example, that you have set up a filter for a drillhole
workspace which is designed to pick up all assay records in which
gold is greater than 0.02% (ASSAYS:AU% GT 0.02). A given
drillhole, HOLE-ID AN-6657, has six assay records with the following
values in the AU% field:
Assay Record
Number

Field Value
(AU%)

1
2
3
4
5
6

0.015
0.018
0.021
0.019
0.010
0.009

The drillhole AN-6657 will be selected by the filter, even though 5


out of its 6 assay records do not meet the filter requirements.

Section II: Workspaces

Gemcom for Windows

Page 2191

Key Indices
A key index is a list of record names (key fields) for the key
(header) table of a workspace. You can create as many key indices
as you want for each workspace, giving each one a user-defined file
name.

The Key Index Editor


You can create or modify a key index file using the Key Index
Editor dialog box, which appears when you select Workspace }
Filter Data } Create/Modify Key Index File and select or enter
a key index file name.
This dialog box has the following features:

Name. The name and path of the key index file appear. Note
that they are displayed here for your information only and
cannot be edited from this dialog box. (They were specified
before the editor dialog box appeared.)

Description. You can enter a brief description for your key


index file in this text box.

Extra Field. If you wish to display an additional field in the


Unselected Records listing to help you to identify the records
listed, select it here. Otherwise, leave it at the default of None.

Filter. If you wish to use a filter to help you determine which


data to include in the key index, select a filter from the list.
Otherwise, leave it at the default of None. You must select a
filter before you can use the filter buttons below the Unselected
Records and Selected Records lists. Note that you will have to
have at least one filter defined before you can use this option.

Unselected Records. This listing shows all records in the


current table that are not included in the key index file. There
are two or three columns in the unselected records list,
displaying the following information:

Exploration

Chapter 9: Filters and Key Indices

Page 2192

Figure 9-3: Key Index Editor dialog box

Record. The column shows the record number for your


reference. This record number is not a fixed characteristic of
a record. It is only an indication of the current position of
the record within the workspace, and may change if the
workspace is edited or sorted.

Key Field. This column displays the data entry in the


primary key field of each record.

Extra Field. This column is only displayed if you have


selected an extra field from the header table to display from
the list (see above). If you have done so, the data entry in
that field will be displayed for each record.
The purpose of the extra field is to provide you with more
information about the records in order to help you select the
records appropriate for your key index. You can also use it
as a way to sort the data in the Unselected Records list
before transferring records to the Selected Records list.

Section II: Workspaces

Gemcom for Windows

Page 2193

Selected Records. This listing shows all records in the current


table that are included in the key index file. When you first
create a key index file, this listing will be blank. This listing
also shows the Record Number and Key Field columns.

(Right-arrow key). Clicking this button (located between


Unselected Records and Selected Records) moves any
highlighted records from the Unselected Records list to the
Selected Records list.

(Left-arrow key). Clicking this button (located between


Unselected Records and Selected Records) moves any
highlighted records from the Selected Records list to the
Unselected Records list.

Under each of the records lists are five selection buttons. These
buttons provide selection tools to help you highlight records in that
listing that meet various criteria quickly and efficiently, as follows:

None. Clicking this button will cancel the selection of any


records in the list which are currently highlighted, so that no
records in the list are highlighted.

Key. Clicking this button brings up a browse dialog box. Select


the name of any key index file (any file with a .KEY suffix) used
with the current workspace and click OK. All records in the
current listing that are selected in that key index file will be
highlighted.

All. Clicking this button will select all records currently in the
list.

(Invert Highlighting). Clicking this button will invert the


current record highlighting, so that highlighted records will be
unhighlighted, and records not highlighted will be highlighted.

Filter. Clicking this button will apply the filter listed in the
Filter parameter to any records currently highlighted. Any
records that do not meet the filter requirements will be
unhighlighted.

Exploration

Chapter 9: Filters and Key Indices

Page 2194

Creating and Modifying Key Index Files


Follow this procedure to create a new key index file or modify an
existing key index file:
1. Select Workspace }Filter Data }Create/Modify Key Index File.
2. In the dialog box that appears, enter a file name for a new key
index file, or select the file name of an existing key index file.
New files will automatically be assigned a .KEY suffix. Click
Save.
3. The Key Index Editor dialog box will appear. If you are
creating a new key index file, all header records from your
current workspace will be listed in the Unselected Records
list. Create the key index by selecting the desired records from
the Unselected Records list and moving them to the Selected
Records list using the right and left arrow buttons between the
two lists.

You can select records manually by using the mouse and the
[Shift] and [Ctrl] keys to select individual or multiple records, or
you can use the selection buttons below each list to select
specific groups of records.

To create a key index file using another key index file:


4. Click the Key button below the Unselected Records listing.
5. In the dialog box that appears, select the name of the key index
file on which you wish to base your new key index file and click
OK.
6. All records selected by the chosen key index file will be
highlighted. Click the Right Arrow key to move these records to
the Selected Records list.
7. Go to step 9, below.

Section II: Workspaces

Gemcom for Windows

Page 2195

To create a key index file using a filter:


4. Select the filter that you wish to use from the Filter list.
5. Highlight all records to which you wish to apply the filter. To
apply the filter to all unselected records, click the 1 button
below the Unselected Records listing. All the records in this
listing will be highlighted.
6. Click the Filter button below the Unselected Records listing. All
records within the highlighted range which conform to the filter
will remain highlighted. The highlighting will be removed from
any records within that range which do not conform to the
filter.
7. Click the Right Arrow key to move these records to the Selected
Records list.
8. Go to Step 9, below.
To create a key index file of all records not selected by a filter:
4. Select the filter that you wish to use from the Filter list.
5. Click the All button below the Unselected Records listing to
highlight all records.
6. Click the Filter button. The highlighting will be removed from
any records which do not conform to the filter.
7. Click the button below the Unselected Records listing. The
highlighting will be inverted so that all records which conform
to the filter will be unhighlighted, and all those which do not
conform to the filter will be highlighted.
8. Click the Right Arrow key to move these records to the Selected
Records list.
9. You can then use other selection tools to add or remove records
from the Selected Records list as required to create the key
index file you want.

Exploration

Chapter 9: Filters and Key Indices

Page 2196

10. When the Selected Records listing shows all the records you
wish your key index file to select, click OK to save the key index
file.
When you sort a key index, only the order in which the records are
read by the index file is changed. The actual order of records in the
workspace does not change.

Using Key Indices


Key indices are used by many of the workspace management tools
and all the Gemcom for Windows applications that directly process
data from the workspace. Key indices are used to instruct the tool
or application to process only the records listed in the index. All
other records will be ignored.
When you use records defined in a key index, the tool or application
will process all the records in any secondary tables that are owned
by the header table records listed in the key index. For more
information on the relationship of records in secondary tables to
records in header tables, see Chapter 3: The Gemcom for Windows
Workspace.

Section II: Workspaces

Gemcom for Windows

Page 2197

Chapter 10

Reports
In this Chapter

Introduction
Report Format Macros
The Reporting Language
Quick versus Detailed Reports
Workspace Status Report
Workspace Record Status Report
Workspace Structure Report

Introduction
The Report Data submenu on the Workspace Menu allows you
to create customized reports from the workspace. Reports can be
used to view data on the screen, to print data, and to create text
files for export to other systems.
You can also create reports showing the current status of the
workspace and of the workspace records, as well as a report
showing the workspace structure.
The Report Data submenu contains the following six commands:

Define/Modify Report Format Macro


Make Normal Report from Workspace
Make Quick Report from Workspace
Workspace Status Report
Workspace Record Status Report
Workspace Structure Report

Exploration

Chapter 10: Reports

Page 2198

Report Format Macros


Before you can generate a complex or customized report, you must
create a report format macro, which will allow you to select the
data you want to use to create the report, and to place headings,
titles, tables, records and fields anywhere on a page. Macros, which
are saved as text files, can be created in several ways:

Using Quick-Reporting. This is a list-based tool that allows


you to build and use simple report macros. From lists, you can
select the tables and fields which you want to report. Gemcom
for Windows then builds your report macro for you. If you wish,
you can later open the macro in the report macro editor or a
text editor and modify it to meet your requirements.
For more information on using Quick Reporting, see Quick
versus Detailed Reports on page 2224.

Using the Report Macro Editor. This is a text file editor


built into Gemcom for Windows. From within this editor, you
can use the reporting language to type in the commands that
make up the report format macro.

Using a Text Editor. You can also use the reporting language
to build report macros outside of Gemcom for Windows in any
text editor or word processor.

Although report format macros are created for a particular


workspace, they can be transferred from workspace to workspace
provided that you use consistent table and field naming
conventions.
To create or modify a report macro using the Gemcom for Windows
Report Macro Editor, follow these steps:
1. Select Workspace }Reports }Define/Modify Report Format Macro.
2. A prompt will appear asking whether you want to create a new
macro file. To create a new macro, click Yes. To edit an existing
macro, click No.

Section II: Workspaces

Gemcom for Windows

Page 2199

3. A file name dialog box will appear. If you are creating a new
macro, type in the name for the macro in the file name box and
click Open. If you are editing an existing macro, select the name
of the macro you wish to edit and click Open.
4. The Define Report Macro text editor screen will appear. Use
the reporting language and the text editor functions to define or
edit the report macro. For more information on the text editor,
see the next section. For detailed information on the reporting
language, see pages 2200 to 2222.
5. When your macro is completed to your satisfaction, save it by
selecting Save from the text editor File menu.

The Gemcom for Windows Text Editor


The Gemcom for Windows text editor is a full function text editor.
It has three menus available, which perform the following
functions:

File. This menu has three commands:

Load. Use this command to load a different macro file for


editing.

Save. Use this command to save any changes you have


made to the current macro file.

Exit. Use this command to exit from the text editor and
return to Gemcom for Windows.

Edit. This menu has four commands available:

Undo. Use this command to undo your last editing change


to the macro.

Cut. Use this command to remove any highlighted text to


the Windows clipboard.

Exploration

Chapter 10: Reports

Page 2200

Copy. Use this command to copy any highlighted text to the


Windows clipboard without removing it from the macro.

Paste. Use this command to copy the contents of the


Windows clipboard to the current cursor location.

Compile. Select this command to check your macro for syntax


and other errors.

The Reporting Language


The Reporting Language is used to build report macros. Like any
language, it has a vocabulary (a set of commands and parameters),
a structure (a set of programming constructs) and a grammar, or
syntax (the structure of the commands and their parameters).

Syntax
The reporting language consists of a set of commands. Each
command consists of a verb, which indicates the operation that will
take place when the command is executed, followed by a set of
parameters. This set of parameters defines the data that the
command operates on and how the operation takes place. The
structure of the commands and their parameters is called syntax.
The general syntax of each command is:
VERB

[clause] [clause] [clause]...

In the command reference at the end of this chapter, the syntax of


each command is described in detail. Items enclosed in the square
brackets ( [ ] ) are optional. Items enclosed in triangular brackets (
< > ) are entered by the user. Most of the clauses in a command are
repeatable within a single command. This is indicated by the three
periods ( ... ) following the syntax. Do not repeat the verb part of the
command, which must be entered in the long or short forms shown.
The brackets are not typed in.
Section II: Workspaces

Gemcom for Windows

Page 2201

Language Structure
The reporting language supports some simple programming
constructs which inform the reporting function to process a
command many times in a row. This is needed to output all the
records in a table one after the other. The reporting language is
therefore a procedural language because the programming
constructs take the form of procedural definitions. These constructs
are implemented in the form of loops that define the tables and the
records in the table to be sequentially reported. The commands that
implement the loop are the DO TABLE command and the END
command. This is illustrated below:
DO TABLE=HEADER WHILE
.
Commands to output header table data here
.
END
This simple structure instructs the report writer to loop through all
the records in the header table and report them using the
commands inside the loop.
Loops can be nested inside each other to produce more complex
reports:
DO TABLE=HEADER WHILE
.
Commands to output header table data here
.
DO TABLE=ASSAYS WHILE
.
Commands to output assay table data here
.
END
END
This structure instructs the report writer to loop through all the
records in the header table and report them using the first
commands inside the loop. Immediately after each record in the

Exploration

Chapter 10: Reports

Page 2202

header table is processed, the report writer will loop through all the
records in the assay table associated with the record just processed
from the header table, and will report them using the commands
inside the second loop.
Each DO TABLE command must be terminated with an END
command following the formatting commands inside the loop.

All reports should include a DO TABLE and a corresponding END


command for at least the header table if more than one record is to
be reported.

Defining Tables and Fields


You can report data stored in any of the workspace tables and fields
by defining their names in the various formatting commands using
field specifiers.
Field specifiers are defined by use the table and field names that
you selected when you first created the workspace. The following
format must be used:
Table Name:Field Name:Subfield
Names must be entered inside double quotation marks () and be
separated by a colon. The subfield is only required for coordinate
fields and consists of either an X, Y or Z.
For example, HEADER:HOLE-ID will select the field HOLE-ID from
the table called HEADER. HEADER:LOCATION:Y will select the Y
coordinate from the LOCATION field in the table called HEADER.
ASSAYS:CU % will select the field called CU % from the table called
ASSAYS.

Section II: Workspaces

Gemcom for Windows

Page 2203

Defining Field Content Format


You can define the format of the output of the field contents. The
format can be defined with the following descriptors:
Aw [modifier]

The string format descriptor must be used with fields that have
string, date, date and time, time or angle data types. The field is
w characters wide, and the modifier, which is optional, can be
any of the following values:

W =
line

wrap long character or memo fields onto the next

left-justify the data within the field

R =

right-justify the data within the field

C =

centre the data within the field

The following example illustrates the Aw descriptor:

OUTPUT 1# Hole-id: 12# HEADER:HOLE-ID A12

The HOLE-ID field would be output with a width of up to 12


characters. Any string longer than 12 characters would be
clipped to 12 characters. This example would result in the
following output:

Hole-id: PC-001

The following example illustrates the use of the W modifier


option:

OUTPUT 1# Hole-id: 12# HEADER:HOLE-ID A12

As in the previous example, the HOLE-ID field in the above


example would be output with a width of up to 12 characters.
Any string longer than 12 characters would be clipped to 12
characters. The COMMENTS field would be limited to 30

25# Comments: 35# HEADER:COMMENTS A30 W

Exploration

Chapter 10: Reports

Page 2204

characters, after which any characters would wrap onto the


next line. This example might result in an output like this:
Hole-id: PC-001

Comments:

This is the comment you would


put in to describe the state of
this drillhole.

Iw

The integer format descriptor must be used with fields that


have integer data types. The field output will be w digits wide.
If the data value has more than w digits, asterisks (*) will be
output instead of the digits. The modifier options are the same
as those described above. Integers are right-justified within the
field. The following example illustrates this descriptor:

OUTPUT 1# Sample no: 12# POINTS:SAMPLENO i8

This example would result in the following output:

Sample no: 12345678

Fw.d

The numeric format descriptor must be used with fields that


have real or double data types. The field output will be w digits
wide, of which d digits fall to the right of the decimal place. The
value output is rounded to the nearest decimal place rather
than truncated if more than d decimal places are encountered
in the data. If the data value is wider than (w-d) digits,
asterisks (*) will be output instead of digits. The numeric
format descriptor should be used to output coordinate data
types. The modifier options are the same as those described
above. The following is an example of the use of this descriptor:

OUTPUT 1# Length: 12# HEADER:LENGTH f8.2

OUTPUT 1# Y: 12# HEADER:LOCATION:Y f10.2

This example would result in the following output:

Length:

12345.67

Y:

1234567.89

Section II: Workspaces

Gemcom for Windows

Page 2205

Bw

The Boolean (logical) format descriptor must be used with Boolean


data types. The field will be output as either TRUE or FALSE
depending on the value of the field contents. The field will be w
characters wide. If w is less than 5, the output will be clipped to the
number of digits defined by w. The modifier options must be the
same as those described above. The following example illustrates
the use of this descriptor:

OUTPUT 1# Closed ?: 10# POLYGON:CLOSED B5

This example would result in this output:

Closed?: TRUE

Variables and Constants


During the reporting process, you can access a number of values
that the Gemcom for Windows system uses internally. These values
can be used in the report or to control the way the report is created.
These values are called system variables or system constants and
are each given a fixed name by the system.

Variables
There are four system variables:

Page numbers. These are determined as the report is


produced and are dependent on the number of lines defined for
the page and the number of lines produced for the report. The
system variable name is @PAGENO@.

Date. This is the date as set by your system clock. The system
variable is called @DATE@.

Time. This is the time of day as set by your system clock. The
system variable is called @TIME@.

Exploration

Chapter 10: Reports

Page 2206

Record Number. This is the number assigned to each record


by Gemcom for Windows. The system variable name is
@RECNO@. This number is not useful as a permanent reference
to a particular record, as record numbers change as data is
modified or deleted. However, it can be used to show record
order within a single report.

Constants
There are two types of constants: system constants that are defined
and used internally by Gemcom for Windows, and user constants
that you can define in the report format macro.

System Constants. There are seven predefined system


constants:

Below detection limit. The name of this constant is


@BDL@.

Above detection limit. The name of this constant is


@ADL@.

Not entered. The name of this constant is @NE@.

Not sampled. The name of this constant is @NS@.

Not calculated. The name of this constant is @NC@.

Insufficient sample. The name of this constant is @IS@.

Error. The name of this constant is @ERR@.

User Constants. There are three types of user constants which


are never assigned names:

Character strings. A collection of characters surrounded


by single quotation marks, for example, PCX-001 or
GRANITE.

Integers. A numeric constant with no decimal places, for


example, 100 or 789.

Section II: Workspaces

Gemcom for Windows

Page 2207

Numbers. A numeric constant with decimal places, for


example, 12.345 or 0.12.

Expressions
Expressions are simple formulae that you can enter to define
selection criteria for data in the workspace. There are two types of
expressions: a mathematical expression that always results in a
numeric value, and a logical expression that always results in a
true or false condition.
For a complete discussion of mathematical and logical expressions,
see Mathematical Expressions on page 2180 and Logical
Expressions on page 2182 of Chapter 9: Filters and Key Indices.

Command Reference
There are five types of commands used by the reporting language:

Utility commands

Page layout commands

Formatting commands

Procedural commands

Data selection commands

Exploration

Chapter 10: Reports

Page 2208

Utility Commands
There are two utility commands which are used within the report
format macro only. They do not affect the output of the report.
+
Usage

This command is used to continue a command on the


next line of the report format macro when the command
is too long to fit on a single line. The command must be
in the first column of the file.

Purpose

The maximum length of a line in the report format


macro file is 80 characters. The maximum number of
characters that you can have in a single command is
approximately 1000.

Example

TABLE 1# LITH:FROM f8.2


+ 12# LITH:TO f8.2
+ 24# LITH:ROCKTYPE a10
+ 36# ASSAYS:FROM f8.2

*
Usage

* comment line

Purpose

This command is used to insert comments and


notations in the report format macro. The command
must be in the first column of the file.

Example

* The following lines output a table


TABLE 1# LITH:FROM f8.2
+ 12# LITH:TO f8.2
+ 24# LITH:ROCKTYPE a10
+ 36# ASSAYS:FROM f8.2

Section II: Workspaces

Gemcom for Windows

Page 2209

Page Layout Commands


Page layout commands define the overall layout of each page in the
report. The commands will control the following items:

The format of the running headers. A running header is the


line of text that appears at the very top of each page.

The format of the running footers. A running footer is the


line of text that appears at the very bottom of each page.

The position of page breaks.

The number of lines of text on each page.

The number of columns of characters on each page.

Text delimiter strings. Text delimiters are characters that


appear immediately before and after each string of text.

HEADER
Usage:

HEADER <n#> <string list> [<#> <string list>]

Where: n# is the column number to start output.


string list is the text to be output. This can take
the form of either a string in single quotes, or a
system variable.
Purpose:

Outputs a single line header at the first line of every


page on the report.

Example:

HEADER 1# Example Report 60# Page: 66# @PAGENO@

This line will print Example Report and the page number
at the top of each page in columns 1 and 60
respectively.

Exploration

Chapter 10: Reports

Page 2210

FOOTER
Usage

FOOTER <n#> <string list> [<#> <string list>]...

Where: n# is the column number to start output


string list is the text to be output. This can take
the form of either a string in single quotes, or a
system variable.
Purpose

Outputs a single line footer at the last line of every


page on the report.

Example

FOOTER 1# Example Report 66# @DATE@

This line will print Example Report and the current date
at the bottom of each page in columns 1 and 60
respectively.
PAGE
Usage

PAGE

Purpose

Forces a new page in the report.

Example

PAGE

Section II: Workspaces

Gemcom for Windows

Page 2211

MAXROW
Usage

MAXROW n

Where: n is the number of lines to be printed per page.


The default value is 55 lines.
Purpose

Defines the number of lines to be printed per page.

Example

MAXROW 50

This line will set the number of lines per page to be 50.
The report writer will automatically insert a page break
every 50 lines of output.
MAXCOL
Usage

MAXCOL n

Where: n is the maximum number of columns to be


printed per page. The default value is 80
columns per page.
Purpose

Defines the maximum number of columns of text to be


printed per page. Any lines that are longer than the
maximum number of columns will be clipped to this
maximum number.

Example

MAXCOL 128

This line will set the maximum number of columns per


page to be 128.

Exploration

Chapter 10: Reports

Page 2212

DELIMITER
Usage

DELIMITER <char>

or
D <char>

Where: char is a character to be used as text delimiter.


Purpose

Inserts a delimiter character before and after each


occurrence of a complete character string.

Remarks

Many software packages (such as LOTUS 1-2-3,


QUATTRO, DBase, etc.) require text to be delimited by
some character both before and after each occurrence of
a text string. Typically, this would be a single quotation
mark.

Example

DELIMITER

yields String at each occurrence of every character


string.

Formatting Commands
Formatting commands are used to set character and text formats
and to position data from the workspace within the report. The
eight formatting commands will control the following items:

The type of font to be used. Two commands allow you to set


normal text, bold text and compressed text.

The format for output of dates. You can select from


Canadian, U.S., generic or system defined formats.

The output of fixed text for comment.

The output of data and text from the workspace.

The output of data from the workspace in tabular form.

Section II: Workspaces

Gemcom for Windows

Page 2213

BOLD
Usage

BOLD <Status>

Where: Status indicates the status of the text. Status


can be ON or OFF. The default value is OFF.
Purpose

Turns bold text on or off.

Remarks

This command will only work on printers supporting


EPSON mode.

Example

BOLD ON

First block of commands


BOLD OFF

Second block of commands


The first block of commands will be printed in bold text.
The second block of commands will be printed in normal
text.
COMPRESSED
Usage

COMPRESSED <Status>

Where: Status indicates the status of the text. Status


can be ON or OFF. The default value is OFF.
Purpose

Turns compressed text on or off.

Remarks

This command will only work on printers supporting


EPSON mode.

Example

COMPRESSED ON

First block of commands


COMPRESSED OFF

Second block of commands


The first block of commands will be printed in
compressed text. The second block of commands will be
printed in normal text.

Exploration

Chapter 10: Reports

Page 2214

DATEFMT
Usage

DATEFMT <format>

Where: format is CDN for Canadian format, USA for U.S.


format, GEN for generic format or SYS for
system controlled format.
Purpose

This command sets the format for the output of the


system variables @DATE@ and @TIME@. See Chapter 3:
The Gemcom for Windows Workspace for definitions of
date and time formats.

Example

DATEFMT GEN
HEADER 1# Date: 10# @DATE@

This line will output a running header on each


page with the date in generic format.
Simple LINE
Usage

LINE <n>

Where: n is the number of blank lines to be printed.


Purpose

Prints or skips a number of blank lines in the report.

Example

LINE 4

This line leaves four blank lines between the command


preceding and the command following the line
command.

Section II: Workspaces

Gemcom for Windows

Page 2215

Complex LINE
Usage

LINE [C] <n#> <string> [<n#> <string>]

Where: C is an option that allows the next command to be


output on the same line as the line command
where C is used; i.e., it suppresses the automatic
line feed option for that line command.
n# is the column number to start output.
string is the text to be output. The string must
be enclosed in single quotation marks.
Purpose

Outputs text strings on the current line in the column


defined in the command

Example

Without using the C option:


LINE 1# DISTANCE 15# DIP 30# AZIMUTH
DO TABLE=SURVEYS WHILE
TABLE 1# SURVEYS:DISTANCE f8.2 15# SURVEYS:DIP
f8.2
+ 30# SURVEYS:AZIMUTH f8.2
END

yields
DISTANCE
0.00
100.00

DIP
-90.00
-86.00

AZIMUTH
0.00
54.00

With the C option:


LINE 1# DISTANCE 15# DIP 30# AZIMUTH
DO TABLE=SURVEYS WHILE
LINE C 40# @RECNO@
TABLE 1# SURVEYS:DISTANCE f8.2 15# SURVEYS:DIP
f8.2
+ 30# SURVEYS:AZIMUTH f8.2
END

yields
DISTANCE
DIP
0.00
-90.00 0.00
100.00 -86.00 54.00

Exploration

AZIMUTH
1
2

Chapter 10: Reports

Page 2216

THEADER
Usage

THEADER <n#> <string> [<n#> <string>]

Where: n# is the column number to start output.


String is the text to be output. The string must
be enclosed in single quotation marks.
Purpose

Outputs the text strings, which are on the current line


in the column defined in the command as the header, to
a table. The header will be repeated at the top of each
new page if the page break occurs in the middle of a
table.

Remarks

Up to 2 THEADER commands can be used for each DO


TABLE loop.

Example

THEADER 1# DISTANCE 15# DIP 30# AZIMUTH

yields
DISTANCE

Section II: Workspaces

DIP

AZIMUTH

Gemcom for Windows

Page 2217

OUTPUT
Usage

OUTPUT <n#> <string> <n#> <field spec> <format spec>

Where: n# is the column number to start output.


string is the text to be output. The string must
be enclosed in single quotation marks.
field spec is the field specifier. This defines the
table, field and subfield to be output. For details,
see Defining Tables and Fields on page 2202.
format spec is the format specifier. This will define
the format of the output of the field contents. See
Defining Field Content Format on page 2203.
Purpose

Outputs a line of text combined with data values from


the workspace.

Remarks

This command will output data values from the tables


and fields specified together with any associated text.

TABLE
Usage

TABLE <n#> <field spec> <format spec> ...

Where: n# is the column number to start output.


field spec is the field specifier. This defines the
table, field and subfield to be output. For details,
see Defining Tables and Fields on page 2202.
format spec is the format specifier. This will define
the format of the output of the field contents. See
Defining Field Content Format on page 2203.
Purpose

This command is used within a DO TABLE command to


output a tabulation of data from the workspace.

Remarks

This command will output data values from the tables


and fields specified by the field specifiers. The data is
output in the formats defined by the format specifiers,
which must be in the same form as those used in the
OUTPUT command (see above).

Exploration

Chapter 10: Reports

Page 2218

Data to be output can come from any table in the


workspace and is not necessarily restricted to the table
defined in the DO TABLE command. You can output data
from the table defined in the DO TABLE command, the
header table and one other table at the same time.
Example

If you are using data from the header table and the
table in the DO TABLE command, then you can use fields
from both tables in any order.
If you are using data from multiple tables other than
the header table, the layout of the report is controlled
by the data in the table defined in the DO TABLE
command. This table is referred to as the primary table,
and the other table is referred to as the secondary table.
There are two allowable combinations of formats for the
primary and secondary tables:
Both tables in FROM and TO format. If the tables to be used
both have data in FROM and TO format, then the table
layout will be controlled by the values in the FROM and TO
fields in the primary table. The report writer will output a
record from the primary table, and then will output all
records from the secondary table whose interval lies
between the FROM and TO values of the primary table.
This is illustrated in the following example.
DO TABLE=HEADER WHILE
DO TABLE=LITH WHILE
TABLE 1# LITH:FROM f8.2
+ 12# LITH:TO f8.2
+ 24# LITH:ROCKTYPE a10
+ 36# ASSAYS:FROM f8.2
+ 48# ASSAYS:TO f8.2
+ 60# ASSAYS:CU % f8.3
END
END

Section II: Workspaces

Gemcom for Windows

Page 2219

yields
FROM

TO

ROCKTYPE

FROM

TO

CU %

0.0

50.0

ANDESITE

50.0

65.0

DYKE

65.0

90.0

ANDESITE

100.0
110.0
120.0

110.0
120.0
130.0

DYKE

10.0
20.0
30.0
40.0
50.0
60.0
70.0
80.0
90.0
90.0
90.0

20.0
30.0
40.0
50.0
60.0
70.0
80.0
90.0
135.0
135.0
135.0

0.12
0.33
0.21
0.35
0.09
0.08
0.45
0.49
0.21
0.23
0.22

Primary table in FROM and TO format and secondary table


in DISTANCE format. In this case the table layout will be
controlled by the values in the FROM and TO fields in the
primary table. The report writer will output a record from
the primary table, and then will output all records from
the secondary table that have a value in the DISTANCE
format that lies between the FROM and TO values of the
primary table. This is illustrated in the following example:
DO TABLE=HEADER WHILE
DO TABLE=LITH WHILE
TABLE 1# LITH:FROM f8.2
+ 12# LITH:TO f8.2
+ 24# LITH:ROCKTYPE a10
+ 36# STRUCT:DISTANCE f8.2
+ 48# STRUCT:DIP f8.2
END
END

yields

Exploration

FROM

TO

ROCKTYPE

0.0

50.0

ANDESITE

50.0

65.0

DYKE

65.0

90.0

ANDESITE

DISTANCE
20.0
30.0
40.0
50.0
60.0
65.0
80.0
90.0

DIP%
49.5
47.2
48.3
49.1
77.1
74.3
45.2
46.5

Chapter 10: Reports

Page 2220

Procedural Commands
There are only two procedural commands in the reporting language.
Their function is to first instruct the report writer to begin looping
through each record in a table, and then end the looping process.
DO TABLE WHILE
Usage

DO TABLE=<n> WHILE [RSTART=<i> REND=<j>]

Where: n is the name of the workspace table to be used. It


must be enclosed in double quotation marks.
i is the starting record number. The default is
the first record in the table.
j is the ending record number. The default is
the last record in the table.
Purpose

Repeatedly executes all commands between the DO


TABLE command and the next END command in a loop
that increments the current record counter by one each
time through the loop.

Remarks

The DO TABLE command is applied to a specific workspace


table. An optional condition can be added to the command
to limit the execution of the command to the record
numbers specified by the RSTART and REND conditions. If
RSTART and REND are not defined, the command will loop
through all of the records in the table.
commands can be nested inside each other to
one level of nesting. The following illustrates a valid
nest of DO TABLE commands:
DO TABLE

DO TABLE=HEADER WHILE

Block of commands
DO TABLE=SURVEY WHILE

Block of commands
END
DO TABLE=ASSAYS WHILE

Block of commands
END
END
Section II: Workspaces

Gemcom for Windows

Page 2221

The following illustrates an invalid nest of DO TABLE


WHILE commands:
DO TABLE=HEADER WHILE

Block of commands
DO TABLE=SURVEY WHILE

Block of commands
DO TABLE=ASSAYS WHILE

Block of commands
END
END
END

See also the following section on the END command.


Example

DO TABLE=HEADER WHILE
OUTPUT 3# HOLE-ID: 12# HEADER:HOLE-ID a10
LINE
LINE 1# DISTANCE 15# DIP 30# AZIMUTH
DO TABLE=SURVEYS WHILE
TABLE 1# SURVEYS:DISTANCE f8.2 15# SURVEYS:DIP
f8.2
+ 30# SURVEYS:AZIMUTH f8.2
END
LINE
END

yields
HOLE-ID: PCX-001
DISTANCE
0.00
30.00
50.00
79.00

DIP
37.00
38.50
38.30
38.50

AZIMUTH
89.50
88.00
88.24
88.10

HOLE-ID: PCX-002
DISTANCE
0.00
99.00
120.00

DIP
45.00
46.00
47.00

AZIMUTH
78.32
77.64
76.00

This set of commands loops through records in the header


table (table 1) and then, for each header table record, loops
through all the records in the table called SURVEY. For
brevity, only two records from the header table have been
shown.
Exploration

Chapter 10: Reports

Page 2222

END
Usage

END

Purpose

Indicates the end of a DO TABLE command procedure.

Remarks

Every DO TABLE command must have a corresponding


END command. All commands between the DO TABLE
command and the END command will be repeatedly
executed.
See also the preceding section on the DO TABLE WHILE
command.

Example

DO TABLE=HEADER WHILE

Block of commands
END

Data Selection Commands


You can select subsets of data during reporting by using the data
selection commands. Data is selected when one expression is compared
with another expression in a logical operation. The data is selected if
the answer is true, and is not selected if the answer is false.
There are two types of data selection commands:

A single conditional selection. This allows you to process a


set of commands using a subset of data selected with a
conditional IF - ENDIF test.

A multiple conditional expression. This allows you to


process multiple sets of commands using subsets of data
selected with conditional IF - ELSEIF - ELSE - ENDIF tests.

Section II: Workspaces

Gemcom for Windows

Page 2223

IF - ENDIF
Usage

IF <Logical Expression>

Block of Commands
ENDIF

Purpose

These commands instruct the report writer to process a


block of commands when conditions defined by the IF
command are true.

Example

IF ASSAYS:GOLD LE 1.5

Block of report commands


ENDIF

This example would process the block of report


commands only when the value in the field called GOLD
in the table called ASSAYS is less than or equal to 0.95.
IF - ELSEIF - ELSE - ENDIF
Usage

IF <Logical Expression>

Block of Commands
ELSEIF <Logical Expression>

Block of Commands
ELSE <Logical Expression>

Block of Commands
ENDIF

Purpose

These commands instruct the report writer to process a


block of commands when conditions defined by the IF
command are true, followed by further sets of
commands if the conditions defined by the ELSEIF
commands are true. The last set of commands between
the ELSE command and the ENDIF command are
processed for the balance of the conditions (i.e., for
every record not processed by the IF and ELSEIF
commands).

Remarks

The ELSEIF command can be repeated as many times as


you need between the IF and ENDIF statements.

Exploration

Chapter 10: Reports

Page 2224

Example

IF ASSAYS:GOLD LE 1.5

First block of report commands


ELSEIF ASSAYS:GOLD GT 2.0

Second block of report commands


ELSE

Third block of report commands


ENDIF

This example would process the first block of report


commands when the value in the field called GOLD in
the table called ASSAYS is less than or equal to 1.5, the
second block of commands when the value is greater
than 2.0 and the third block of commands when the
value is less than or equal to 2.0 and greater than 1.5.

Section II: Workspaces

Gemcom for Windows

Page 2225

Quick versus Detailed Reports


The prospect of creating report format macros can often be
intimidating for novice users of Gemcom for Windows. If you want
to avoid the entire process of designing and entering a report
format macro, Gemcom for Windows includes a tool for creating
basic reports quickly and easily. This tool allows you to select from
lists of available data and all the tables and fields. You can apply
simple selection criteria to the selected fields when you pick them.
Gemcom for Windows then automatically creates the report format
macro and uses it to produce a report. You can save the macro after
producing the report so that you can either use it again, or edit or
expand the formatting.

Normal Reports
This option allows you to create a report using a pre-defined report
format macro.
1. Select Workspace } Report Data } Make Normal Report from
Workspace.
2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
3. In the file name dialog box that appears, select the report
format macro you wish to use and click Open.
4. The Select Report Destination dialog box will appear. Select
the option you wish to use (send report to file, to printer or to
screen) as outlined in Chapter 4: Dialog Boxes, Volume I: Core.
5. The Select Report Format dialog box will appear. Choose one
of the following three options from the list:

Flat File. Select this option to create a file in a fixed


column format, where each field has a specified number of

Exploration

Chapter 10: Reports

Page 2226

characters (columns) regardless of the number of


characters in the data value itself.

Printer Control Codes. Select this option to create a


report consisting only of the printer control codes from the
report format macro.

Spreadsheet Comma-Delimited. Select this option to


create a report in a comma-delimited format compatible
with most spreadsheet programs. In this format, fields are
separated (delimited) by a comma.

For a complete discussion on the difference between fixed


format (flat) files and comma-delimited files, see Chapter 5:
Importing and Merging Data.
Click OK to proceed.
6. The Generate Report status window will appear, displaying
the progress of the report creation process. When completed,
click OK to clear the window from the screen.
7. If you sent the report to the screen, it will be displayed now
using an ASCII text editor. When you have finished with the onscreen report, close the editor window.
If you sent the report to file, you can view or edit the report file
by selecting Tools } Other Utilities } Edit Last Generated Report File.

Quick Reports
To create a basic report without creating a report format macro,
follow these steps:
1. Select Workspace } Report Data } Make Quick Report from Workspace.
The Quick Report dialog box will appear. All the fields in each
table will be listed. Enter these parameters (as applicable) for
each of the fields that you wish to include in your report:

Section II: Workspaces

Gemcom for Windows

Page 2227

Figure 10-1: Quick Report dialog box

Use. Click in this column to indicate that you wish to have


the data in this field listed in your report.

Minimum and Maximum. If the field you have chosen is a


numeric field, define a range of values to report by entering
a lower bound and an upper bound. Any records containing
values outside of these bounds will not be included in the
report.

Match String. If the field you have chosen is a character


field, enter the desired alphanumeric string that you wish to
match. Note that you can use the wildcard characters ? and
*. The default is set to *, which will match all strings.

2. When you have entered all the applicable information for all
fields you wish to include, click OK.
3. Select the report destination in the Select Report
Destination dialog box that appears, as outlined in Chapter 4:
Dialog Boxes, Volume I: Core.

Exploration

Chapter 10: Reports

Page 2228

4. Click Yes or No in response to the prompt asking whether to


create a macro with the filters you defined above.
5. The Generate Report status window will appear, displaying
the progress of the report creation process. When completed,
click OK to clear the window from the screen.
If you sent the report to the screen, it will be displayed now
using an ASCII text editor. When you have finished with the onscreen report, close the editor window.
6. Click Yes or No in response to the prompt asking whether you
want to save the macro to create the report again. If you click
Yes, you will be asked to enter a name for your new macro file.
If you choose to create the macro, you will be able to use the
Define/Modify Report Format Macro command and the
reporting language to modify the macro as required.
7. If you sent the report to file, you can view or edit the report file
by selecting Tools } Other Utilities } Edit Last Generated Report File.

Workspace Status Report


Use this command to create a report on the current status of the
workspace. This report will display the project name and workspace
type and description, and the total number of records in each table
and in the workspace as a whole. It will also display the following
information for each of the fields in each of the tables:

Field Name. This displays the name of the field.

Axis. This shows whether the axis is X, Y or Z (coordinate fields


only).

Minimum Value. This displays the minimum value for the


entries in this field, if one was set. Note that this applies to
fields with numeric values only.

Section II: Workspaces

Gemcom for Windows

Page 2229

Maximum Value. This displays the maximum value for the


entries in this field, if one was set. Note that this applies to
fields with numeric values only.

Valid Entries. This displays the number of records in the field


which contain valid entries.

Not Entered. This shows the number of records in the field


with the special value Not Entered.

ADL Entries. This shows the number of records in the field


with the special value Above Detection Limit.

BDL Entries. This shows the number of records in the field


with the special value Below Detection Limit.

IS Entries. This shows the number of records in the field with


the special value Insufficient Sample.

NS Entries. This shows the number of records in the field with


the special value Not Sampled.

NC Entries. This shows the number of records in the field with


the special value Not Calculated.

ERR Entries. This displays the number of records for which the
entry in this field generated an error.

To run this report, follow these steps:


1. Select Workspace } Report Data } Workspace Status Report. The
Gemcom for Windows Workspace Status Reporting status
window will appear, displaying the progress of the status
reporting function. Depending on the size of your workspace,
this function could take some time.
2. Select the report destination in the Select Report
Destination dialog box that appears, as outlined in Chapter 4:
Dialog Boxes, Volume I: Core.

If you send the report to file, you can view or edit the report file
by selecting Tools } Other Utilities } Edit Last Generated Report File.

Exploration

Chapter 10: Reports

Page 2230

Workspace Record Status Report


Use this command to create a report on the current status of a
record or set of records in the workspace.
To run this report, follow these steps:
1. Select Workspace } Report Data } Workspace Record Status Report.
2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
3. Select the Reference Field you wish to use and click OK.
4. Select the report destination in the Select Report
Destination dialog box that appears, as outlined in Chapter 4:
Dialog Boxes, Volume I: Core.
5. The Generating Record Number Status Report status
window will appear, displaying the progress of the reporting
function. If you sent the report to the printer or to a file, you
must click OK to clear this window from the screen when the
report has been generated. If you sent the report to the screen,
it will appear on screen automatically.
6. If you sent the report to file, you can view or edit the report file
by selecting Tools } Other Utilities } Edit Last Generated Report File.

Workspace Structure Report


This command will create a report detailing the structure of the
current workspace. It will display the workspace file name and the
following information for each table in the workspace:

Table Number
Table Name
Number of Fields

Section II: Workspaces

Gemcom for Windows

Page 2231

It will also include the following information for each field in each
of the tables:

Field Name
Field Number
Field Type
Minimum Value
Maximum Value
Default Value

To run this report, follow these steps:


1. Select Workspace } Report Data } Workspace Structure Report.
2. Select the report destination in the Select Report
Destination dialog box that appears, as outlined in Chapter 4:
Dialog Boxes, Volume I: Core.
3. The Workspace Structure Report Status window will
appear, displaying the progress of the reporting function. If you
sent the report to the printer or to a file, you will have to click
OK to clear this window from the screen when the report has
been generated. If you sent the report to the screen, it will
appear on screen automatically.

If you printed the report to a file, you can view or edit the
report file by selecting Tools } Other Utilities } Edit Last Generated
Report File.

Exploration

Chapter 10: Reports

Page 2233

Chapter 11

Data Manipulation
In this Chapter

Introduction
Manipulation of Fields
Transferring Data Between Tables
Linear Interpretation of Field Values
Formatting String Fields
Coordinate Transformations
Desurveying Tables
Special Drillhole Data Processes

Introduction
You can use the functions in the Manipulate Data command on
the Workspace Menu to calculate new data values from existing
data values in the active workspace.
There are eight data manipulation functions available:

Simple Manipulation of Fields. Simple manipulation uses


math expressions to manipulate data in all the records that you
have selected.

Conditional Manipulation of Fields. Conditional


manipulation uses two sets of math expressions to manipulate
data in records that are selected using a logical expression.

Exploration

Chapter 11: Data Manipulation

Page 2234

Cross Table Transfer of Data. This option allows you to


transfer data from a field in one secondary table to a field that
has the same data type in another secondary table.

Linear Interpretation of Field. This option allows you to fill


in any missing data values within a series of consecutive
records in a selected field.

Format String Field. Use this option to format string


(alphanumeric character) fields in Gemcom for Windows tables
and to create new string fields by concatenating two existing
string fields.

Coordinate Transformation. This option allows you to


transform location information from one coordinate system to
another.

Desurvey Tables of Data. You can use this option to calculate


the location of data stored in interval and distance formats in
drillhole or traverse type workspaces.

Special Drillhole Data Process. This option allows you to


manipulate drillhole data that you have imported from another
system so that it meets the requirements of the Gemcom for
Windows format.

Manipulation of Fields
You can define sets of expressions to act on data in the workspace
and calculate new values that are inserted into the workspace.
There are two ways that you can use expressions to manipulate
data:

Simple manipulation uses math expressions to manipulate


data in all the records that you have selected.

Conditional manipulation uses two sets of math expressions


to manipulate data in records that are selected using a logical
expression. The first set of math expressions is used when the

Section II: Workspaces

Gemcom for Windows

Page 2235

conditions specified by the logical expression are true. The


second set of math expressions is used when the conditions
specified by the logical expression are false.

Conditional manipulation takes the following form:


IF

<Logical Expression> is TRUE

THEN
ELSE

Result = <math expression 1>


Result = <math expression 2>

The results of both simple and conditional manipulations are


inserted into fields in the tables being manipulated. These fields
must already exist in the table.
You can insert the result into fields that already have data in them
or into fields that do not have data. Be very careful when you do
this as it is easy to overwrite data by mistake. If you do this, you
can never recover the original data.

Expressions
Expressions are simple formulae that you can enter to define
selection criteria for data in the workspace. There are two types of
expressions: a math expression that always results in a numeric
value; and a logical expression that always results in a true or false
condition.
Math expressions consist of up to three components: field specifiers,
constants and math operators.
Logical expressions are made up of two math expressions separated
by a logical operator.
For complete information on these expressions and their
components, see Using Expressions on page 2178.

Exploration

Chapter 11: Data Manipulation

Page 2236

Simple Manipulation of Fields


Selection of this command from the Manipulate Data submenu on
the Workspace menu brings up the following dialog box:

Figure 11-1: Simple Data Manipulation dialog box


1. Enter the following parameters:

Table to be manipulated. Select the table which contains


the data that you want to manipulate.

Field name for result. Select the name of the field into
which you want to insert the results. You can insert results
into fields that already have data in them, or into fields that
do not have data.

Be very careful when you make this choice. It is very easy to


overwrite data by mistake. If you do this, you will not be able to
recover the original data.

Subfield for result. Select the subfield, if required. The


subfield is only required for coordinate fields and consists of
either X, Y or Z.

Expression to be used. Enter the mathematical


expression to be used to manipulate the data. For
information on creating mathematical expressions, see
Mathematical Expressions on page 2180.

Section II: Workspaces

Gemcom for Windows

Page 2237

2. Click OK.
3. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
4. A status window will appear displaying the progress of the data
manipulation. When the process is completed, click OK to clear
the window from the screen.

Conditional Manipulation of Fields


Selecting this command from the Manipulate Data submenu on
the Workspace menu brings up the following dialog box:

Figure 11-2: Conditional Data Manipulation dialog box


1. Enter the following parameters:

Table to be manipulated. Select the table which contains


the data you wish to manipulate from the pulldown list
provided.

IF:

Enter the logical expression which will determine which


mathematical expression applies to which data. For

Exploration

Chapter 11: Data Manipulation

Page 2238

information on creating logical expressions, see Logical


Expressions on page 2182.

THEN.

Enter the following parameters to be used if the


logical expression is TRUE.

Field name for results. Select the name of the field in


which to insert the results.

Subfield name. If the field you selected for the results


is a coordinate field, you must also select the subfield (X,
Y or Z).

Equals. Enter the mathematical expression which is to


be used to manipulate the data. For information on
creating mathematical expressions, see Mathematical
Expressions on page 2180.

ELSE:

Enter the following parameters to be used if the


logical expression is FALSE.

Field name for results. Select the name of the field in


which to insert the results.

Subfield name. If the field you selected for the results


is a coordinate field, you must also select the subfield (X,
Y or Z).

Equals. Enter the mathematical expression which is to


be used to manipulate the data. For information on
creating mathematical expressions, see Mathematical
Expressions on page 2180.

2. Click OK.
3. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.

Section II: Workspaces

Gemcom for Windows

Page 2239

4. A status window will appear displaying the progress of the data


manipulation. When the process is completed, click OK to clear
the window from the screen.

Transferring Data Between Tables


You can transfer data from a field in one secondary table (the
source table) to a field in another secondary table (the target table)
that has the same data type. Data is only transferred when a
relationship is established between two records in the source and
target tables. This relationship is based on the position of the
records within the respective tables. The position is defined either
by the contents of the FROM-TO fields, or the contents of the
DISTANCE fields.
There are eight different methods of determining the relationship
between records in the source and target tables:

first interval
mid-point of the target interval
exact match
nearest match
nearest mid-point
longest interval
majority rule by length
majority rule by frequency

The applicability of the methods and the results depend on the


combination of the types of source and target tables. The various
combinations of source and target tables in interval and distance
formats for each method are shown in the following charts.

Exploration

Chapter 11: Data Manipulation

Page 2240

First Interval
Source
Table

Target
Table

Comments

Illustration

Interval

Interval

Transferred from the first


complete interval in the
source table lying inside the
interval in the target table.

Interval

Distance

Transferred from the


interval in the source table
that straddles points in the
target table.

Distance

Interval

Transferred from the first


point in the source table
lying inside an interval in
the target table.

Distance

Distance

Not applicable.

Mid-Point of the Target Interval


Source
Table
Interval

Section II: Workspaces

Target
Table
Interval

Comments

Illustration

Transferred from the


interval in the source table
that straddles the mid-point
of the interval in the target
table. Missing intervals are
ignored.

Gemcom for Windows

Page 2241

Source
Table

Target
Table

Comments

Interval

Distance

Transferred from the


interval in the source table
that straddles the mid-point
of the interval in the target
table. Missing intervals are
ignored.

Distance

Interval

Not applicable.

Distance

Distance

Not applicable.

Illustration

Exact Match
Source
Table

Target
Table

Comments

Interval

Interval

Not applicable.

Interval

Distance

Not applicable.

Distance

Interval

Not applicable.

Distance

Distance

Transferred when distance


to the point in the source
table is equal to the distance
to the point in the target
table.

Illustration

Nearest Match
Source
Table
Interval

Exploration

Target
Table
Interval

Comments

Illustration

Not applicable.

Chapter 11: Data Manipulation

Page 2242

Source
Table

Target
Table

Comments

Illustration

Interval

Distance

Not applicable.

Distance

Interval

Not applicable.

Distance

Distance

Transferred from the closest


point in the source table to a
point in the target table.

Nearest Mid-Point
Source
Table

Target
Table

Comments

Illustration

Interval

Interval

Same as Mid-Point, but


missing intervals are
handled using the nearest
complete interval in the
source table to the mid-point
of the target.

Interval

Distance

Same as Mid-Point, but


missing intervals are
handled using the nearest
complete interval in the
source table.

Distance

Interval

Transferred from the point


in the source table closest to
the mid-point of the interval
in the target table.

Distance

Distance

Not applicable.

Section II: Workspaces

Gemcom for Windows

Page 2243

Longest Interval
Source
Table

Target
Table

Comments

Interval

Interval

Transferred from the longest


complete interval lying
inside an interval in the
target table.

Interval

Distance

Not applicable.

Distance

Interval

Not applicable.

Distance

Distance

Not applicable.

Illustration

Majority Rules by Length


Source
Table

Target
Table

Comments

Interval

Interval

Transferred from a set of


intervals in the source table
with similar contents whose
cumulative length when
compared with the other sets
of cumulative lengths within
the same interval in the
target table, forms the
longest interval.

Interval

Distance

Not applicable.

Distance

Interval

Not applicable.

Distance

Distance

Not applicable.

Exploration

Illustration

A
A
B
B
A
A
A
B
A
A
B

Chapter 11: Data Manipulation

Page 2244

Majority Rules by Frequency


Source
Table

Target
Table

Comments

Illustration

Interval

Interval

Not applicable.

Interval

Distance

Not applicable.

Distance

Interval

Transferred from a set of


points in the source table
with similar contents, whose
frequency when compared to
the other sets of points
within the same target
interval is the greatest.

Distance

Distance

A
A
A
A
B
B
A
A
A
B

Not applicable.

To transfer data from a field in one secondary table (i.e., any table
other than the header table) to a field in another secondary table
that has the same data type, follow these steps:
1. Select Workspace } Manipulate Data } Cross-Table Transfer of Data.
Enter the following parameters in the dialog box that appears.

Transfer data from. Select the table, field name and, if


applicable, subfield which contain the data you wish to
transfer.

Into. Select the table, field name, and, if applicable, subfield


into which you wish to transfer your data. Note that the
type of field you choose must be the same as the type of field
chosen in the Transfer data from parameters.

Click OK.

Section II: Workspaces

Gemcom for Windows

Page 2245

Figure 11-3: Cross-Table Data Transfer dialog box


2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
3. Select the desired transfer method from the list that appears
and click OK. The options available in the list will depend on the
structure of the source and target tables. All available transfer
methods are described in the table above.
4. A status window will appear displaying the progress of the data
transfer. When the process is completed, click OK.

Linear Interpretation of Field Values


This function can be used to fill in any missing data values in a
selected field and create any missing records in a series of consecutive
records. This process uses the valid data in the records immediately
preceding and following the records without values. The new values for
these empty records are determined using linear interpolation based
on the mid-point of the FROM-TO values, or the average of the
DISTANCE values of the affected records.

Exploration

Chapter 11: Data Manipulation

Page 2246

Figure 11-4: Linear Interpretation of a Field dialog box


1. Select Workspace } Manipulate Data } Linear Interpretation of Field.
Enter the following parameters into the dialog box that
appears:

Table for interpretation. Select the table which contains


the field with missing values you want interpreted.

Field to be interpreted. Select the field which contains


the missing values you want interpreted.

Field for interpreted result. Select the field into which


you want the interpreted values inserted.

Field for interpretation flag. If you have a logical field in


your table, you can designate it as a flag for marking
records which have had values inserted as a result of linear
interpretation. The linear interpretation process will set the
flag to TRUE for records which have been changed by the
process, while records which have not been changed will

Section II: Workspaces

Gemcom for Windows

Page 2247

Case 1:

Angle = (340 + 40) 2


= 190

Angle = 340 or -20


Angle = 40
In Case 1, the interpolated value
is created by averaging the
two original values. The line
created may not bisect the
original segment.
In Case 2, the interpolated value
bisects the segment created
by the original angles.

Case 2:

Angle = 10

Figure 11-5: Treating values as angles in


linear interpretation of fields
have the interpretation flag set to FALSE. (Note that if you
run this process more than once, all the flags will be reset.)

Interpret values with interval <=. Any values with


intervals less than or equal to the value you enter in this
field will be interpreted.

Treat values as Angle value. Select this option if the


values you want interpreted are angle values. If this option
is selected, values between 0 and 360 will be averaged so
that the interpolated value will be the bisect line for the
smallest possible angle. In the example shown in Figure 115, where the two source values are 40 and 340, the
interpolated value would normally be 190 (the average of 40
and 340). If these values are treated as angles, however, the

Exploration

Chapter 11: Data Manipulation

Page 2248

interpolated value is 10 (the angle of the line bisecting a 40


and a 340 angle).

Fill from start to first known value. This determines


how any values in records before the record with the first
known value will be interpreted. Select from the following
options:

With zero. Zero (0) will be entered as the field value in


all records before the record containing the first known
value in this field.

With original. All records before the record containing


the first known value will be filled with the first known
value.

Fill from last known value to end. This determines how


any values in records before the record with the first known
value will be interpreted. Select from the following options:

With zero. Zero (0) will be entered as the field value in


all records after the record containing the last known
value in this field.

With original. All records after the record containing


the last known value will be filled with the first known
value.

With last known value. All records after the record


containing the last known value will be filled with the
last known value.

Create missing records. Select this option if you wish to


create any records that Gemcom for Windows determines
are missing. A record is considered to be missing if the TO
value in one record is greater than the FROM value in the
previous record. In such cases, if you select this option,
Gemcom for Windows will create a record between these two
records in which the FROM-TO interval is the space between
the original TO and FROM values, as in the following
example:

Section II: Workspaces

Gemcom for Windows

Page 2249

Record No.

FROM

TO

1
2

15
27

23
35

Record No.

FROM

TO

1
2
3

15
23
27

23
27
35

becomes

in which record number 2 is a new record.

Create records with interval >= to. If you activated


Create Missing Records, you can enter a number to limit the
creation of records to intervals greater than or equal to a
certain length. In the example above, the new record, which
has an interval of 4, would not be created if the number
entered here were greater than 4.

Field for creation flag. If you have a logical field in your


table, you can designate it as a flag for marking records
which have been created by this process. The linear
interpretation process will set the flag to TRUE for new
records, while pre-existing records will have the
interpretation flag set to FALSE.

2. Click OK.
3. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
4. Status windows will appear displaying the progress of the
record creation process (if selected) and the linear
interpretation process. When complete, click OK to clear the
status window from the screen.

Exploration

Chapter 11: Data Manipulation

Page 2250

Figure 11-6: Format String Field dialog box

Formatting String Fields


This command allows you to format string (alphanumeric
character) fields in Gemcom for Windows tables. You can also use
this command to import data into a string field by combining
(concatenating) the data from two other string fields in the same
table.
1. Select Workspace } Manipulate Data } Format String Field. Enter the
following parameters:

Table to be formatted. Select the table that contains the


string field to be formatted.

Field to be formatted. Select the field that you wish to


format. Note that only string fields will appear in the list.

Formatting Option. Select from among the following:

Section II: Workspaces

Left justify. Left justifies the data in the field.

Right justify. Right justifies the data in the field.

Strip blanks and left justify. Removes all blanks at


the beginning and end of the field and left justifies the
data.
Gemcom for Windows

Page 2251

Strip blanks and right justify. Removes all blanks at


the beginning and end of the field and right justifies the
data.

Concatenate two string fields. Takes the data from


two other string fields and consolidates them into one
field. If you select this option, the following two
parameters become active and must be entered:
Source field 1. Select the name of the first
field from which you want to take the data
for the concatenated field.
Source field 2. Select the name of the first
field from which you want to take the data
for the concatenated field.

2. Click OK. The Select Records to Process dialog box will


appear. Select the option you wish to use as outlined in
Chapter 4: Dialog Boxes, Volume I: Core.
3. A status window will appear displaying the progress of the
string field formatting process. When complete, click OK.

Coordinate Transformations
Gemcom for Windows can express coordinates in one of two
coordinate systems. These systems are the alternate system (such
as the UTM or NTS system) and the local system (such as a
property or mine system). You can transform location information
from one coordinate system to another.

Alternate to local transformation. This transformation


should be used when an alternate coordinate system is to be
transformed to a local coordinate system. You will know the
coordinates of the origin of the local system in terms of the
alternate system, and the rotation angle between the local
system and the alternate system.

Exploration

Chapter 11: Data Manipulation

Page 2252

These formulae are used:


Nl =

El =

Zl =

[( N

N o ) * COS ( Ro ) ( E a E o ) * SIN ( Ro )
Sh

[( N

N o ) * SIN ( Ro ) + ( E a E o ) * COS ( Ro )
Sh

(Za Zo )
Sv

where

Na, Ea, Za

are the northing, easting and elevation


coordinates of the point being transformed,
defined in the alternate coordinate system.

No, Eo, Zo

are the northing, easting and elevation


coordinates of the origin of the local grid, defined
in the alternate coordinate system.

Nl, El, Zl

are the northing, easting and elevation


coordinates of the point being transformed,
defined in the local coordinate system.

Ro

is the local grid offset orientation angle


measured in degrees clockwise from the local
grid north to the alternate grid north.

S h , Sv

are the horizontal and vertical scale correction


factors for the geodetic alternate coordinate
system in the area of the local grid. If these scale
factors are unknown they should be set to 1.0.

Local to alternate transformation. This transformation


should be used when a local coordinate system is to be
transformed to an alternate coordinate system. You will know
the coordinates of the origin of the local system in terms of the

Section II: Workspaces

Gemcom for Windows

Page 2253

alternate system, and the rotation angle between the local


system and the alternate system.
The following formulae are used:

N a = N o + S h * N l * COS ( Ro ) + E l * SIN ( Ro )

E a = E o + S h * N l * SIN ( Ro ) + E l * COS ( Ro )
Z a = Z o + Sv * Zl

where
the variables are the same as for the formulae for alternate to
local transformation.
To perform a coordinate transformation, follow these steps:
1. Select Workspace } Manipulate Data } Coordinate Transformation.
Enter the following parameters into the dialog box that
appears:

Table with Coordinate Field. Select the table which


contains the field for which you wish to transform
coordinates.

Original Coordinate Field Name. Select the field which


contains the coordinates you wish to transform.

Transformed Coordinate Field Name. Select the field to


which you wish to write the transformed coordinates. This
may be the same as the field which contains the coordinates
if you wish to overwrite the original coordinates.

Transformation. Select the type of transformation you


wish from the following two options (as described above):

Exploration

Local to Alternate.
Alternate to Local.

Chapter 11: Data Manipulation

Page 2254

Figure 11-7: Coordinate Transformation dialog box

Coordinate of Local Origin. Enter the northing, easting


and elevation coordinates of the origin of the local system,
as defined in the alternate system.

Offset Angle (Clockwise). Enter the local grid offset


orientation angle, measured in degrees clockwise from the
local grid north to the alternate grid north.

Scale Factors. Enter the horizontal and vertical scale


correction factors for the geodetic alternate coordinate
system in the area of the local grid. If these scale factors are
unknown, they should be set to 1.0.

Click OK.
2. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
3. A status window will appear displaying the progress of the
coordinate transformation process. When complete, click OK.
Section II: Workspaces

Gemcom for Windows

Page 2255

Desurveying Tables
You can calculate the location of data stored in interval and
distance format in either drillhole or traverse type workspaces
using a process known as desurveying. This process uses all the
available location and survey data that define the start and path of
drillholes and traverses to calculate the coordinates of the centre of
each sample.
Only tables that meet all of the following conditions can be
desurveyed:

It must be a secondary table in the workspace.

It must be in either interval or distance format.

It must have a coordinate field, which can have any name.

For more information, see Desurveying Data on page 2153.


Follow these steps to desurvey data in a secondary table of a
drillhole or traverse workspace:
1. Select Workspace } Manipulate Data } Desurvey Tables of Data. Enter
the following parameters into the dialog box that appears

Table to be desurveyed. Select the name of the table to be


desurveyed.

Field for desurveyed coordinate. Select the name of the


field into which you want the de-surveyed coordinates
inserted.

Reference Position. (This parameter will appear if the


table you are desurveying is in interval format.) Select one
of the following three options:

FROM.

Select this option to use the value in the FROM

field.

Exploration

Chapter 11: Data Manipulation

Page 2256

MID-POINT.

Select this option to use the mid-point


between the values in the FROM and TO fields.

TO.

Select this option to use the value in the TO field.

2. Click OK.
3. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
4. A status window will appear displaying the progress of the
desurveying process. When complete, click OK.

Special Drillhole Data Processes


This command allows you to manipulate drillhole data that you
have imported from another system so that it meets the
requirements of the Gemcom for Windows format. You may need to
relocate certain data, or you may need to deduce new fields from
the data. Specifically, the following conditions may exist:

The azimuth and dip measurement at downhole distance zero


for each drillhole may appear in the header table instead of the
survey table. Since this information is required in the Gemcom
for Windows survey table, the data must be copied from the
header to the survey table.

The downhole data that describes intervals may be in distance


format, and it needs to be converted to interval format for use in
Gemcom for Windows. To do this, you will first need to modify
the structure of your workspace by renaming the DISTANCE field
to either FROM or TO, and creating a new (blank) field named TO
or FROM. You can then use the appropriate field binding option
to convert the distance data to interval format.

The values for drillhole length may be missing from the


Gemcom for Windows header table. This problem can occur
when importing historical data. Since the drillhole lengths must

Section II: Workspaces

Gemcom for Windows

Page 2257

appear in the Gemcom for Windows header table, the


information must be copied in from other tables.
Follow this procedure:
1. Select Workspace } Manipulate Data } Special Drillhole Data Process.
2. A dialog box entitled Method for Special Manipulation will
appear. Select one of the four following options:

Transfer Information from Header to Survey Table.


Select this option to create the first survey measurement for
each drillhole in the survey table by copying the necessary
data from the header table into the survey table,
overwriting any existing survey table records. This option
also supports special values.

Field Binding (current to next record). The field


binding options allow you to switch the recording method in
a table from distance format to interval format. Select this
option to carry values from the specified source field to the
specified target field in the following record. For example,
you can use this option to create FROM values by binding the
current DISTANCE value (which will become the TO value) to
the FROM field in the next record.

Field Binding (current from next record). Select this


option to carry values from the specified source field to the
specified target field in the preceding record. For example,
you can use this option to create TO values by binding the
current DISTANCE value (which will become the FROM value)
to the TO field in the previous record.

Set Hole Length Based on Selected Tables. Select this


option to adjust the drillhole length in the header table
automatically based on the longest measurement found in
the TO or DISTANCE fields in the selected table(s).

Exploration

Chapter 11: Data Manipulation

Page 2258

If you select either of the Field Binding options:


The Special Field Binding Manipulation dialog box will
appear. Enter the following parameters:

Table Name. Enter the name of the table which contains


fields you wish to bind.

Source Field Name. Select the name of the field which


will contain the data to be copied.

Target Field Name. Select the name of the field which will
contain the data copied from the source field.

Initial Target Value. Select one of the following four


options to determine the value of the target field in the first
record.

Section II: Workspaces

Initialize with Zero. If you are expanding TO values to


create a FROM data column, you may need zero for the
first record in the target field.

Initialize with Hole Length. If you are expanding


FROM values to create a TO column, you may need to
specify the hole length as the first record in the target
field.

No Initialization. The target field in the first record


will be blank. Select this option if you want to enter a
specific value (other than zero) for the first record in the
target field using the workspace editor (see Chapter 6:
Editing Data).

Initialize with Source. Select this option if you would


like the program to use the existing value found in the
first record in the source field.

Gemcom for Windows

Page 2259

If you select Set Hole Length Based on Selected Tables:


A list of the tables in the current workspace will appear. Select
the table(s) on which to base the hole length setting and click
OK.
3. Click OK. If you selected one of the field binding options in step
2, you will be asked to accept the definition you just created.
Click Yes to do so.
4. The Select Records to Process dialog box will appear. Select
the option you wish to use as outlined in Chapter 4: Dialog
Boxes, Volume I: Core.
5. A status window will appear displaying the progress of the
selected special drillhole data process. When the process is
complete, click OK to clear the window from the screen.

Exploration

Chapter 11: Data Manipulation

Anda mungkin juga menyukai