Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to display the signed value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Wed Jul 13, 2005 10:20 am    Post subject: How to display the signed value
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    Post subject:
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: 464

PostPosted: Wed Jul 13, 2005 2:16 pm    Post subject: Re: How to display the signed value
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    Post subject: Re: How to display the signed value
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    Post subject:
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: 464

PostPosted: Wed Jul 13, 2005 6:05 pm    Post subject: Re: How to display the signed value
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us