View previous topic :: View next topic
|
Author |
Message |
lekshmi_ci
New User
Joined: 14 Mar 2007 Posts: 60 Location: Thiruvananthapuram
|
|
|
|
Hi,
My working storage contains a variable ws-aaa pic 9(09).
The value coming is 000000412. i would like to supress the zeroes and make it 412.
I have declared Z9(09). Will this work?
Please reply
LC |
|
Back to top |
|
|
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
hi plse try with
Z(8)9 so that u can have zero when data is 000000000
or if u dont need zero in upper case use
z(9)
sandeep |
|
Back to top |
|
|
lekshmi_ci
New User
Joined: 14 Mar 2007 Posts: 60 Location: Thiruvananthapuram
|
|
|
|
I declared zzzzzzzz9. It worked. But is this the only way. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
For your original example of 000000412 to 412, Z(6)999, Z(7)99, Z(8)9 & Z(9) will work. Which one you use depends on what you want to see when the field contains only zero: 000, 00, 0 or just spaces..... |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Yes, this is the best way.
There are other ways to display sign of amount (+/-), or $ sign or * sign etc. But only for zero suppression, this one is best.
--Parag |
|
Back to top |
|
|
nagasri83
New User
Joined: 20 May 2005 Posts: 15 Location: chennai
|
|
|
|
Quote: |
My working storage contains a variable ws-aaa pic 9(09).
The value coming is 000000412. i would like to supress the zeroes and make it 412.
I have declared Z9(09). Will this work?
Please reply
|
From the above coding, you will not get the expected result. You have declared as Z9(09) which means Z999999999. So only 0 in the 10th place will get suppressed.
Declaration can be done depending on the requirement. To get the expected result in your example, following way of declation will do
Z(06)9(03) or Z(06)999 --> ZZZZZZ999
Z(07)9(02) or Z(07)99 --> ZZZZZZZ99
Z(08)9(01) or Z(08)9 --> ZZZZZZZZ9
Z(09) --> ZZZZZZZZZ
Hope you understood the concept. |
|
Back to top |
|
|
ram prasad
New User
Joined: 28 May 2007 Posts: 17 Location: india
|
|
|
|
use Z(8)9 it gives perfect result, when 000000000 it gives 0 only |
|
Back to top |
|
|
|