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:
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
Page 2152
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.
Page 2153
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
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.
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
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.
Known coordinate
(X, Y, optional Z)
Traverse Type 1
FROM Distance
TO Distance
Known coordinate
(X, Y, optional Z)
Traverse Type 2
Exploration
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.
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)
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
Exploration
Page 2158
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:
Page 2159
Interval Interval
Interval Distance
Distance Interval
Distance Distance
Exploration
Page 2160
ASSAYS
ASSAYS:GOLD
LITHOLOGY:ROCK-CODE
HEADER:HOLE-ID
ASSAYS
INTEGER
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
INTEGER
Exploration
Page 2162
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.
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:
Page 2163
Exploration
Page 2164
Data
In this part of the Define Extraction Parameters dialog box, you
will define which data is to be extracted. Enter the following
parameters:
Use FROM. Select this option to use the value in the FROM
field for each record.
Page 2165
Use TO. Select this option to use the value in the TO field for
each record.
Exploration
Page 2166
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.
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
Page 2167
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
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.
Page 2169
Exploration
Page 2170
Other Systems
You can use the extraction file in Gemcoms PC-MINE system to
perform the following functions:
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.
Exploration
Page 2172
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.
Page 2173
Exploration
Page 2174
Page 2175
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.
Exploration
Page 2177
Chapter 9
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:
Exploration
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.
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:
User Constants
There are three types of user constants:
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>
<Operator>
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
()
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
ACOS
ATAN
Exploration
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>
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.
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:
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
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
Page 2185
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
Page 2186
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
SIN
COS
TAN
ASIN
ACOS
ATAN
Exploration
Page 2188
Undo. Click this button to undo your last edit to the logical
expression displayed in the filter editing area.
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
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.
Page 2189
Undo. Click this button to undo your last edit in the filter
editing area.
Exploration
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
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.
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.)
Exploration
Page 2192
Page 2193
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:
All. Clicking this button will select all records currently in the
list.
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
Page 2194
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.
Page 2195
Exploration
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.
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:
Exploration
Page 2198
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.
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.
Exit. Use this command to exit from the text editor and
return to Gemcom for Windows.
Exploration
Page 2200
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
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
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.
Page 2203
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
R =
C =
Hole-id: PC-001
Exploration
Page 2204
Comments:
Iw
Fw.d
Length:
12345.67
Y:
1234567.89
Page 2205
Bw
Closed?: TRUE
Variables
There are four system variables:
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
Page 2206
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.
Page 2207
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
Formatting commands
Procedural commands
Exploration
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
Purpose
Example
*
Usage
* comment line
Purpose
Example
Page 2209
HEADER
Usage:
Example:
This line will print Example Report and the page number
at the top of each page in columns 1 and 60
respectively.
Exploration
Page 2210
FOOTER
Usage
Example
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
Example
PAGE
Page 2211
MAXROW
Usage
MAXROW n
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
Example
MAXCOL 128
Exploration
Page 2212
DELIMITER
Usage
DELIMITER <char>
or
D <char>
Remarks
Example
DELIMITER
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:
Page 2213
BOLD
Usage
BOLD <Status>
Remarks
Example
BOLD ON
COMPRESSED <Status>
Remarks
Example
COMPRESSED ON
Exploration
Page 2214
DATEFMT
Usage
DATEFMT <format>
Example
DATEFMT GEN
HEADER 1# Date: 10# @DATE@
LINE <n>
Example
LINE 4
Page 2215
Complex LINE
Usage
Example
yields
DISTANCE
0.00
100.00
DIP
-90.00
-86.00
AZIMUTH
0.00
54.00
yields
DISTANCE
DIP
0.00
-90.00 0.00
100.00 -86.00 54.00
Exploration
AZIMUTH
1
2
Page 2216
THEADER
Usage
Remarks
Example
yields
DISTANCE
DIP
AZIMUTH
Page 2217
OUTPUT
Usage
Remarks
TABLE
Usage
Remarks
Exploration
Page 2218
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
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
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
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
Remarks
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
Page 2221
Block of commands
DO TABLE=SURVEY WHILE
Block of commands
DO TABLE=ASSAYS WHILE
Block of commands
END
END
END
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
Page 2222
END
Usage
END
Purpose
Remarks
Example
DO TABLE=HEADER WHILE
Block of commands
END
Page 2223
IF - ENDIF
Usage
IF <Logical Expression>
Block of Commands
ENDIF
Purpose
Example
IF ASSAYS:GOLD LE 1.5
IF <Logical Expression>
Block of Commands
ELSEIF <Logical Expression>
Block of Commands
ELSE <Logical Expression>
Block of Commands
ENDIF
Purpose
Remarks
Exploration
Page 2224
Example
IF ASSAYS:GOLD LE 1.5
Page 2225
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:
Exploration
Page 2226
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:
Page 2227
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
Page 2228
Page 2229
ERR Entries. This displays the number of records for which the
entry in this field generated an error.
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
Page 2230
Table Number
Table Name
Number of Fields
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
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
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:
Exploration
Page 2234
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:
Page 2235
THEN
ELSE
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
Page 2236
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.
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.
IF:
Exploration
Page 2238
THEN.
ELSE:
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.
Page 2239
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
Exploration
Page 2240
First Interval
Source
Table
Target
Table
Comments
Illustration
Interval
Interval
Interval
Distance
Distance
Interval
Distance
Distance
Not applicable.
Target
Table
Interval
Comments
Illustration
Page 2241
Source
Table
Target
Table
Comments
Interval
Distance
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
Illustration
Nearest Match
Source
Table
Interval
Exploration
Target
Table
Interval
Comments
Illustration
Not applicable.
Page 2242
Source
Table
Target
Table
Comments
Illustration
Interval
Distance
Not applicable.
Distance
Interval
Not applicable.
Distance
Distance
Nearest Mid-Point
Source
Table
Target
Table
Comments
Illustration
Interval
Interval
Interval
Distance
Distance
Interval
Distance
Distance
Not applicable.
Page 2243
Longest Interval
Source
Table
Target
Table
Comments
Interval
Interval
Interval
Distance
Not applicable.
Distance
Interval
Not applicable.
Distance
Distance
Not applicable.
Illustration
Target
Table
Comments
Interval
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
Page 2244
Target
Table
Comments
Illustration
Interval
Interval
Not applicable.
Interval
Distance
Not applicable.
Distance
Interval
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.
Click OK.
Page 2245
Exploration
Page 2246
Page 2247
Case 1:
Case 2:
Angle = 10
Exploration
Page 2248
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
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
Page 2250
Page 2251
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.
Exploration
Page 2252
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
No, Eo, Zo
Nl, El, Zl
Ro
S h , Sv
Page 2253
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:
Exploration
Local to Alternate.
Alternate to Local.
Page 2254
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
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:
FROM.
field.
Exploration
Page 2256
MID-POINT.
TO.
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.
Page 2257
Exploration
Page 2258
Target Field Name. Select the name of the field which will
contain the data copied from the source field.
Page 2259
Exploration