Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Reg:Moving of COMP-3 to a DISPLAY variable

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

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Dec 14, 2005 11:27 am    Post subject: Reg:Moving of COMP-3 to a DISPLAY variable
Reply with quote

Hi all,
When i move a COMP-3 variable S9(6) to a display variable S9(6).i don't get the sign moved from the COMP-3 variable to the display variable.
Why is it so?
Please provide suggestions for the same.
Thanks,
Muthuvel.
Back to top
View user's profile Send private message

jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Wed Dec 14, 2005 5:47 pm    Post subject:
Reply with quote

If the display variable you are moving the field to is zone signed that is pic s9(6) without the trailing statement, then the sign will be in the zone bits of the last byte.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Wed Dec 14, 2005 6:04 pm    Post subject: Re: Reg:Moving of COMP-3 to a DISPLAY variable
Reply with quote

Hi Muthuvel,


I have tested using MS-COBOL 85 and I found a peculiar result.

Quote:
01 a pic s9(6) comp-3 value 111111.
01 b pic s9(6) value 000000.

Inside procedure division,

Move a to b.
display b.


I am getting the result as 11111A.

Could someone explain this situation.
Back to top
View user's profile Send private message
jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Wed Dec 14, 2005 11:02 pm    Post subject:
Reply with quote

The "A" represents +1. The display does not seperate the sign from a zoned decimal field.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Dec 15, 2005 6:26 am    Post subject: Re: Reg:Moving of COMP-3 to a DISPLAY variable
Reply with quote

Hi jon_s_rice,

Thanks for your valuable information. Your reply really helped me a lot to avoid confusion about the zoned decimal field.
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 ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us