View previous topic :: View next topic
|
Author |
Message |
Vaibhav
New User
Joined: 01 Oct 2005 Posts: 3 Location: Pune
|
|
|
|
Hi,
What does this statement means.
Move Xyz-var1(w0-sub) to xyz-var2
xyz-var3 (w0-sub).
where XYZ-var1/2/3 and w0-sub all are variables.
This code is written in Cobol.
Regards.
Vaibhav |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Vaibhav,
It doesn't seem a valid MOVE statement. You should get an error at compile itself.
Pls describe the structure of these variables.
Regards,
Priyesh. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Vaibhav,
In your program, you should find some code like:
Code: |
05 XYZ-VAR1 PIC S9(9) OCCURS 10 TIMES.
05 XYZ-VAR2 PIC S9(9).
05 XYZ-VAR3 PIC S9(9) OCCURS 10 TIMES.
05 WO-SUB PIC s9(2).
MOVE 2 TO WO-SUB.
MOVE XYZ-VAR1(WO-SUB) TO XYZ_VAR2
XYZ-VAR3(WO-SUB).
|
In the case above, variables XYZ-VAR1 and XYZ-VAR3 are defined as COBOL tables with 10 occurrences of the variable.
The move above will move the value in the 2nd occurrence of XYZ-VAR1 to the variable XYZ-VAR2, and to the 2nd occurrence of variable XYZ-VAR3.
The move above is equivalent to:
Code: |
MOVE XYZ-VAR1(2) TO XYZ-VAR2.
MOVE XYZ-VAR1(2) TO XYZ-VAR3(2).
|
Dave, |
|
Back to top |
|
|
bonniem
New User
Joined: 09 Aug 2005 Posts: 67
|
|
|
|
The code is valid, the value in one source variable is getting moved to multiple destination variables.
move a to b1
b2
b3
This will move value in a to b1, b2, b3.
Similiarly you can code statements like
initialize a
b
c |
|
Back to top |
|
|
bonniem
New User
Joined: 09 Aug 2005 Posts: 67
|
|
|
|
Code: |
move a to b1
b2
b3
[quote][/quote] |
|
|
Back to top |
|
|
cevelavl
New User
Joined: 20 Feb 2006 Posts: 4
|
|
|
|
hi,
this statement means that
the element of table "xyz-var1" with position "w0-sub" in it
will be moved to 2 variables.
First to separate variable "xyz-var2"
and second to the element of table "xyz-var3" with position "w0-sub" in it.
For other is nesessary to know
what is the data-structure like. |
|
Back to top |
|
|
|