Topic
  • 5 replies
  • Latest Post - ‏2012-12-14T00:14:16Z by Robin500
PeterOL
PeterOL
9 Posts

Pinned topic Timestamp in PL/I

‏2012-09-03T06:39:01Z |
In z/OS PL/I version 4.1 the function in PL/1 is "time" and it only delivers  YYMMSS999 so ot is not a full timestamp. Does anyone know how to get the full timestamp? Regards Peter
Updated on 2012-12-14T00:14:16Z at 2012-12-14T00:14:16Z by Robin500
  • ccw
    ccw
    7 Posts

    Re: Timestamp in PL/I

    ‏2012-09-04T22:04:46Z  
     you can use the datetime() function,  it returns YYYYMMDDHHMISS999,
    if you are still working on the GUID issue in a different thread, note that this form is not rfc compliant.
  • PeterOL
    PeterOL
    9 Posts

    Re: Timestamp in PL/I

    ‏2012-09-05T07:04:54Z  
    • ccw
    • ‏2012-09-04T22:04:46Z
     you can use the datetime() function,  it returns YYYYMMDDHHMISS999,
    if you are still working on the GUID issue in a different thread, note that this form is not rfc compliant.
     Hi ccw
     
    I know but as I wrote it is not a full timestamp. 
    Instead I found a litte routine one of ours system guys wrote.
    I will see if that works well otherwise I will use the DB2 timestamp until a better solution come up.
    Strange that this is difficult in PL/1, Adv.Gen has a function to get a timestamp.....   
  • PeterOL
    PeterOL
    9 Posts

    Re: Timestamp in PL/I

    ‏2012-09-05T12:05:47Z  
    • ccw
    • ‏2012-09-04T22:04:46Z
     you can use the datetime() function,  it returns YYYYMMDDHHMISS999,
    if you are still working on the GUID issue in a different thread, note that this form is not rfc compliant.
     seems to work, now someone else will do a test for their use:

    Result:

    UUID ...........: 3434f5dc-1925-42d0-839d-04b60a9ef4ec

    Timestamp ......: 2012-09-05-13.28.23.213839

    ReturnCode .....: 1

    Code was written in RDz 8.5 for PL/1 - nice.
  • ccw
    ccw
    7 Posts

    Re: Timestamp in PL/I

    ‏2012-09-05T20:58:10Z  
    • PeterOL
    • ‏2012-09-05T12:05:47Z
     seems to work, now someone else will do a test for their use:

    Result:

    UUID ...........: 3434f5dc-1925-42d0-839d-04b60a9ef4ec

    Timestamp ......: 2012-09-05-13.28.23.213839

    ReturnCode .....: 1

    Code was written in RDz 8.5 for PL/1 - nice.
    According to your version field, you are using version 4 of GUID,
    According to rfc 4122.
     
       The algorithm is as follows:

       o  Set the two most significant bits (bits 6 and 7) of the
          clock_seq_hi_and_reserved to zero and one, respectively.

       o  Set the four most significant bits (bits 12 through 15) of the
          time_hi_and_version field to the 4-bit version number from
          Section 4.1.3.

       o  Set all the other bits to randomly (or pseudo-randomly) chosen
          values.
     
    This version of GUID does not need to source from timestamp.Timestamp probably isn't good enough if the system is fast. You probably also want jobname, job number, timestamp hashed with some cryptographic function. to generate the final result.
  • Robin500
    Robin500
    8 Posts

    Re: Timestamp in PL/I

    ‏2012-12-14T00:14:16Z  
    • PeterOL
    • ‏2012-09-05T07:04:54Z
     Hi ccw
     
    I know but as I wrote it is not a full timestamp. 
    Instead I found a litte routine one of ours system guys wrote.
    I will see if that works well otherwise I will use the DB2 timestamp until a better solution come up.
    Strange that this is difficult in PL/1, Adv.Gen has a function to get a timestamp.....   
     What do you mean by a "full timestamp"?
     
    Without an argument, PL/I's DATETIME gives the date and the time.
     
    With an argument, it gives the date in various formats.