# Value Range of \*TIMD(): more than 24 hours?

**URL:** <https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [July 12, 2015, 2:38pm UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773 "2015-07-12T14:38:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianHeld](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/christianheld/32/138_2.png) [@ChristianHeld](https://techcommunity.softwareag.com/u/ChristianHeld)\
**Post date:** [July 12, 2015, 2:38pm UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/1 "2015-07-12T14:38:59Z")

</div>

I’m with Natural for some decades, so to place my question is somewhat painful.

Working on IBM z/OS, I have to tune a Batch Programm.  
To get a baseline I determinted the Elpased time as usual:

```auto
at the begin
START. SETTIME

at the end 
TD_ := *TIMD (START.)

with TD_ defined as

      2 TD_ N 7 /*TIMD
   R 2 TD_ /* BEGIN REDEFINE: TD_
      3 TDHH_ N 2
      3 TDMM_ N 2
      3 TDSS_ N 2
      3 TDTS_ N 1
```

Inspecting the log I see: “Elapsed time: 19:11:39.2”

Checking the JES2 Job Log

Job Start: 13.52.46 JOB39601 ---- THURSDAY, 09 JUL 2015 ----  
Natural Step started 13.56.48  
Natural Step terminated  
09.08.28 JOB39601 ---- SATURDAY, 11 JUL 2015 ----

Based on this \*TIMD() embezzled 24 hours.

I checked all available documentation, but I was unable to find any Limitation for \*TIMD().

Is the a Maximum for \*TIMD()?

Any Feedback is welcomed.  
Christian

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [July 12, 2015, 7:15pm UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/2 "2015-07-12T19:15:06Z")

</div>

For durations greater than 24 hours I use Time variables and \*TIMX. For the calculations, see the TMDIFF code within my Code Sample: [url][http://techcommunity.softwareag.com/ecosystem/communities/public/adanat/products/natural/codesamples/5ddd08f1-de89-11e4-89cb-cd8d7ef22065/?title=Date+%26+Time+Calculations[/url]](http://techcommunity.softwareag.com/ecosystem/communities/public/adanat/products/natural/codesamples/5ddd08f1-de89-11e4-89cb-cd8d7ef22065/?title=Date+%26+Time+Calculations%5B/url%5D).

---

<div class="post-metadata">

**Author:** ![ChristianHeld](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/christianheld/32/138_2.png) [@ChristianHeld](https://techcommunity.softwareag.com/u/ChristianHeld)\
**Post date:** [July 13, 2015, 9:58am UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/3 "2015-07-13T09:58:52Z")

</div>

Hi Ralph.

Thx for the reply. I’m familiar with the coding you proposed.

My initial question is still open: Is there a 24 hour limitation in \*TIMD()?

As mentioned: I checked all available documentation starting with an antique Natural 2.2 Manual from 1993 up to the lastet documentation. I didn’t find any statement about a limitation.

Based on the structure of \*TIMD() [HHIISST] my assumption was that the maximum elapsed time could be 99:59:59.9

Any way, thx for your hint.  
Christian

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [July 13, 2015, 11:08am UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/4 "2015-07-13T11:08:20Z")

</div>

Neither have I seen anything that defines a maximum value for HH. The only clue is NAT1143 Input does not correspond to input edit mask. You get this if you try to convert an hour value greater than 24.

```auto
DEFINE DATA LOCAL
1 #T (T)
1 #A (A8) INIT <'25:13:14'>
END-DEFINE
MOVE EDITED #A TO #T (EM=HH:II:SS)
WRITE #T
END
```

\*TIMD must be a T-format value and the time portion of a T-format cannot exceed 24 hours.

---

<div class="post-metadata">

**Author:** ![ChristianHeld](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/christianheld/32/138_2.png) [@ChristianHeld](https://techcommunity.softwareag.com/u/ChristianHeld)\
**Post date:** [July 13, 2015, 12:25pm UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/5 "2015-07-13T12:25:32Z")

</div>

Hi Ralph.

This may be the reason. So my current understanding is: There is a 24 hour limitation deep inside the natural runtime system where \*TIMD() is evaluated.

For time being, I switch to \*TIMX() and calculate the elapsed time myself.

Thx, Christian

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:33pm UTC](https://techcommunity.softwareag.com/t/value-range-of-timd-more-than-24-hours/182773/6 "2021-04-02T15:33:47Z")

</div>


