# Altering an Map's edit field ZP=ON or ZP=off

**URL:** <https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [November 16, 2009, 11:44pm UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123 "2009-11-16T23:44:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michele1](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michele1](https://techcommunity.softwareag.com/u/Michele1)\
**Post date:** [November 16, 2009, 11:44pm UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/1 "2009-11-16T23:44:55Z")

</div>

Is it possible to alter ZP=on or ZP=OFF from within a map’s processing rules?

I do not want to change the programs.  
I have 3 fields which are all defined by the database.

If all are zero, I want to display these 3 numeric fields as blanks.

If any of the 3 fields are zero, I want to display the zeroes.

The map field are  
FIELDA N(3) - DEFINED in MAP as ZP=on  
FIELDB N(2) - DEFINED in MAP as ZP=on  
FIELDC N(4) - DEFINED in MAP as ZP=on

I thought a processing rule on FIELDA , B and C each, such as shown below would work:

IF & = 0 AND FIELDB = 0 AND FIELDC= 0  
& ZP=OFF  
ELSE  
& ZP=ON  
END IF

Problem how do I access the & 's parameter ZP in the map from the processing rules and change it ? What is the syntax? Is it possible?  
:idea: :?:

---

<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:** [November 17, 2009, 3:04am UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/2 "2009-11-17T03:04:30Z")

</div>

Quick answer; it is not possible without a lot of effort.

First, processing rules are after the fact, not before a Map is displayed. There is a way to create what might be called a pre-processing rule (thanks andreas) for a map. It is rather involved, it uses a Layout to execute code before the Map is displayed. However, this can be done without changing the program. If interested, drop me an e-mail and i will send you an article on pre processing.

Back to the problem. Probably the easiest way to do this is to avoid numeric fields on the Map. You could have three fields such as fielda-alpha, fieldb-alpha and fieldc-alpha.

Before the Map is displayed you could employ your logic to decide whether you want to see blanks, a value, or a zero. Suppose a zero is required for fielda; you would MOVE ’ 0’ to fielda-alpha (or you could MOVE '0 ', depending on which you want).

If these fields are AD=M you could have a processing rule such as fielda = val (fielda-alpha). The problem with this approach is that the program will require changing.

Any other solution I can imagine (e.g. two sets of variables on the Map) would also require changing the program.

steve

---

<div class="post-metadata">

**Author:** ![Michele1](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michele1](https://techcommunity.softwareag.com/u/Michele1)\
**Post date:** [November 17, 2009, 3:15am UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/3 "2009-11-17T03:15:04Z")

</div>

Thank you Steve for answering my question on ZP = on and off allowable within a map. As it is not possible , I will probably change the programs, etc and display alpha fields. I have already done this, but I was wondering if there was an alternative way.

PLEASE SEND ME the article on pre-processing. I always love to learn new things. Thanks again. 😃

---

<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:** [November 17, 2009, 1:55pm UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/4 "2009-11-17T13:55:44Z")

</div>

> [@Michele](#):
>
> PLEASE SEND ME the article on pre-processing. I always love to learn new things.

Here’s a discussion on a related problem: [http://tech.forums.softwareag.com/viewtopic.php?t=7222](http://tech.forums.softwareag.com/viewtopic.php?t=7222)

---

<div class="post-metadata">

**Author:** ![Luk\_Segers](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@Luk\_Segers](https://techcommunity.softwareag.com/u/Luk_Segers)\
**Post date:** [November 23, 2009, 3:08pm UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/5 "2009-11-23T15:08:25Z")

</div>

Another solution is to use a control variable. A zero suppressed field is the same as a blank field and is also the same as a non displayed field.

So you can add a control variable to the field on the map and before the input statement in the program you can add the logic wether your field should be visible or not.

This solution needs less changing in the program (before input) and needs no processing in processing rules or program (after input). No need for additional alfa fields and data conversion statements. Less changes is less possible introduction of new errors.

This is a little program wich shows this:  
DEFINE DATA LOCAL  
1 #P (L)  
1 #N (N5)  
1 #C (C)  
END-DEFINE  
SET KEY PF3=‘%.’  
REPEAT  
IF #P  
#C := (AD=N)  
ELSE  
#C := (AD=D)  
END-IF  
INPUT (AD=OI) #P(AD=MULT) / #N (CV=#C)  
END-REPEAT

---

<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:57pm UTC](https://techcommunity.softwareag.com/t/altering-an-maps-edit-field-zp-on-or-zp-off/92123/6 "2021-04-02T14:57:45Z")

</div>


