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
 
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 RMM Cannot move a volume from SHELF l... tspr52 IBM Tools 0 Thu Mar 01, 2018 3:48 pm
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 CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

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