Inject data

Use the batch tool

  1. Navigate to the [Installation_Path]/Datastore/DatastoreRuntime directory.
  2. To start the command tool and display the list of available commands, type:
    dstools help
  3. Enter or select a command.

When the execution is terminated without error, the return code of dstools is 0 , otherwise it is different from 0.

Inject data into the database

After the Designer configuration has been deployed to Datastore Runtime:

  • Inject the period data to use in the partition computation:
    dstools inject --collection PERIOD_COLLECTION ../getStarted/withAccountingIntegration/data/period.dat
  • Inject the ap.IEvent_Trace data:
    dstools inject --collection AUDIT_COLLECTION ../getStarted/withAccountingIntegration/data/ap.IEvent_Trace
    where: --collection indicates the collection type name

Priority rules of encoding during injection

There are several methods to define a parameter. The system searches the value of a parameter in the following order:

  1. Command line argument
    • From the command line
    • From a parameter file (@param file)
  2. Functional setup. For example, the encoding parameter defined in a collection type reader.
  3. Datastore Runtime settings:
    • Profile settings
    • Dynamic settings
    • Default settings displayed as Default value by the command dstools settings list
  4. From the system where the application is executed (dstools / webapp)

When the system finds a value, the searching process stops. For instance, when defined, the encoding argument from the command line is used instead of any other encoding parameter.

Collection type identification

The collection type is identified using the following rules:

  • If collection and version are defined, the corresponding collection type is used.
  • If only collection is defined, the last valid version of the corresponding collection type is used.
  • If none of these parameters are set, the collection is identified using conditions. The collection type that validates its conditions using a properties file is used.

Example of properties file identification:

dstools inject

  1. If file1.<properties-ext> exists, it is used as a properties file.
  2. If exists, it is used as a properties file.

Regardless of the collection type identification, collection properties are set from the identified properties file.

Example of a collection type condition


Where DEPT_ID is a number collection property type and TARGET_APPLICATION is a string collection property type.

Example of a properties file that validates these conditions:

  • using a java properties file structure



  • using an XML structure:
    <?xml version="1.0" encoding="ISO-8859-1"?>
Note   the XML structure must be used when the properties file encoding is specific.

Import codes

Import codes are used to identify object types using values which are different from the object type names.

It is defined at design time as an object type import code. At injection time, the process reads the structure identifier and identifies the object type using its name or its import code.

After the object type is identified, the import code is no longer used.

Names starting with an underscore

Object types and element types that have a name or an import code starting with an underscore "_" can be identified without this character at injection time.

For instance, the ObjectType named _ObjectTypeA can be identified either by ObjectTypeA or by _ObjectTypeA string at injection time.

Virtual objects

When the collection type manages virtual objects, the input file is composed by element records only. At injection time, an object is created using inherited properties from elements.

To use Virtual Objects, it is required to define each inherited property type as criteria.

Inject data from a standard input

In Unix-like environments, you can inject data from a standard input to avoid the creation of temporary files. To inject data from a standard input, do not specify any file to inject. For example, execute the following command to untar and inject the data.tgz file on a Linux system:

tar -xzf data.tgz | dstools inject --collection COLLECTION_A --date 20120202

Files with packed or signed information or files from MVS / AS400

Some of the delivered standard AccountingIntegrator readers and formatters support packed data (« COBOL Computational-3 » or « comp-3 »).

To use these readers and formatters into Datastore:

  1. Depending on your environment, in the collection type definition, select one of the following readers:
    • aiPackedDefaultReader (Windows / UNIX / Linux)
    • aiAS400Reader (AS400)
    • aiMVSReader (MVS)
  2. In the collection type definition, check that the specified encoding matches (UTF-8, EBCDIC or other).
  3. You can also specify the encoding at import time using the corresponding command line argument.
  4. In the format definition, select packedDataFormatter for packed fields.


  • Readers managing packed data are more CPU-consuming than other readers. Use them only if packed data management is needed.
  • Because the management of packed data is not compatible with multi-byte encodings, files must have a monobyte encoding (ASCII, EBCDIC or even UTF-8, and so on, as long as only single byte values are used).
Caution   SIGNED ASCII is not supported in this version.

Limitations for aiPackedDefaultReader

  • Make sure you did not select a footer in the collection type definition, as this will make the import fail.
  • Avoid using packed data in the first field of any object or element of the collection type, as this could break the import.
  • Do not trim extra spaces for non-filled fields. For AccountingIntegrator, this means that the RTrim_OSegt configuration setting must be set to No.

Transfer AS400 or MVS file

Use an FTP transfer with the LITERAL SITE RDW option to get the file from the mainframe.


  1. > ftp
  3. cd 'FOLDER'
  4. binary
  5. mget FILE
  6. exit

Files with signed property types

To import files with signed fields, the signed fields must be defined with either the formatter asciiSignedDataFormatter or the formatter ebcdicSignedDataFormatter, depending on the format of the field.

Files with decimal property types

To import files with decimal fields, the fields must be defined with the formatter decimalFormatter.

To import files with Variable Flat File decimal fields, the fields must be defined with the formatter commaDecimalFormatter.

Files with date property types

At import time, Datastore checks that property values match with their data type pattern.

Date property values that contain only 0, only 9 or only spaces are considered as null value, to avoid generating useless error messages. Examples: 00000000, 99999999.

Injection tuning

Datastore includes a set of default parameters. If you use the default values of the parameters, Datastore will not take advantage of the resources available. In production, you must tune the parameters. See the Datastore Capacity Planning Guide for more information on the tuning process.

Apply your own business control

You can add your own business control to the Datastore injection process to control each collection, object, or element. This allows you to describe and inject an error record that is linked with the record in error (collection / object / element). System relationships are defined to allow navigation between a record and its errors.

The implementation process is detailed in the "Import Control" section of the file <Install>/Datastore/DatastoreRuntime/extra/java/readme.txt.

Related Links