• 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
    Midrange Dynamics North America

    Accelerate Change & Integration on IBM i

    Good change management unites IBM i and open systems development for productive collaboration. Developers work with their preferred tools and IDEs. Ultimate version control and traceability mean fast bug fixes and less stress. Rollback to a stable version in seconds.

    Change management gives managers, operations teams, and auditors the visibility they need, and developers can focus on what they like best: building great applications.

    Learn More

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Did OPNQRYF Retrieve Records? Retrieving Query Definitions

    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

    • To Comfort The Afflicted And Afflict The Comfortable
    • How FalconStor Is Reinventing Itself, And Why IBM Noticed
    • Guru: When Procedure Driven RPG Really Works
    • Vendors Fill In The Gaps With IBM’s New MFA Solution
    • IBM i PTF Guide, Volume 27, Number 27
    • With Power11, Power Systems “Go To Eleven”
    • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
    • Izzi Buys CNX, Eyes Valence Port To System Z
    • IBM i Shops “Attacking” Security Concerns, Study Shows
    • IBM i PTF Guide, Volume 27, Number 26

    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