# INPUTS

This command section includes all commands related to accessing and reading forest inventory data.

There are three main sources that OSM can read data from, with the first two being the most well tested and recommended:

1) SQLite (*.sqlite) database (new in 2025)

2) Microsoft Access (*.mdb, *.accdb) database

3) OLE data connections (Databases, Servers, Excel) if a full OLE connection string is used (not well tested)

Two required tables must be present in the database:

1) OSM_STANDLIST – contains stand-level attributes

2) OSM_TREELIST – contains tree-level attributes.

See input tables for a detailed description of tables and columns required.

Connecting to a database

Changing OSM input table names

USA units

Speeding up inventory record loading

## Connecting to a database using the ‘SOURCE’ command

SQLite and Microsoft Access 2002-2013 are preferred (well tested) data sources recommended when loading data to OSM through the INPUTS commands.

To connect to an access database, simply state:

INPUTS.Source “C:\MyPath\MyInventoryData.sqlite”

OR

INPUTS.Source “C:\MyPath\MyInventoryData.accdb”

Relative paths can be used. The working directory is always the same directory as the OSM command file.

##

## For data sources other than Access or SQLite, a fully qualified connection string is required.

## INPUTS.Source “My connection string”

##

## Changing OSM input table names

By default OSM will look for tables or queries named OSM_STANDLIST and OSM_TREELIST to load inventory records.

To change the OSM_STANDLIST table name to simply STANDS:

INPUTS.StandList “STANDS”

To change the OSM_TREELIST table name to simply TREES:

INPUTS.TreeList “TREES”

OSM is not case-sensitive and double quotes are only required around arguments if they contain spaces.

##

## USA units

By default OSM assumes metric units; however, USA (English) units can be used in tables.

INPUTS.Units USA

By using the command above, OSM will convert the USA units to metric on import.

Note that to report in USA units, you must also specify the unit system in the OUTPUTS commands.

## Speeding up inventory record loading

##

A column index on the SurveyID column in your OSM_TreeList table will vastly speed record reading for large datasets (>100 tree lists). Since 2025, OSM will try to add and index on this column for you automatically on the first time it tries to load trees from your database.

The screen shot below shows the index applied. You can add this manually if OSM fails to add it during runtime.

Why is an index so important?

When SurveyID is not indexed, OSM must read through all tree records in the OSM_TreeList table to select trees associated with the stand to be simulated. If 100 stands are to be simulated, then OSM must scan all OSM_TreeList records 100 times. This repeated reading will cause an exponential slowdown to your overall simulation processing as the number of records in OSM_TreeList increases. This issue can be avoided by adding an index to your SurveyID column in the OSM_TreeList table. The index allows the database to pull out records for the stand to simulate with a single operation.