View previous topic :: View next topic
|
Author |
Message |
paramita.barman
New User
Joined: 12 Oct 2006 Posts: 18
|
|
|
|
Hi,
I have got a 9(2).99 field. I need to add a $ sign for any value greater than 0, but no $ sign should come for any value equal to zero. For ex: 01.01 should become $01.01. But 00.00 shd remain 00.00.
How is it possible in Cobol?
Thanks in advance. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Code: |
01 WS-VARIABLES.
05 WS-WITH PIC $99.99.
05 WS-WITHOUT REDEFINES WS-WITH
PIC B99.99.
LINKAGE SECTION.
/
PROCEDURE DIVISION.
S1000-MAIN SECTION.
MOVE ZERO TO WS-WITHOUT.
DISPLAY WS-WITHOUT.
MOVE 1.01 TO WS-WITH.
DISPLAY WS-WITH. |
produces as output
|
|
Back to top |
|
|
paramita.barman
New User
Joined: 12 Oct 2006 Posts: 18
|
|
|
|
Thanks a lot [] |
|
Back to top |
|
|
|