# Adding date fields to an existing PE

**URL:** <https://techcommunity.softwareag.com/t/adding-date-fields-to-an-existing-pe/197316>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes, Adabas-Basics-on-Mainframes\
**Created:** [December 1, 2017, 1:47am UTC](https://techcommunity.softwareag.com/t/adding-date-fields-to-an-existing-pe/197316 "2017-12-01T01:47:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Toronyi](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Paul\_Toronyi](https://techcommunity.softwareag.com/u/Paul_Toronyi)\
**Post date:** [December 1, 2017, 1:47am UTC](https://techcommunity.softwareag.com/t/adding-date-fields-to-an-existing-pe/197316/1 "2017-12-01T01:47:50Z")

</div>

I have done a decompress, compress & load to add alpha fields to a PE before but I don’t know how to do this for a date (Format D) field.  
Is there something special that needs to be inserted in the ADACMP Format card to add in the numeric bytes?

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [December 1, 2017, 11:31am UTC](https://techcommunity.softwareag.com/t/adding-date-fields-to-an-existing-pe/197316/2 "2017-12-01T11:31:08Z")

</div>

The field definition needs an additional keyword DT=E(xxx).

So for example a new date field named DD in a periodic group.

1,PG,PE  
2,DD,8,U,NU,DT=E(DATE)

The default field length is defined as 8, which is sufficient to store a date value of the form ‘YYYYMMDD’.  
The DT=E(DATE) tells Adabas to check a value to be inserted or updated that its parts are valid numbers e.g. for month MM are in the range of ‘01’ - ‘12’.

If you use the field with NATURAL you might want to use NATDATE which counts the number of days since year zero.  
The field definition then looks like:

2,DD,4,P,NU,DT=E(NATDATE)

This is described in detail here  
[http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada842mfr/util/flddefs.htm#fndef\_fld\_options\_DT](http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada842mfr/util/flddefs.htm#fndef_fld_options_DT)

---

<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:39pm UTC](https://techcommunity.softwareag.com/t/adding-date-fields-to-an-existing-pe/197316/3 "2021-04-02T15:39:44Z")

</div>


