RndDate Function

Action

Adds a random number of days between 0 and nDays to a date. The random values generated are distributed uniformly.

Include file

Kernel.bdh

Syntax

RndDate( in nDate : number,
         in nDays : number ): number;

Return value

increased date

Parameter Description
nDate Input date with format YYYYMMDD
nDays Upper boundary of random interval for days to add

Example

dcltrans
  transaction TRndDate
  var
    nDate: number;
  begin
    // add 0 - 20 days to 19961015
    nDate := RndDate(19961015, 20);
    write("date = "); write(nDate); writeln;
  end TRndDate;

Output

date = 19961022