I want to find the difference between two timestamps using COBOL

10,007

If you are working in an IBM mainframe environment with LE support, try looking up: CEESECS--Convert timestamp to seconds. Using this routine you can convert each of your timestamps to Lilian seconds, then subtract one from the other giving a result in seconds.

This same guide provides COBOL code to do exactly what you are looking for. About the only change you need to make in this example is to the format of the timestamp as follows:

MOVE "YYYYMMDDHHMISS99" TO Vstring-text of PICSTR.

You may convert the seconds count into the number of days, hours, minutes etc. using the CEESECI--Convert seconds to integers service. Again, specific COBOL examples are provided.

Share:
10,007

Related videos on Youtube

nelap
Author by

nelap

Updated on April 14, 2022

Comments

  • nelap
    nelap about 2 years

    I want to the find difference between two timestamps using COBOL. my timestamp is 16 bytes and here is the ex. of one timestamp: 2010060314314826 Please provide the sample code

  • Bill Woodger
    Bill Woodger over 10 years
    These functions deal with dates, not timestamps, as in the question.