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

Movement of data ??


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

New User


Joined: 01 Oct 2005
Posts: 3
Location: Pune

PostPosted: Wed Feb 22, 2006 9:54 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Feb 22, 2006 10:02 pm
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Feb 22, 2006 11:45 pm
Reply with quote

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
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Thu Feb 23, 2006 10:47 am
Reply with quote

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
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Thu Feb 23, 2006 10:48 am
Reply with quote

Code:

move a to b1
               b2
               b3

[quote][/quote]
Back to top
View user's profile Send private message
cevelavl

New User


Joined: 20 Feb 2006
Posts: 4

PostPosted: Thu Feb 23, 2006 4:25 pm
Reply with quote

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
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top