The syntax for the field definition depends on the field type.
The general syntax for string fields is:
[ FIELD ]
LEN = number
TYPE
[ FLDSEED = "value" ]
[ FLDSEP = "value" ]
ENDFLD | ;
[ PAUSE = number ]
The following test files give examples with
full syntax.
The following test files give examples with
the shorter syntax.
You should be able to emulate these test files
to get started with your own test cases. Search
for the field type, like alpha, and
then look at the examples.
If you have examples that should be added to
these test cases, please send them to me.
Thank-you.
field len = 10 alpha endfld
Note:
field len = 20 text endfld
Note:
field "" endfld
Note:
field select
Note:
field len = 20
Alternate syntax:
field letters = "0123456789ABCDEF"
Note:
field sequence endfld
Note:
The numeric data type contains unsigned
decimal digits. For a signed integer, use
amount with 0 decimals.
The distribution is based on the number of
decimal digits in the number. For a fixed number
of digits, the distribution is normal. For
a variable number of digits, the distribution
approximates a logarithmic distribution, base 10.
Examples:
field len = 8 numeric endfld
Alternate syntax:
field numeric len = 8 endfld
Note:
The integer data type contains unsigned
decimal digits. For a signed integer, use
amount with 0 decimals.
The distribution is pseudo-logarithmic, base 2,
because the number of bits in the number is linear.
Examples:
field integer bits = 8 endfld
Note:
The real data type has a normal distribution or
approximates a logarithmic distribution, base 10.
Examples:
field len = 10
Alternate syntax:
field real
field real
field real
Note:
The amount data type approximates
a logarithmic distribution, base 2.
Examples:
field amount
Note:
Examples:
field sinewave
field sinewave
Note:
field intrange -100 to 100
Note:
field avgintrange -100 to 100
Note:
field flrange -10.0 to 10.0 endfld
Note:
field avgflrange 50.0 to 150.0 endfld
Note:
field fulldate endfld
Note:
field date endfld
datagen computes each date and time field
when generating the field.
Therefore the time in the last record may differ
from the time in the first record.
Generate a formatted date within a range of dates.
Syntax:
field daterange
Example:
field daterange
If you want to know the julian day for a
calendar date, run the program
g2jd.
daterange adheres to the Julian calendar
if the date is prior to October 15, 1582. This
means that year 0 does not exist, and the dates
October 5 through October 14, 1582 do not exist.
daterange calls the strftime
function.
The format within the quoted string adheres to
the format required for that function.
See the man page for strftime
to learn about the date format.
See also record level
Output Rate.
Pauses are optional in Datagen.
Datagen treats a pause like a
field without data. To pause between records,
insert a pause statement after the last
field on the record.
PAUSE = number
Example:
field len = 20 alpha endfld
Note:
PAUSERANGE number TO number
Example:
field len = 20 alpha endfld
AVGPAUSE number TO number
Example:
field len = 20 alpha endfld
PAUSEBITS = number
Example:
field len = 20 alpha endfld
Table of Contents
Job and Record Level Definitions
Test Files
Alpha Fields
Alpha
Examples:
field len = 10 to 20 alpha endfld
field avglen = 10 to 20 alpha endfld
field len = 10
alpha
fldsep = " & "
endfld
field len = 10
alpha
totlen = 15 rpad = " "
fldsep = " & "
endfld
field len = 5 to 10
alpha
totlen = 15 lpad = " "
fldsep = " & "
endfld
field len = 10
alpha
fldseed = "abcdefghijkl"
fldsep = "--"
endfld
field len = 10
alpha
fldseed = "abcdefghijkl"
endfld
Text
Examples:
field len = 20 to 50 text endfld
Constant Data
Examples:
field "abcd" endfld
field "ab\\cd\"ef" endfld
Random Constant Values
Example:
"abcdef"
"ghi"
"jklmnopqrstu"
endselect
endfld
Text Based on Defined "Alphabet"
Examples:
letters = "0123456789ABCDEF"
endfld
field len = 1 to 32
letters = "01"
endfld
field len = 1 to 32
letters = "01"
totlen = 50 lpad = "-"
endfld
field len = 20
endfld
field letters = "01"
len = 1 to 32
endfld
field letters = "01"
len = 1 to 32
totlen = 50 lpad = "-"
endfld
Numeric Fields
Sequence Number
Examples:
field sequence len = 4 endfld
Numeric Integer
field len = 3 to 8 numeric endfld
field avglen = 3 to 8 numeric endfld
field numeric len = 3 to 8 endfld
field numeric avglen = 3 to 8 endfld
Integer - Logarithmic Distribution
field integer bits = 3 to 8 endfld
Real Number
real
decimals = 5
presign
endfld
field len = 10
real
decimals = 5
postsign
endfld
field len = 10
real
decimals = 5
acctsign
endfld
field len = 1 to 10
real
decimals = 2
acctsign
endfld
field len = 10
real
decimals = 0
presign
endfld
len = 10
decimals = 5
presign
endfld
len = 1 to 10
decimals = 5
postsign
endfld
avglen = 1 to 10
decimals = 5
postsign
endfld
Amount
bits = 16
decimals = 2
presign
endfld
field amount
bits = 16 to 24
decimals = 2
postsign
endfld
field amount
bits = 16
decimals = 2
acctsign
endfld
Sine Wave
period = 100
decimals = 3
endfld
period = 100
magnitude = 2.0
axis = 1.0
decimals = 3
endfld
Numeric Ranges
Integer Range
Examples:
endfld
field intrange -100 to 100
len = 6
endfld
Average Integer Range
Examples:
endfld
field avgintrange -100 to 100
len = 6
endfld
Real Number Range (Floating Point Range)
Example:
Average Real Number Range
Example:
Date Fields
Full Date, Date, and Time
Examples:
field fulldate + 60 seconds endfld
field fulldate - 3600 seconds endfld
field date endfld
field date + 60 days endfld
field time endfld
field time + 3600 seconds endfld
Current date, time, and ticks
Examples:
field time endfld
field year endfld
field month endfld
field day endfld
field julianday endfld
field hour endfld
field minute endfld
field second endfld
field ticks endfld
Date Range
julian_day to julian_day
format = "text"
endfld
2400000.5 to 2612345.25
format = "%c"
endfld
Timed Output
Constant Pause
pause = 50
field len = 20 alpha endfld
Pause Range
pauserange 20 to 200
field len = 20 alpha endfld
Average Pause
avgpause 20 to 200
field len = 20 alpha endfld
Logarithmic Pause
pause bits = 8
field len = 20 alpha endfld
Datagen Syntax
Supporting Routines
FAQ
Copying