Skip to main content

Problem:

The COBOL intrinsic function random generates after each program start the same sequence of numbers again - it is a pseudo-random number. How can a better random number be generated?

Resolution:

The WinApi UuidCreate computes a unique random number.

The probability to get the same number twice on different computers is very low, because UuidCreate uses the Ethernet or token-ring hardware address for this computer to be unique between different computers.

Please check, if the UUID computed with the attached demo resolves your requirements.

Attachments:

UUID.zip

Old KB# 1295