# Find T format discriptor

**URL:** <https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-Database-and-TP-Monitor-Interfaces-on-Mainframes\
**Created:** [August 25, 2008, 1:21pm UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846 "2008-08-25T13:21:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazi1](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@Kazi1](https://techcommunity.softwareag.com/u/Kazi1)\
**Post date:** [August 25, 2008, 1:21pm UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/1 "2008-08-25T13:21:51Z")

</div>

I have a discriptor with T format, I want to Find or Read all records with given date. How can I convert date to T format to find all records on that specific date?

Regards,

ASLAM

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [August 25, 2008, 3:15pm UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/2 "2008-08-25T15:15:28Z")

</div>

Here is a program which demonstrates one way to do this:

DEFINE DATA LOCAL  
1 #DATE (A8) INIT \<‘02142000’\>  
1 #TIME (T)  
END-DEFINE  
\*  
MOVE EDITED #DATE TO #TIME (EM=MMDDYYYY)  
WRITE #TIME (EM=MMDDYYYY**HH)  
ADD 50000 TO #TIME  
WRITE #TIME (EM=MMDDYYYY**HH)  
END

In other words, do a MOVE EDITED of your alpha date (I am assuming an alpha date such as MMDDYYYY) to a Time variable.

The Time variable will then be the start of the specified date.

You could then do a READ by the Time variable starting from #TIME.

For every returned Time, use a MOVE EDITED to create the date (in a BEFORE BREAK clause) then do an AT BREAK of the date variable.

Alternatively, compute the number of tenths of seconds (unit for Time) for a day, and have something like IF #DATE2 - #DATE1 GT #NUMBER OF TENTHS.

steve

---

<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:** [August 25, 2008, 11:36pm UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/3 "2008-08-25T23:36:07Z")

</div>

If you are specifying the time manually in an ad hoc program or via an INPUT statement, rather than converting an alpha value from some external source, then you can use time literals, which are much easier than computing tenths of seconds.

Here’s a sample program which shows how to use a system variable (\*TIMX) or an extended-time literal (E format) to initialize a time variable (T format).

[code]  
DEFINE DATA LOCAL  
1 #T (T) INIT /\* NB the leading asterisk was removed by the Forum  
END-DEFINE  
ASSIGN #T = E’08/25/2008 14:35:50’  
REPEAT  
INPUT ‘Time:’ #T (EM=MM/DD/YYYY

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [August 26, 2008, 11:35am UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/4 "2008-08-26T11:35:05Z")

</div>

My example: Read/Find all records created on 2008-08-25

```auto
define data local
1 file1 view of SOME-DDM
2 creation-time (EM=YYYY-MM-DD^HH:II:SS.T)
*
1 #date (D) init <D'2008-08-25'>
1 #date2 (D)
end-define
*
#date2 := #date + 1
*
read file1 by timestamp starting from #date ending at #date
  display file1
end-read
*
skip 1
*
find file1 with timestamp = #date thru #date2 but not #date2
  display file1
end-find
end
```

---

<div class="post-metadata">

**Author:** ![Kazi1](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@Kazi1](https://techcommunity.softwareag.com/u/Kazi1)\
**Post date:** [August 26, 2008, 11:54am UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/5 "2008-08-26T11:54:50Z")

</div>

Thanks Steve, it worked… 😃

Thanks to Ralph and Matthias also.

KAZI

---

<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, 2:50pm UTC](https://techcommunity.softwareag.com/t/find-t-format-discriptor/78846/6 "2021-04-02T14:50:48Z")

</div>

Closed on April 2, 2021, 2:50pm UTC


