× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A sprinkle of Python and CL can help to gen what you need:

#!/QOpenSys/pkgs/bin/python3
import uuid
print(str(uuid.uuid4())

I'm sure something similar with PHP, Node or Java is also possible.

Simply output the new UUID to stdout for your app to consume.

Here's an example CL call of the script using the open source QSHEXEC CL command:
QSHONI/QSHEXEC CMDLINE('/ python/pygenuuid.py')

After execution the resulting UUID exists in outfile: QTEMP/STDOUTQSH as the only record. You can consume this from RPG or CL.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

----------------------------------------------------------------------

message: 1
date: Tue, 19 Apr 2022 15:21:41 +0100
from: issemDan <residentialsleeper@xxxxxxxxx>
subject: Re: Generating UUID in RPG

I see, so it seems there is no way to generate a type 4 on my current operating system as this was introduced in 7.3

If I called the type 1 uuid 4 times and then concatenated the first 8 random chars together perhaps that would give me a working 'random' uuid



On Tue, 19 Apr 2022 at 15:15, Charles Wilt <charles.wilt@xxxxxxxxx> wrote:

Working as designed...

The UUID returned is a type 1, not a type 4.

Charles

On Tue, Apr 19, 2022 at 8:08 AM issemDan
<residentialsleeper@xxxxxxxxx>
wrote:

Thanks, I'm getting a UUID now but after testing several times in a
row (calling via command line from fresh each time) I've noticed
only the
first
8 characters are random whilst the rest are the same for each call
and
not
randomized

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.