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
 

 

Query in MOVE statement in Cobol.

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

New User


Joined: 08 Jun 2005
Posts: 27

PostPosted: Tue Dec 11, 2007 11:01 am    Post subject: Query in MOVE statement in Cobol.
Reply with quote

Hi Guys,
Please calrify the following things.
1) When 'MOVE' takes place in COBOL, Is only value of sending data is considered to be moved to receiving filed?
or
Are both value as well as datatype considered for the MOVE?

Because MOVE '123' to 9(3)
MOVE 123 to X(3) are possible.

but MOVE 'ABC' to 9(3) is not possible.
Please explain bit more.

2) Is this MOVE 123(declared as comp) to X(3) possible?If no Why.

Regards,
Sona.
Back to top
View user's profile Send private message

sonasheetal

New User


Joined: 08 Jun 2005
Posts: 27

PostPosted: Tue Dec 11, 2007 11:46 am    Post subject:
Reply with quote

I undersatand the concepts of move. If you know the answer for my queries, reply with suitable answer else tell me which manual you are refeering.
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: Tue Dec 11, 2007 11:14 pm    Post subject:
Reply with quote

Hello,

If you click on "Manuals" at the top of the web page, documentation is available for multiple versions of mainframe COBOL. The first group of manuals is COBOL.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Tue Dec 11, 2007 11:25 pm    Post subject:
Reply with quote

You can certainly test each of your questions.
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Wed Dec 12, 2007 10:54 pm    Post subject:
Reply with quote

Ya.. Better way to learn is by testing.

The move depends on compiler also.
Most of the times, moves wont give you errors but addition or other manipulation will throw errors.

9(3) to x(3) move is permitted.
9(3) to comp variable move wont give error.
But adding 9(3) to a COMP variable will result in S0C7.

moves in general wont throw errors...
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Dec 12, 2007 11:59 pm    Post subject:
Reply with quote

lanand_hps wrote:
Ya.. Better way to learn is by testing.
But adding 9(3) to a COMP variable will result in S0C7.


TEST it with a 9(3) field containing valid numeric data!
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: Thu Dec 13, 2007 12:50 am    Post subject:
Reply with quote

Hello,

Quote:
But adding 9(3) to a COMP variable will result in S0C7.
No, it won't - unless the 9(3) field has invalid data.

As Craig suggests - test it with valid data. . .
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Tue Dec 18, 2007 9:18 pm    Post subject:
Reply with quote

As Craig suggests - test it with valid data. . .[/quote]

Get a 9(3) as input in the program using ACCEPT statement and test.
It will abend.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 18, 2007 9:44 pm    Post subject:
Reply with quote

lanand_hps wrote:
As Craig suggests - test it with valid data. . .


Get a 9(3) as input in the program using ACCEPT statement and test.
It will abend.[/quote]

Yes it will fail, if the 9(3) field contains nonnumeric data!
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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