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

MOVING COMP-3 into binary


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

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Tue Dec 01, 2015 5:02 pm
Reply with quote

Hi i have a field movement as below

Field-a S9(17) COMP-3 value zeroes.
Field-b s9(7) BINARY.

MOVE FIELD-A to FIELD-B

BUT i am not getting the values inside field-B instead i get a value +12345 moved into that...

can anyone help
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Tue Dec 01, 2015 6:38 pm
Reply with quote

The data in FIELD-A is being changed in between the definition and the MOVE.

It is a really bad idea to attempt truncation with a MOVE to a binary field. If you need the truncation, MOVE the PACKED-DECIMAL/COMP-3 field to one which is defined in the same way and only has seven digits.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2627
Location: NYC,USA

PostPosted: Tue Dec 01, 2015 10:20 pm
Reply with quote

You have not told us what is being passed and just saying what you get output won't help; Secondly, you need to search over to this forum to get similar links for the discussion which can help you by yourself like this
or this
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 add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
No new posts Unable to display comp variable COBOL Programming 4
No new posts Write 9(07) comp-3 data into output file DFSORT/ICETOOL 4
No new posts S9(11)V9(02) to S9(9)V9(2) COMP-3 SYNCSORT 2
No new posts Comp interview questions Mainframe Interview Questions 5
Search our Forums:

Back to Top