APIs Used with the Archive Utility


Overview

Tasks

Included with

Tivoli Problem Management

Overview

The flat file option

If you choose to archive data to a flat file, you must be aware that manipulating the exported flat file requires significant effort. The files are large and generally unwieldy.

Choosing the flat file option results in a file that places one record from a table into one line in the file.

There are five tables from which the archive utility reads data, but there are six label types, or tags, for the lines in the flat file.

Flat file tags

Labels are called tags in the eaacust.kb knowledgebase. The flat file tags are:
  • CALL
  • CALLI
  • SESION
  • PROBLEMS
  • WORK_HISTORY
  • PROBLEM_HISTORY

The reason there is a CALL label as well as a CALLI label is that CALLI indicates an information call. An information call is a call that is created in Tivoli Problem Management without opening a corresponding problem. This means that only a CALL and one or more SESION records were created in the Tivoli Problem Management database.

Flat file format

The fields in a flat file occur in the same order as they do in the Tivoli Problem Management Entity Relationship Diagram for your particular version of Tivoli Problem Management.

There is a distinction between string and non-string values. If a column is created as a char value, it is considered to be a string in the flat file. In this case, the value is surrounded by double quotes, like "string." The delimiter for columns in the database is considered a non-string and is not surrounded by double quotes.


Tasks

Creating a parse program for a flat file

When you create a program to parse the individual lines of a flat file, you need to read the tag. The tag is followed by a triple pipe sequence (|||) to differentiate the tag from the start of the first field.

When you create a parse program for a flat file, you should do the following:

  1. Read the characters to the triple pipes.
  2. Parse the columns. You must take into account whether the columns are strings or non-strings.

All strings can be customized by editing eaacust.kb. The file export characters are shown here.

File Export Characters Definition
EOL IS '' End of line. This is the character placed at the end of a line in the output text file. It is currently blank. If you want a character to appear at the end of each line in the flat file, you must modify this constant accordingly.
STD IS '"' String delimiter / wrapper. This is the character placed "around" the strings that are exported from the database tables. Strings consist of char and varchar columns, for example. The default is the double quote (").
DELM IS ',' Column delimiter. This is the character used to separate the exported columns in the flat file export. The default is the comma (,).
ND IS '' Non-string column delimiter / wrapper. This is the character placed around non-string columns in the output text file. Its default is the empty string. In other words, nothing is wrapped around non-strings.
SEP IS '|||' Divider to separate the tags from the first column in the flat file. This is the separator between the record tag and the start of the exported data for one row in the flat file. Its default is the triple pipe (|||).

If changes are made to eaacust.kb, the file must be re-parsed.

Processing a flat file

To process a flat file created by the Archive Utility, use the following outline for the algorithm that recreates the relations between the CALL, SESION, PROBLEMS, WORK_HISTORY, and PROBLEM_HISTORY tables.
  • If you read a CALLI tag, process the CALLI line and any of the following lines with the SESION tag until you see either another CALLI or a CALL tag.
  • If you read a CALL tag, process the CALL line and any SESION and CALL lines until you read a PROBLEM tag. Also process the PROBLEM tag to complete all the associations.