ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

how to generate UUID

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to generate UUID

    Hi all

    any one can help me i want generate UUID that store into one physical file.

    Thanx in advance
    magesh

  • #2
    Re: how to generate UUID

    here some code

    PHP Code:

    just download 
    and call

         H Option
    ( *NoSrcStmt )  DftActGrp( *No )
          **
         
    D UUID_template   Ds
         D  UtBytPrv                     10u 0 Inz
    ( %SizeUUID_template ))
         
    D  UtBytAvl                     10u 0
         D                                8a   Inz
    ( *Allx'00' )
         
    D  UUID                         16a
         D  Reply                         1a
          
    **
         
    D GenUuid         PR                  ExtProc('_GENUUID')
         
    D  UUID_template                  *   Value
          
    **
         
    c                   do        25
         C                   Callp     GenUuid
    ( %AddrUUID_template ))
         
    c     UUID          dsply                   Reply
         c                   enddo
          
    **
         
    C                   Eval      *INLR = *on 
    Attached Files
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: how to generate UUID

      Thanx

      the value come like this

      ¢ \ µq ¥^e � ø
      �A µº ¥^e � ø
      ó"q µº ¥^e � ø
      �= µº ¥^e � ø

      but in JAVA it's come as numeric value.

      can u plz., help me

      Thanx in Advance
      magesh

      Comment


      • #4
        Re: how to generate UUID

        THere is no help needed that is how the UUID looks.
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: how to generate UUID

          thanx a lot

          Comment


          • #6
            Re: how to generate UUID

            Thanks for this GENUUID example... it works very well. I was looking at the GENUUID API definition and it isn't clear how the template in your example maps to the API specs. Could you explain that a little. I have not coded in ILE for years so most likely I have misunderstood something. In any case, it does the job.



            The UUID return template (operand 1) has the following format:
            Dec Hex Field Name Data Type and Length
            0 0 Return template size specification Char(8)
            0 0 Number of bytes provided UBin(4)
            4 4 Number of bytes available UBin(4)
            8 8 Reserved (binary 0) Char(8)
            16 10 Returned UUID Char(16)
            32 20
            --- End ---

            Thank You.


            Originally posted by jamief View Post
            here some code

            PHP Code:

            just download 
            and call

                 H Option
            ( *NoSrcStmt )  DftActGrp( *No )
                  **
                 
            D UUID_template   Ds
                 D  UtBytPrv                     10u 0 Inz
            ( %SizeUUID_template ))
                 
            D  UtBytAvl                     10u 0
                 D                                8a   Inz
            ( *Allx'00' )
                 
            D  UUID                         16a
                 D  Reply                         1a
                  
            **
                 
            D GenUuid         PR                  ExtProc('_GENUUID')
                 
            D  UUID_template                  *   Value
                  
            **
                 
            c                   do        25
                 C                   Callp     GenUuid
            ( %AddrUUID_template ))
                 
            c     UUID          dsply                   Reply
                 c                   enddo
                  
            **
                 
            C                   Eval      *INLR = *on 

            Comment

            Working...
            X