# How display integer bigger than 2.147.483.647

**URL:** <https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Natural-for-AJAX\
**Created:** [September 8, 2017, 4:07pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333 "2017-09-08T16:07:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ma\_We](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Ma\_We](https://techcommunity.softwareag.com/u/Ma_We)\
**Post date:** [September 8, 2017, 4:07pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/1 "2017-09-08T16:07:47Z")

</div>

Hello!  
In a grid-field, I have to display numbers bigger than 2.147.483.647. The value is stored in database as B4. When I redefine to I4 (integer 4) I can not display values bigger than from -2.147.483.647 to 2.147.483.647. How is it possible to change this integer typ to 0 to 4.294.967.295 (signed/unsigned)?

Thank you very much!  
Matthias

---

<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:** [September 8, 2017, 5:43pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/2 "2017-09-08T17:43:51Z")

</div>

Not possible, Natural does not have “unsigned” integer types.

You would have to circumvent this by calling an external routine and convert your B4 to  
a data type allowing for values exceeding those of a signed I4.

---

<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:** [September 8, 2017, 5:53pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/3 "2017-09-08T17:53:17Z")

</div>

Took me a couple of minutes to test this code.

```auto
DEFINE DATA LOCAL
1 #BIN (B4) INIT <H'FFFFFFFF'>
1 #PACKED (P11)
END-DEFINE
ASSIGN #PACKED = #BIN
IF #PACKED < 0
  THEN
    ASSIGN #PACKED = #PACKED + 4294967296
END-IF
DISPLAY #BIN #PACKED
END
```

```auto
Page 1 09082017 08:51:57
 
  #BIN #PACKED
-------- ------------
 
FFFFFFFF 4294967295
```

---

<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:** [September 8, 2017, 9:46pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/4 "2017-09-08T21:46:46Z")

</div>

That !

… I didn’t know, I have to admit.

To complete the picture:

```auto

DEFINE DATA LOCAL            
1 #B1 (B1) INIT <H'FF'>    
1 #B2 (B2) INIT <H'FFFF'>  
1 #B3 (B3) INIT <H'FFFFFF'>
1 #PACKED (P21)              
END-DEFINE                   
ASSIGN #PACKED = #B1         
WRITE #PACKED                
*                            
ASSIGN #PACKED = #B2         
WRITE #PACKED                
*                            
ASSIGN #PACKED = #B3         
WRITE #PACKED                
*                            
END                          
```

```auto
                255
           65535
    16777215
```

Doesn’t work for anything above B4, and B4 is a special case as it is treated as “signed” while B1 or B2 are not.

---

<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:** [September 9, 2017, 11:57am UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/5 "2017-09-09T11:57:15Z")

</div>

You said you wanted to display bigger numbers. There is a feature in Natural that is rarely used. The result of a numeric computation can be stored in an alpha field, as shown below:

DEFINE DATA LOCAL  
1 #BIN (B4) INIT \<H’FFFFFFFF’\>  
1 #PACKED (P11)  
1 #alpha (a20)  
END-DEFINE  
include aasetc  
ASSIGN #PACKED = #BIN  
IF #PACKED \< 0  
THEN  
ASSIGN #PACKED = #PACKED + 4294967296  
END-IF  
DISPLAY #BIN #PACKED  
compute #alpha = #packed + 1234567890  
write // ‘=’ #alpha  
END

Page 1 17-09-09 05:52:44

#BIN#PACKED

* * *

FFFFFFFF 4294967295

#ALPHA: 5529535185

---

<div class="post-metadata">

**Author:** ![Ma\_We](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Ma\_We](https://techcommunity.softwareag.com/u/Ma_We)\
**Post date:** [September 11, 2017, 1:51pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/6 "2017-09-11T13:51:09Z")

</div>

thank you so much for your helping hand! 😉  
I’ll try and answer

Matthias

---

<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:39pm UTC](https://techcommunity.softwareag.com/t/how-display-integer-bigger-than-2-147-483-647/196333/7 "2021-04-02T15:39:16Z")

</div>


