# Copybook and COMP date

**URL:** <https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [May 1, 2007, 12:34pm UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180 "2007-05-01T12:34:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amy](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@Amy](https://techcommunity.softwareag.com/u/Amy)\
**Post date:** [May 1, 2007, 12:34pm UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/1 "2007-05-01T12:34:58Z")

</div>

Hi,

I was asked to take a COMP(3) date (compressed for storage by the mainframe) from a record and write it out to the screen to see if it was the correct date. Each record has many fields–some of which are currently being ignored and skipped with #filler variables.

I tried adding in a new variable in the location following one of the existing variables (in the position where it exists in the record) with a Type P and a length 7. I then changed the old filler to length 3 (which used to be length 11). I saved the copybook and exited the library.

Then I did a write of the variable in the Natural program file. WRITE #TDW-DATE. When I did a STOW it said that the variable was not declared or was not indexed correctly (or something of the sort–I am trying to remember this error from earlier today and I am now at home).

I hope someone can help me!

Amy

---

<div class="post-metadata">

**Author:** ![thespin](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@thespin](https://techcommunity.softwareag.com/u/thespin)\
**Post date:** [May 8, 2007, 1:30am UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/2 "2007-05-08T01:30:21Z")

</div>

If P7 is seven bytes long, shouldn’t the 11 byte filler become 4 bytes after redefinition?

---

<div class="post-metadata">

**Author:** ![Jerome\_LeBlanc](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jerome_leblanc/32/111_2.png) [@Jerome\_LeBlanc](https://techcommunity.softwareag.com/u/Jerome_LeBlanc)\
**Post date:** [May 8, 2007, 3:29am UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/3 "2007-05-08T03:29:21Z")

</div>

If the fields were all alpha, then you would be correct. I suspect what Amy has is a P11 redefined into a P7 and P3, which is correct. P11 is 6 bytes long, and P7 is 4 bytes long leaving 2 bytes, which just fits a P3 field.

---

<div class="post-metadata">

**Author:** ![thespin](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@thespin](https://techcommunity.softwareag.com/u/thespin)\
**Post date:** [May 12, 2007, 2:09am UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/4 "2007-05-12T02:09:21Z")

</div>

Who makes ‘filler’ packed fields ?

---

<div class="post-metadata">

**Author:** ![Amy](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@Amy](https://techcommunity.softwareag.com/u/Amy)\
**Post date:** [May 12, 2007, 5:30am UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/5 "2007-05-12T05:30:49Z")

</div>

Thank you for the info. I haven’t had time to work with Natural since my last post. I am going to pull down an old COBOL book and look at variable declarations, since I believe that they are similar to Natural.

I don’t know much about any of this, since I am coming from a C/UNIX background (and I haven’t worked for 8.5 years!) I am sure that I can easily mess up the filler lengths.

Thank you for answering!

Amy

---

<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:41pm UTC](https://techcommunity.softwareag.com/t/copybook-and-comp-date/62180/6 "2021-04-02T14:41:10Z")

</div>


