# Charset in Adabas

**URL:** <https://techcommunity.softwareag.com/t/charset-in-adabas/79184>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-Basics-on-Linux-Unix-Windows, Adabas-on-Windows-UNIX, Adabas-on-Linux\
**Created:** [October 4, 2008, 10:00am UTC](https://techcommunity.softwareag.com/t/charset-in-adabas/79184 "2008-10-04T10:00:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ray9](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Ray9](https://techcommunity.softwareag.com/u/Ray9)\
**Post date:** [October 4, 2008, 10:00am UTC](https://techcommunity.softwareag.com/t/charset-in-adabas/79184/1 "2008-10-04T10:00:34Z")

</div>

Dear All,

As I know there is Variable type U in Natural program to support Unicode8 or 16.

Do I need to set anything in Adabas like charset in Oracle?

The question sound stupid, but I am not familiar with Adabas

Thanks

Ray

---

<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:** [October 4, 2008, 1:45pm UTC](https://techcommunity.softwareag.com/t/charset-in-adabas/79184/2 "2008-10-04T13:45:26Z")

</div>

This maps to format “W” in the Adabas FDT (the field or “column” definition, to put it in SQL terms).

More information can be found here:

[url][http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada614unw/admin/dbuessup.htm[/url]](http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada614unw/admin/dbuessup.htm%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Marbod\_Mueller1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marbod_mueller1/32/97_2.png) [@Marbod\_Mueller1](https://techcommunity.softwareag.com/u/Marbod_Mueller1)\
**Post date:** [October 8, 2008, 2:24pm UTC](https://techcommunity.softwareag.com/t/charset-in-adabas/79184/3 "2008-10-08T14:24:54Z")

</div>

Hello,

Natural internally works with UTF-16 and Adabas Open Systems with UTF-8.  
On Adabas Mainframe, what the application sees depends on the user encoding defined with UWCODE (default UTF-16).

I suggest to always use the OPRB parameter to ensure that the application gets Unicode fields in the correct encoding.

```auto
OPRB:(DBID=1,WCHARSET='UTF-16LE',DBID=8,WCODE=4095)
```

The above example shows the essential parameters:

- access to open systems database 1, application characterset is UTF-16 little endian (e.g. for Intel386 box)

- access to mainframe database 8, application characterset is 4095 (= UTF-16), endianness of application determined by nucleus

When planning new applications with Unicode fields the following should be considered:

1. Adabas measures field length in bytes, Natural U fields in 2 bytes per character (e.g. WW,40,W = U20)

2. conversion between UTF-8 and UTF-16 encodings means differing length requirements and that data stored in UTF-8 might not fit in UTF-16 field and vice versa. Suggestion: define fields lengths bigger in database and make sure application does not exceed a certain limit.

Kind regards,  
Marbod Mueller

---

<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:50pm UTC](https://techcommunity.softwareag.com/t/charset-in-adabas/79184/4 "2021-04-02T14:50:59Z")

</div>


