‎2010 Aug 16 11:23 AM
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
‎2010 Aug 16 11:27 AM
Hi,
Declare type PACKED number. (TYPE P)
You can also give the decimal places(if needed) to the declaration
Hope this helps
Regards
Shiva
‎2010 Aug 16 11:32 AM
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.
‎2010 Aug 16 11:37 AM
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.