IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to display the signed value


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Wed Jul 13, 2005 10:20 am
Reply with quote

Hi,


I am trying to display the signed value with integer but it is not giving me right value.

I defined the variable as

01 WS-VAR2 PIC S9(4)V99

Suppose i m moving value 113.24 but it showing me value as 01132D .

Could anybody tell me how to display correct value.

Thanks in advance
Rupesh.Kothari.
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Wed Jul 13, 2005 11:08 am
Reply with quote

Quote:
01 WS-VAR2 PIC S9(4)V99

Make it as
Code:
01 WS-VAR2 PIC -9(4).99


Regards,
Vivek
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Wed Jul 13, 2005 2:16 pm
Reply with quote

Hi Vivek,

Thanks a lot for quick response..

I m getting 50% what i want. When i tried below code i m getting 113.24 result but it is not showing me the sign. Is there any way to show the sign also.

Thanks

Rupesh.
Back to top
View user's profile Send private message
nitinmahajan

New User


Joined: 13 Jul 2005
Posts: 1

PostPosted: Wed Jul 13, 2005 2:16 pm
Reply with quote

hi rupesh
ur declaration is correct just write there
Quote:
sign leading seperate

thats all


Rupesh.Kothari wrote:
Hi,


I am trying to display the signed value with integer but it is not giving me right value.

I defined the variable as

01 WS-VAR2 PIC S9(4)V99

Suppose i m moving value 113.24 but it showing me value as 01132D .

Could anybody tell me how to display correct value.

Thanks in advance
Rupesh.Kothari.
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Wed Jul 13, 2005 3:02 pm
Reply with quote

Hi,

Quote:
01 WS-VAR2 PIC -9(4).99
will display the negative sign only if the value is negative, If you want to display both positive and negative sign then use
Code:
01 WS-VAR2 PIC +9(4).99


Regards,
Vivek
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Wed Jul 13, 2005 6:05 pm
Reply with quote

HI,
thanks a lot for ur quick response.

It is working fine.

Thanks
Rupesh.Kothari
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to display the leading zeros of a... DB2 7
No new posts SDSF display Max-RC in different colors TSO/ISPF 4
No new posts Numeric check on packed signed and un... COBOL Programming 4
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Unable to display comp variable COBOL Programming 4
Search our Forums:

Back to Top