• 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
    ARCAD Software

    Unlock Application Knowledge with DISCOVER: From Code to Data Lineage

    In today’s fast-paced IT landscape, organizations face a critical challenge: understanding the complexity of their existing applications while preparing for modernization. DISCOVER addresses this challenge by providing a powerful, AI-assisted knowledge base that makes application intelligence accessible to everyone.

    Join Alan Ashley, Solution Architect at ARCAD Software, as he demonstrates how DISCOVER empowers teams to:

    • Visualize and explore application metadata, code, and dependencies
    • Gain clear insights into data lineage to maximize the value of enterprise data
    • Document and explain applications in natural language
    • Boost productivity and autonomy across technical and business users

    Whether you are modernizing legacy systems, leveraging data for new business initiatives, or simply striving to recover lost application knowledge, DISCOVER is your key to bridging the gap between code and actionable intelligence.

    Register Now!

    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

    • And Then There Were Two: Big Blue Withdraws IBM i 7.4
    • Crossroads RMC Shows Off New AI Dashboard at inPOWER 2025
    • Guru: When Attention Turns To You – Writing Your Own ATTN Program
    • Rocket Taps IDC To Assess The Benefits Of Full Scope IT Modernization
    • IBM i PTF Guide, Volume 27, Number 38
    • Positive News From The Kyndryl Mainframe Modernization Report
    • NAViGATE, inPower 2025 On Tap for September 2025
    • Guru: WCA4i And Granite – Because You’ve Got Bigger Things To Build
    • As I See It: Digital Coup
    • IBM i PTF Guide, Volume 27, Number 37

    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