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

Need help in declaring the data type

Former Member
0 Likes
496

Hi ,

Am facing some problem in declaring the data type.

Presently,,Im printing a variable of int2.

If I pass the value of 5 digits it is working fine,,but when a value more than 5 digits is passed to that variable, it's causing dump.

So, I tried to declare the variable as C, then it is printing the value as 4.9E+04.

when declared as N, it's printing '0'.

when declaared as I, it's printing the value ' 48,820'.

My Req is I dont want the space before the value and there should nt be "," .

Of course this can be acheived by manipulating the number, But Iwant this to happen as it was happening with INT2.

Current req: need a data type which can hold a value of morethan 5 digits, without commas and no space in front.

Pls suggest.

Rgs,

Priya

3 REPLIES 3
Read only

Former Member
0 Likes
467

Hi,

Declare type PACKED number. (TYPE P)

You can also give the decimal places(if needed) to the declaration

Hope this helps

Regards

Shiva

Read only

0 Likes
467

Hi Shiva,

Thanks for ur reply..

Packed has same effect as I.

I want the output without Commas and space in front of the value.

Read only

Former Member
0 Likes
467

Hi Priya,

You can use variable of data type INT4, which is of length 10. Later you can move this to a CHAR field & use replace command as follows.

Data: v_int type int2,

v_char(20) type C.

Write: v_int to v_char.

SHIFT v_char LEFT DELETING LEADING space.

REPLACE ALL OCCURRENCES OF '.' IN v_char WITH space.

REPLACE ALL OCCURRENCES OF ',' IN v_char WITH space.

CONDENSE v_char.

Regards,

Adarsh.