# changing the ZP value dynamically

**URL:** <https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [August 24, 2012, 1:16pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312 "2012-08-24T13:16:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JC1](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@JC1](https://techcommunity.softwareag.com/u/JC1)\
**Post date:** [August 24, 2012, 1:16pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/1 "2012-08-24T13:16:42Z")

</div>

hi there,  
i wonder if someone can help please.  
i’d like to know if it is possible to change the ZP (zero print) value on a MAP dynamically.  
i have a map with a numeric field on it and i have ZP=off for this field.  
this map is used to insert a new record and also to update an existing one.  
if i’m inserting a record, i’d like zp=off because i don’t want to display a screen with a zero on the numeric field since the record doesn’t exist yet.  
however, this field is not mandatory: the user may leave it as zero and proceed the writing of the record.  
now, if i’m updating an existing record whose numeric field was left 0 during its insertion, i’d like zp=on for i want the 0 displayed on the screen.  
thanks for any help.

---

<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:** [August 24, 2012, 1:30pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/2 "2012-08-24T13:30:43Z")

</div>

Not possible, I’m afraid, when you look at a map source you will see something like this

```auto
FORMAT PS=026 LS=132 ZP=OFF SG=OFF KD=OFF IP=OFF                        
* MAP2: MAP PROFILES *****************************410***********
* .TTAAAMMOO D I D I N D I D I ?_)^&:+( *
* 026131 N0NNUCN X 01 SYSPROF NL *
************************************************************************
INPUT ( IP=OFF /*
                                                                       )
 002T #ZPP (AD=MDLT ZP=ON ) /*.99U006 N06.0 .
```

So there is a FORMAT ZP= generated based on the map profile,  
plus ZP overrides based on field attributes, but none of them is  
dynamically modifiable.

So you’ll probably have to duplicate the map and trigger one or the other  
based on if it is a new record or not.

---

<div class="post-metadata">

**Author:** ![JC1](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@JC1](https://techcommunity.softwareag.com/u/JC1)\
**Post date:** [August 24, 2012, 1:41pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/3 "2012-08-24T13:41:10Z")

</div>

thank you a lot.

---

<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:** [August 24, 2012, 2:55pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/4 "2012-08-24T14:55:47Z")

</div>

In our shop, we never use numeric input fields on a map. Input is always through an alpha field so that the program can control the auditing and the message that is returned to the user. Using an alpha on your map will give you the flexibility that you are looking for.

---

<div class="post-metadata">

**Author:** ![Brian\_Johnson1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/brian_johnson1/32/163_2.png) [@Brian\_Johnson1](https://techcommunity.softwareag.com/u/Brian_Johnson1)\
**Post date:** [August 24, 2012, 3:11pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/5 "2012-08-24T15:11:39Z")

</div>

We have the same standard in our shop as Jerome mentioned. This extends also to fields that are date, time or logical as well as numerics. We believed end-users should see a more friendly message instead of NATxxxx messages. You just have to remember to assign your variables before the map and your database fields after (after passing REINPUT validation).

---

<div class="post-metadata">

**Author:** ![JC1](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@JC1](https://techcommunity.softwareag.com/u/JC1)\
**Post date:** [August 24, 2012, 9:16pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/6 "2012-08-24T21:16:11Z")

</div>

hey guys,  
it’s been a while since i last coded a natural application and i’m surprised how it is easy to forget things.  
as suggested, i used alpha fields and the ‘‘move edited’’ statement and things worked fine.  
thanks a lot for the tips!

---

<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 24, 2012, 9:32pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/7 "2012-08-24T21:32:52Z")

</div>

> [@](#):
>
> it’s been a while since i last coded a natural application

Usually I’ll code a combination of IS and VAL rather than a MOVE EDITED.

```auto
IF #ALPHA IS (N5.2)
 AND #ALPHA <> ' '
  THEN
    ASSIGN #NUM = VAL (#ALPHA)
END-IF
```

---

<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 27, 2012, 9:39am UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/8 "2012-08-27T09:39:03Z")

</div>

> [@Jerome LeBlanc](#):
>
> In our shop, we never use numeric input fields on a map. Input is always through an alpha field so that the program can control the auditing and the message that is returned to the user. Using an alpha on your map will give you the flexibility that you are looking for.

Right.

But I have to admit: A dynamic ZP would be very helpful - e.g. for output-protected-fields.

---

<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:02pm UTC](https://techcommunity.softwareag.com/t/changing-the-zp-value-dynamically/101312/9 "2021-04-02T15:02:21Z")

</div>


