# Format I, N and U

**URL:** <https://techcommunity.softwareag.com/t/format-i-n-and-u/102198>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [February 4, 2013, 7:52pm UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198 "2013-02-04T19:52:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [February 4, 2013, 7:52pm UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/1 "2013-02-04T19:52:21Z")

</div>

which the minimum and maximum size  
I1 that fits in? and an I2 and I4?

excuse the ignorance of the question, most do not understand it well.

N and U, where it is recommended to use one or the other?

N and U both have automatically saved the sign of positive and negative?

for decimal numbers, for example: 12.2 (123.44)  
I should use N14 or U14? calculation as the format / size?

I thank you. and apologize for your questions.

I’m Cobol programmer and in cobol to me seems more straightforward this.

---

<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:** [February 4, 2013, 9:46pm UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/2 "2013-02-04T21:46:52Z")

</div>

I format is COMP.  
I1 \<= 127  
I2 \<= 32767  
I4 \<= 2147483647  
For array indexes, always use I4.

N format is external decimal.  
For computations, use P format - COMP-3.

In Natural, U format is for Unicode characters. In Adabas, U is for unpacked decimal.

---

<div class="post-metadata">

**Author:** ![Nikolay\_Kuhta](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolay\_Kuhta](https://techcommunity.softwareag.com/u/Nikolay_Kuhta)\
**Post date:** [February 5, 2013, 3:04pm UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/3 "2013-02-05T15:04:25Z")

</div>

Well, Claudio, I don’t think you should apologies for your questions: asking for help is NOT shameful.  
Personally I’ve seen a lot of Natural code where N format is used for tax calculations - not the very efficient way to do it at all. By the way, all of those I1, I2, I4, P and N may be negative - just as in COBOL I assume; example: -128 \<= I1 \<= 127; -32768 \<= I2 \<= 32767 and so on.  
As for “…in cobol to me seems more straightforward this” I’d say “everything is relative, and only Sweden vodka is Absolut” 🙂

Best regards.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [February 6, 2013, 1:23am UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/4 "2013-02-06T01:23:42Z")

</div>

and for decimal places, a COBOL PIC S9(12)V2 COMP-3 would be (P12.2) in Natural.

---

<div class="post-metadata">

**Author:** ![Claudio\_Muller](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/claudio_muller/32/518_2.png) [@Claudio\_Muller](https://techcommunity.softwareag.com/u/Claudio_Muller)\
**Post date:** [February 6, 2013, 4:23pm UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/5 "2013-02-06T16:23:26Z")

</div>

thanks to all.

---

<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:** [February 8, 2013, 10:00am UTC](https://techcommunity.softwareag.com/t/format-i-n-and-u/102198/6 "2013-02-08T10:00:47Z")

</div>

Here’s a link to the regarding Documentation:

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6313win/pg/pg\_defi\_dv.htm#Format\_Length\_Def](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6313win/pg/pg_defi_dv.htm#Format_Length_Def)

---

<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/format-i-n-and-u/102198/7 "2021-04-02T15:02:48Z")

</div>


