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

Movement of COMP-3 variables


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 29, 2010 12:23 am
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
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

Moderator Emeritus


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

PostPosted: Wed Dec 29, 2010 12:50 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts JCL with variables JCL & VSAM 1
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts JCL Variables JCL & VSAM 1
Search our Forums:

Back to Top