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

RESULT OF STATMENT Move a, b to c, d


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Wed Oct 10, 2007 10:57 am
Reply with quote

Could any one tell me the result of the following statment.

Move a, b to c, d
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Oct 10, 2007 11:41 am
Reply with quote

Try it ..it's faster.. why to wait some 'forum' to answer you.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Wed Oct 10, 2007 12:54 pm
Reply with quote

NAGARJUN CARALAPATI wrote:
Could any one tell me the result of the following statment.

Move a, b to c, d



a is moved to c and b is moved to d
This is incorrect.
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Wed Oct 10, 2007 1:15 pm
Reply with quote

Yes it is true as said by sri
This is incorrect.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Oct 10, 2007 3:05 pm
Reply with quote

sri_mf wrote:
a is moved to c and b is moved to d
Say what?
I'm from skeptical, show me the link......
Back to top
View user's profile Send private message
sdaundkar

New User


Joined: 11 Oct 2007
Posts: 1
Location: New York

PostPosted: Fri Oct 12, 2007 1:47 am
Reply with quote

I don't think that's correct syntax for a MOVE statement !!
Back to top
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Fri Oct 12, 2007 1:57 am
Reply with quote

I tried this out, the statement gave a compile error.
Code:

MOVE 'A'                   TO WS-A.       
MOVE 'B'                   TO WS-B.       
MOVE WS-A, WS-B            TO WS-C, WS-D.
DISPLAY 'WS-C' WS-C.                     
DISPLAY 'WS-D' WS-D.


The compile error i got is
Code:

The "MOVE" statement was invalid.  Expected "TO", but found "WS-B"
The statement was discarded.


Hope this helps.
Anitha
Back to top
View user's profile Send private message
inamadugu
Warnings : 1

New User


Joined: 23 Aug 2007
Posts: 18
Location: Delhi

PostPosted: Tue Oct 16, 2007 9:36 am
Reply with quote

Hi,

You cannot move two values at a time to another two values.

There should be one sending field and can be any receiving fields.

like:
MOVE WS-A TO WS-C,WS-D. (is possible)
where ws-a is the sending field and ws-c, ws-d are receiving fields

your code can only be written as below.

MOVE 'A' TO WS-A.
MOVE 'B' TO WS-B.

MOVE WS-A TO WS-C.
MOVE WS-B TO WS-D.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Tue Oct 16, 2007 10:10 am
Reply with quote

I have seen in some references but i have not tried it.

Thanks for correcting me..
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Oct 16, 2007 10:25 am
Reply with quote

Sri,

Quote:
I have seen in some references

Could you redirect us to the link or copy the code what you had seen.
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 first column truncated in search result IBM Tools 13
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts SDSF like solution in EJES (store com... All Other Mainframe Topics 4
No new posts executing XCTL command in COBOL witho... CICS 10
Search our Forums:

Back to Top