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
 
Moving comp-3 to signed numeric

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

New User


Joined: 02 Apr 2005
Posts: 3

PostPosted: Thu Sep 22, 2005 11:01 am    Post subject: Moving comp-3 to signed numeric
Reply with quote

Hello everyone,

When I try to move s9(2)v(3) comp-3 to s9(2)v(3) variable,
Iam not able to get the sign.

i,e If I move -5.000 stored in comp-3 variable to s9(2)v(3) variable , the result that is getting displayed is 05000.

Can anyone explain me why this is happening


Thanks in advance.
Kanishk
Back to top
View user's profile Send private message

nitin4.a

New User


Joined: 16 Aug 2005
Posts: 26

PostPosted: Thu Sep 22, 2005 11:11 am    Post subject: Re: Moving comp-3 to signed numeric
Reply with quote

HI


These are the specifications about comp-3 and comp variables,might be it will help you

Sign is stored in comp-3 as:-It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if
your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102
etc...
also it is a packed decimal format

S9(7) COMP-3 field occupy 4 bytes and . Sign is stored as hex value in the last nibble



S9(7) SIGN TRAILING SEPARATE will take 8 bytes (one extra for sign)


regards
sonu
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Tue Oct 04, 2005 11:43 pm    Post subject: Re: Moving comp-3 to signed numeric
Reply with quote

Hi,
Sign doesn't contribute to the size of the data name: s9(2)v9(3) usage display.For display purpose,edit characters can be used, -9(2)v9(3) usage display.Now your result must be -05000.
Regards,
Sridevi.
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 Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

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