# Inserting Records with MU-Fields

**URL:** <https://techcommunity.softwareag.com/t/inserting-records-with-mu-fields/90511>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [June 23, 2009, 12:26am UTC](https://techcommunity.softwareag.com/t/inserting-records-with-mu-fields/90511 "2009-06-23T00:26:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steffel](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Steffel](https://techcommunity.softwareag.com/u/Steffel)\
**Post date:** [June 23, 2009, 12:26am UTC](https://techcommunity.softwareag.com/t/inserting-records-with-mu-fields/90511/1 "2009-06-23T00:26:33Z")

</div>

Is it possible to STORE a record with MU-Fields in a way that the occurence counter represents only the filled values?

The program

```auto
DEFINE DATA
LOCAL
1 E1 VIEW OF EMP
  2 NAME (A10)
  2 C*LANG
  2 LANG (A1/1:3)
END-DEFINE

READ ALL RECORDS IN E1
  DELETE
END-READ

E1.NAME := 'Alpha'
E1.LANG(1) := 'A'
STORE RECORD IN E1

E1.NAME := 'Beta'
E1.LANG(1) := 'B'
E1.LANG(2) := 'C'
STORE RECORD IN E1

READ ALL RECORDS IN E1
  WRITE NAME C*LANG
END-READ

END
```

results in

```auto
Alpha 3
Beta 3
```

which looks to me as if the occurence counter in the database is set to 3 for both records. I would like to see the ouput

```auto
Alpha 1
Beta 2
```

How can i achieve that? Thanks for any hint to a Natural-newbie.

---

<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:** [June 23, 2009, 1:11am UTC](https://techcommunity.softwareag.com/t/inserting-records-with-mu-fields/90511/2 "2009-06-23T01:11:48Z")

</div>

Take a look at the Data Definition Module (DDM). Either double-click the view name or enter the command:

```auto
l v EMP <-- this is the abbreviation for LIST VIEW EMP
```

What is the value in the Suppression column for field LANG? If the multiple occurring field (MU) is defined as null suppressed (N), then the count will reflect the number of non-null occurrences in the record. Any other specification will result in a count that matches your request, in this case, 3.

> [@](#):
>
> 2 LANG (A1/1:3)

If you change the Suppression value to N, this will apply only to new and updated records. The old inflated count will be returned by Adabas until the records are updated.

---

<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:** [June 23, 2009, 6:42pm UTC](https://techcommunity.softwareag.com/t/inserting-records-with-mu-fields/90511/3 "2009-06-23T18:42:39Z")

</div>

Ralph’s response above is probably the one you want to go with; especially since you indicated you are a “newbie” when it comes to Natural.

However, Adabas has capabilities that pertain to MUs that are not available in Natural. To employ these capabilities, you would use USR1043 (found in library SYSEXT).

SYSEXT contains “utilities” for Natural, written and maintained/enhanced by Software AG. USR1043 allows a Natural program to issue “direct calls” to Adabas. If you do not have anyone in your shop who is familiar with direct calls, you almost certainly do not want to try doing this yourself.

I have posted an Issue of Inside Natural as an attachment to my category of the forum called “Natural General - Inside Natural”. It describes how to manipulate MUs using USR1043. In particular it describes the “old form” for updating MU fields (not available in Natural itself, but available through USR1043) as opposed to the “new form” which is the mechanism available in Natural.

steve  
[In Vol 15 No 1.pdf](https://techcommunity.softwareag.com/uploads/short-url/5kk3XY62uxomFa0lTvUFVkkv8dY.pdf) (172 KB)

---

<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/inserting-records-with-mu-fields/90511/4 "2021-04-02T14:57:11Z")

</div>


