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
 

 

Movement of COMP-3 variables

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

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Wed Dec 29, 2010 12:17 am    Post subject: Movement of COMP-3 variables
Reply with quote

When WS-VAR1 and WS-VAR2 are defined as below,

01 WS-VAR1 PIC S9(2)V9(3) COMP-3.
01 WS-VAR2 PIC S9(2)V9(3) COMP-3.

Is the below MOVE statment valid?

MOVE WS-VAR1 TO WS-VAR2.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Dec 29, 2010 12:23 am    Post subject:
Reply with quote

Yes -- moving a numeric variable to another numeric variable is valid. There is a link to manuals at the top of the page. Click on it, find the COBOL Language Reference manual, find section 6.2.24 on the MOVE statement and read every page of this section very closely. Not only will you gain the valuable benefit of being able to answer such questions yourself, but you also will learn more about COBOL than you know.
Back to top
View user's profile Send private message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Wed Dec 29, 2010 12:39 am    Post subject: Reply to: Movement of COMP-3 variables
Reply with quote

Thanks, I will definitely read the manual.

Can you help me answer one question please.

In the same scenario what will happen if WS-VAR2 is defines as below

01 WS-VAR2 PIC S9(2)V9(9) COMP-3.

Is the move valid?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 29, 2010 12:50 am    Post subject:
Reply with quote

Hello,

As Robert posted:
Quote:
Yes -- moving a numeric variable to another numeric variable is valid.


As i mentioned in your other post - try this and post the result and any doubt you may have about the result.

Also, as Robert mentioned, there is a link at the top of the page to "IBM Manuals". The first set is fro COBOL.
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
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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