My Oracle Support Banner

Messaging Server $?x? Mapping Operator Does Not Generate A Random Number (Doc ID 1575467.1)

Last updated on NOVEMBER 15, 2022

Applies to:

Oracle Communications Messaging Server - Version 7.0.4 and later
Information in this document applies to any platform.

Goal

Messaging Server 7u4-27.07(7.0.4.27.6) 64bit (built Jun 21 2013)

The $?x? mapping operator doesn't really generate a random number. At least it doesn't when running under imsimta test -mapping.

Consider the following mapping:

TEST
 * $E$?50?$Y

Running the following command 50 times:

imsimta test -mapping -mapping_file mappings -debug -table TEST ' '

Grepping, we get:

18:17:05.49: Percentage: 50.000000, random value generated: 99.418447
18:17:05.75: Percentage: 50.000000, random value generated: 99.418447
18:17:06.00: Percentage: 50.000000, random value generated: 99.419230
18:17:06.17: Percentage: 50.000000, random value generated: 99.419230
18:17:06.40: Percentage: 50.000000, random value generated: 99.419230
18:17:06.62: Percentage: 50.000000, random value generated: 99.419230
18:17:06.85: Percentage: 50.000000, random value generated: 99.419230
18:17:07.11: Percentage: 50.000000, random value generated: 99.420013

It looks like the "random" number is based on the current system time. Is that the case when the mapping is applied in a running MTA as well? If so, wouldn't it be better to use gettimeofday(), and use the tv_usec field? At least then, there would be a greater variance.
 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.