• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Generating a Unique Identifier

    July 26, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I just read your article, “Using Timestamps as Unique Keys,” in the July 17 issue of Midrange Guru, OS/400 Edition.

    There might be a better way of creating a unique ID, one that doesn’t require retries. It’s the GENUUID API and/or MI built-in.

    Universal Unique Identifier (UUID) is supposed be a totally unique ID, even across all the machines in the entire world. I’m assuming that in reality this is 100 percent true, but I wouldn’t worry about it.

    Here’s some code that I’ve had stashed away:

    H option(*NoSrcStmt) DftActGrp(*No)                       
                                                                   
    D UUIDTemplate    ds                                          
    D   BytesProv                   10u 0 Inz(%Size(UUIDTemplate))
    D   BytesAvail                  10u 0                         
    D                                8a   Inz(*Allx'00')        
    D   UUID                        16a                           
                                                                  
    D GenUuid         pr                  ExtProc('_GENUUID')     
    D  Template                       *   Value                   
                                                                   
    C                   callp     GenUuid( %Addr(UUIDTemplate))   
    C                   eval      *inlr = *on                     
    C                   return                                    
    

    After the CALLP, UUID should contain a unique value.

    For more technical information about UUIDs, read the Internet Engineering Task Force (IETF) memo, “UUIDs and GUIDs“

    — Mark

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    SEQUEL meets all your iSeries and AS/400 data access needs in a single, integrated solution:

    • Windows, Web or host user interfaces

    • Convert AS/400 data into PC file formats

    • E-mail or FTP query results, reports and spool files
    • Run-time prompted queries and reports for end users

    • IF-THEN-ELSE logic in queries and reports

    • Report, form and label formatting second to none

    • Easily convert date fields, character-to-numeric, numeric-to-character and other data manipulation

    • SORT or JOIN using a calculated field

    • Quick summarization of data with Tabling function

    • Run multiple SEQUEL requests as one with the SEQUEL Scripting function

    • OLAP Business Intelligence at a fraction of the cost of comparable solutions

    Take 6 minutes to view a SEQUEL ViewPoint ScreenCam movie to see how simple Windows-based AS/400 and iSeries data access can be! In just a few short minutes, you can find out ways to make your job easier and improve data access throughout your organization. Download the ViewPoint movie here .

    For more information or a FREE trial of SEQUEL, call 847/605-1311 or visit Advanced Systems Concepts.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 56 -- July 26, 2002

    Sponsored by
    i-Rays

    i‑Rays learns how your IBM i behaves; not just how it performs. Detect deviations hours before incidents form and eliminate alert fatigue with true behavioral observability.

    Traditional monitoring tells you when something breaks. i‑Rays tells you why it’s about to break. By baselining behavioral patterns across jobs, subsystems, and queues, i‑Rays highlights the most likely root cause long before users feel the impact. It’s proactive, noise‑free, and built for mission‑critical IBM i environments.

    Request a Demo

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Did OPNQRYF Retrieve Records? Restore a Single IFS Directory

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 56

This Issue Sponsored By

    Table of Contents

    • Generating a Unique Identifier
    • Restore a Single IFS Directory
    • Sending Escape Messages from RPG

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • GenAI Is The Death Of Deterministic Project Budgeting
    • PTC Adds Support For VS Code With Implementer 12.7
    • Guru: Single Threading A Program Execution
    • As I See It: Push Back
    • IBM i PTF Guide, Volume 28, Number 21
    • Progress And Frustration With IBM i Security, Fortra Finds
    • In The Trenches With: JAMS Software
    • Guru: Where’s The Table?
    • Lightedge To Start Selling IBM PowerVS to IBM i Customers
    • IBM i PTF Guide, Volume 28, Number 20

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle