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
 
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: 8214
Location: Dubuque, Iowa, 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 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
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

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