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
 

 

How to move from comp-3 to comp

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

New User


Joined: 23 Mar 2006
Posts: 13

PostPosted: Wed Sep 20, 2006 5:51 pm    Post subject: How to move from comp-3 to comp
Reply with quote

how to move pic s9(5) comp-3 to host variable pic s9(4) comp.[/b]
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Sep 21, 2006 1:36 am    Post subject: Re: move from comp-3 to comp
Reply with quote

arunswap

The COMP and COMP-3 indicate how the value is stored in memory. The compiler takes care of the conversion from one form to the other.

01 VAR1 PIC S9(5) COMP-3.
01 VAR2 PIC S9(4) COMP.

MOVE VAR1 To VAR2.

Your concern here should be the size of the fields. If the value in VAR1 is less than -32768 or greater than 32767 the result will be incorrect because of truncation and switching of the sign.

Dave
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Thu Sep 21, 2006 2:08 am    Post subject: move from comp-3 to comp
Reply with quote

i think it moves right four digits only.. no problem with sighn..

.. if you have 5 digit number then you miss the highest digit. i.e left side digit because right justified.
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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