Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace PL/I Compilers
Created by Guest
Created on May 10, 2016

Accuracy of SECS() and SECSTODATE()

As the conversion from SECS() and visa versa to SECSTODATE() in the enhanced microsecond timestamp string is not accurate because of the FLOAT Datatype, we would like to have it exactly.

Example:
DCL WERT BIN FLOAT(53);
WERT = SECS('2100-01-01-00.00.00.000031'
,'YYYY-MM-DD-HH.MI.SS.999999');

PUT SKIP LIST('SECS ? ? ?='!!TRIM(WERT));
PUT SKIP LIST('SECSX ? ? ='!!HEX(WERT));
PUT SKIP LIST('SECSTODATE='!!
SECSTODATE(WERT,'YYYY-MM-DD-HH.MI.SS.999999'));

Output:? ?
SECS ? ? ?=1.632182400000003E+10
SECSX ? ? =493CCDB450000020
SECSTODATE=2100-01-01-00.00.00.000030

>The Conversion lost one microsecond.

As we are already in conversation with Peter Elderon, we suggest following new Builtin Functions:
-MICROSECS() >Returns a FIXED BIN(63) value giving the number of microseconds corresponding to a date value and pattern.
-MICROSECSTODATE() >Converts a FIXED BIN(63) value holding a count of microseconds to a date pattern.
-MICROSECSTODAYS() >Converts a FIXED BIN(63) value holding a count of microseconds to a number of days.
-DAYSTOMICROSECS() >Converts a number of days to a FIXED BIN(63) number of microseconds.
-UTCMICROSECS() >Returns the current UTC date-time values as a FIXED BIN(63) number of microseconds.

Thank you, Patrick

Idea priority Low
  • Guest
    Reply
    |
    Aug 29, 2017

    this was delivered as part of 5.2 - REPATTERN now uses microsecs rather than secs as its intermediate value and thus avoids the problems of converting between decimal and float binary

  • Guest
    Reply
    |
    Jan 31, 2017

    As part of APAR PI75582 / PTF UI44364, these built-in functions are now supported

    This requires the appropriate PTFs for the library APARs PI66445 & PI67787

    MICROSECS

    MICROSECS returns a FIXED BIN(63) value that is the number of microseconds corresponding to the date d.
    Its syntax diagram etc is the same as that for the SECS built-in function except
    If d is omitted, it is assumed to the value returned by TIMESTAMP()
    If p is omitted, it is assumed to be the TIMESTAMP pattern, namely 'YYYY-MM-DD-HH.MI.SS.999999'

    MICROSECSTODATE

    MICROSECSTODATE returns a nonvarying character string containing the date in the date/time pattern specified by p that corresponds to m microseconds.

    Its syntax diagram etc is the same as that for SECSTODATE except

    m should be used for d
    m is converted to FIXED BIN(63) if necessary
    if p is omitted, it is assumed to be the TIMESTAMP pattern, namely 'YYYY-MM-DD-HH.MI.SS.999999'

    MICROSECSTODAYS

    MICROSECSTODAYS returns a FIXED BIN(31) value that represents the number of microseconds x converted to days, ignoring incomplete days.

    x must have a computational type and will be converted to FIXED BIN(63) if necessary.

    MICROSECSTODAYS(x) is the same as x/(24*60*60*1_000_000).

    DAYSTOMICROSECS

    DAYSTOMICROSECS returns a FIXED BIN(63) value that is the number of microseconds corresponding to the number of days x.

    x must have a computational type and will be converted to FIXED BIN(31) if necessary.

    DAYSTOMICROSECS(x) is the same as x*(24*60*60*1_000_000).

    UTCMICROSECS

    UTCMICROSECS returns a FIXED BIN(63) value that gives the current UTC time in microseconds.

    This built-in function has no arguments.

  • Guest
    Reply
    |
    Jun 5, 2016

    And, if you're going to implement them anyway, plain MICROSECS() would from a readability point of view better be named DATETOMICROSECS() / DATE2USECS()...

  • Guest
    Reply
    |
    Jun 5, 2016

    Can we please also have abbreviated forms of these functions,

    -MICROSECS() - USECS()
    -MICROSECSTODATE() - USECS2DATE()
    -MICROSECSTODAYS() - USECS2DAYS()
    -DAYSTOMICROSECS() - DAYS2USECS()
    -UTCMICROSECS() - UTCUSECS()

  • Guest
    Reply
    |
    May 11, 2016

    in retrospect, it would have been better if float had never been returned in the date time functions