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
 
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 How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts how to display APL characters? Pedro TSO/ISPF 6 Wed Mar 14, 2018 5:07 am
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

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