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
 

 

Movement of data ??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Movement of data ??
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: 1452
Location: Chicago, IL

PostPosted: Wed Feb 22, 2006 10:02 pm    Post subject: Re: Movement of data ??
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    Post subject: Re: Movement of data ??
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    Post subject:
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    Post subject:
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    Post subject: Re: Movement of data ??
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    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
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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