# edit mask control

**URL:** <https://techcommunity.softwareag.com/t/edit-mask-control/90741>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [July 21, 2009, 2:24pm UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741 "2009-07-21T14:24:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [July 21, 2009, 2:24pm UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/1 "2009-07-21T14:24:43Z")

</div>

Hey,

Is there a wat using a map once as output and once as input, and a numeric filed in the output wil get edit mask (zzz,zzz) and in input map no separators will be checked?

Hezi

---

<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:** [July 21, 2009, 5:05pm UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/2 "2009-07-21T17:05:45Z")

</div>

AFAIK: No!  
If you define an Edit Mask with thousand separator on the map, the user has to write it - otherwise a NAT1143 occurs.

Workaround: The field on the mask is alphanumeric. In the program you convert it into a numeric.

---

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [July 21, 2009, 6:45pm UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/3 "2009-07-21T18:45:35Z")

</div>

hi again,

1. how to convert an ascii with separator to a numeric?
2. Is there a way to let the ascii variable in input mode to be right to left?

---

<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:** [July 22, 2009, 3:42am UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/4 "2009-07-22T03:42:30Z")

</div>

> [@Hezi](#):
>
> hi again,
> 
> 1. how to convert an ascii with separator to a numeric?
> 2. Is there a way to let the ascii variable in input mode to be right to left?

How would you get ASCII input into a map ???

For a description of RTL-support in Natural you may want to start here:  
[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/parms/pm.htm](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/parms/pm.htm)

---

<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:** [July 22, 2009, 4:09am UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/5 "2009-07-22T04:09:38Z")

</div>

I believe that Matthias was referring to the VAL function, but you’ll have to remove the commas.

```auto
DEFINE DATA LOCAL                    
1 #C (A20) INIT <'-1,234,567,890.12'>
1 #T (A20)                           
1 #N (N10.2)                         
END-DEFINE                           
ASSIGN #T = #C                       
EXAMINE #T FOR ',' DELETE            
ASSIGN #N = VAL (#T)                 
DISPLAY #C #T #N                     
END
```

And the output:

```auto
Page 1 07/21/09 15:50:31
                                                                               
         #C #T #N                             
-------------------- -------------------- --------------                       
                                                                               
-1,234,567,890.12 -1234567890.12 -1234567890.12                       
```

---

<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:** [July 22, 2009, 11:49am UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/6 "2009-07-22T11:49:10Z")

</div>

A few minutes ago, I read in the natural-mainframe-documentation for INPUT. There is a way using EMFM (Edit Mask Free Mode).

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/sm/input.htm#Entering\_Data\_in\_Response\_to\_an\_INPUT\_Statement](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/sm/input.htm#Entering_Data_in_Response_to_an_INPUT_Statement)

---

<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:** [July 23, 2009, 1:45am UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/7 "2009-07-23T01:45:19Z")

</div>

Even EMFM has its limitations and “gotchas”. For example, if you have different editing for output purposes e.g. thousands delimiters and a dollar sign and some text, then the user must either do all or nothing; one of the three (e.g. just the thousands delimiter, will get you in trouble.

As Matthias indicated earlier, put an alpha field on the Map. In your program, take a numeric field and used MOVE EDITED to create the alpha field for the Map. Reverse the procedure for data entered by the user. This gives you more flexibility in terms of what the user is allowed to do, and you can create very specific error messages if the user has not provided valid input.

steve

---

<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:** [July 23, 2009, 2:31am UTC](https://techcommunity.softwareag.com/t/edit-mask-control/90741/8 "2009-07-23T02:31:43Z")

</div>

Here is one more “gotcha” from EMFM.

A slight variation on the example in the documentation:

SET CONTROL ‘FM+’ /\* activate numeric Edit Mask Free Mode  
RESET N (N7.3)  
move 2 to N  
INPUT N (AD=M EM=Z’,‘ZZZ’,'ZZZ.999EUR)  
END

When you see the screen it will show:

N 2.000EUR

put the cursor to the right of the 2 and hit left arrow and 2 (leaving the screen the same). This will work.

Now do the same except type a 3 rather than a 2. You will get an error message 1143 which says input does not correspond to edit mask. Rather confusing for some poor enduser.

steve

---

<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/edit-mask-control/90741/9 "2021-04-02T14:57:16Z")

</div>


