PL/I

PL/I

PL/I

 View Only
  • 1.  Timestamp in PL/I

    Posted Mon September 03, 2012 02:39 AM
    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
    PeterOL


  • 2.  Re: Timestamp in PL/I

    Posted Tue September 04, 2012 06:05 PM
     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.
    ccw


  • 3.  Re: Timestamp in PL/I

    Posted Wed September 05, 2012 03:05 AM
     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


  • 4.  Re: Timestamp in PL/I

    Posted Thu December 13, 2012 07:14 PM
     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.
    Robin500


  • 5.  Re: Timestamp in PL/I

    Posted Wed September 05, 2012 08:06 AM
     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.
    PeterOL


  • 6.  Re: Timestamp in PL/I

    Posted Wed September 05, 2012 04:58 PM
    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.
    ccw