DataLoader/MX Reference Manual (H06.03+, J06.03+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual543544-001
5-31
Generating Test Data
This procedure returns a value 0, if the odometer has reached its maximum value and
DTLIncOdometer has started to return duplicate combinations. A nonzero value
indicates that the result is not a repeat of the first combination.
DTLINCODOMETERCOB
This procedure can be called from a COBOL program. It is the same as the
DTLIncOdometer, except that the Len parameter provides the length of parameter
Odometer.
The syntax is:
Cartesian Fields
A powerful mechanism for generating test data with DataLoader/MX, a Cartesian field
is a group of one or more columns, each of which has its own list of possible values.
When directed to generate the next set of values in a Cartesian field, the
DTLCartGenerateField procedure returns the next Cartesian product of the values of
the individual columns.
For example, suppose that you want to generate a set of female names. To generate
millions of them, each unique, you cannot simply create a list. Instead, you use a
Cartesian field with three columns in it. The first column is the first name, the second
column is the middle name, and the last column is the last name.
Next, collect as many female first names as possible. DataLoader/MX includes a
number of lists of sample data. Its list of female first names has 421 unique entries.
Then generate a list of last names or use the DataLoader/MX’s list of last names,
which has 6,753 unique entries. Using that list, you have 2,843,013 (421 * 6,753)
unique first name, last name combinations. If this is enough, you can eliminate the
middle name column.
If you need more names, you could make the middle column represent a middle initial,
with one of 26 unique values. This step raises the number of unique combinations to
73,918,338 (421 * 26 * 6,753). If this is not enough, you can duplicate the last name
field in the middle name field, giving 6,753 middle names and 19,198,866,788 (421 *
6,753 * 6,753) unique combinations. In addition, you could add first or last names or
even add a title column to the field.
DataLoader/MX has two utility procedures to support Cartesian fields:
DTLCartAddCol enables you specify how many columns are in a given Cartesian
field, the order of the columns, and the file that contains the list of values that each
column can take on. Call DTLCartAddCol once for each column in each field. Call
it from the INITIALIZE1 or INITIALIZE2 user exits.
DTLCartGenerateField returns the next combination of values for the specified
field. Call it from GETNEXTRECORD.
long DTLINCODOMETERCOB( char* Odometer, short Len );