Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Type N & I

Former Member
0 Likes
2,854

Q]] typically to store zip codes, account numbers...etc we use type N. Why do we not use type I ---any specific reason?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,704

Hi,

Normally for Zip codes and account numbers we use type 'N'.

for example if we have a variable with 20 characters for a account number and actual number is 12 characters only then if we use this variable as type 'N' all remaining 8 characters will be '0' are added first and 12 character number will followed by 8 zeros, but if we use as type 'I' it will store those 12 characters only.

Thanks & Regards,

Rajni MV.

7 REPLIES 7
Read only

rainer_hbenthal
Active Contributor
0 Likes
1,704

Histrorical reasons, N is used mostly for numbers where no callcualtion takes place. Its just a character field conatining only numbers. Cause of the lack of calculation no conversion into int, float or packed is needed.

Read only

Former Member
0 Likes
1,705

Hi,

Normally for Zip codes and account numbers we use type 'N'.

for example if we have a variable with 20 characters for a account number and actual number is 12 characters only then if we use this variable as type 'N' all remaining 8 characters will be '0' are added first and 12 character number will followed by 8 zeros, but if we use as type 'I' it will store those 12 characters only.

Thanks & Regards,

Rajni MV.

Read only

Former Member
0 Likes
1,704

Hi,

Type N is a character type which is specifically used to hold Numbers and are not calculation oriented in general. Thats why zip codes, account numbers are stored as type N on which calculations wont be done in general. Where as those defined as Type I is a numeric type and is used for calculations

Vikranth

Read only

Former Member
0 Likes
1,704

may be only because you can vary the length in type N

Read only

Former Member
0 Likes
1,704

This message was moderated.

Read only

Former Member
0 Likes
1,704

Hi,

To store the zip codes / account numbers say one of the value is '001011'

if the variable of type i is used it simply ignores the leading zeroes & takes the value as '1011'

hence u can use the variable of type N where calculations need not be performed.

Regards,

Deeba.

Read only

0 Likes
1,704

thank you -


even if I am late pls , do not worry , I will definitely respond