Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Vaibhav

New User

Joined: 01 Oct 2005
Posts: 3
Location: Pune

 Posted: Wed Feb 22, 2006 9:54 pm    Post subject: Movement of data ?? 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

priyesh.agrawal

Senior Member

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

 Posted: Wed Feb 22, 2006 10:02 pm    Post subject: Re: Movement of data ?? 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.
DavidatK

Active Member

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

Posted: Wed Feb 22, 2006 11:45 pm    Post subject: Re: Movement of data ??

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,
bonniem

New User

Joined: 09 Aug 2005
Posts: 67

 Posted: Thu Feb 23, 2006 10:47 am    Post subject: 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
bonniem

New User

Joined: 09 Aug 2005
Posts: 67

Posted: Thu Feb 23, 2006 10:48 am    Post subject:

 Code: move a to b1                b2                b3 [quote][/quote]
cevelavl

New User

Joined: 20 Feb 2006
Posts: 4

 Posted: Thu Feb 23, 2006 4:25 pm    Post subject: Re: Movement of data ?? 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am Get the list of data sets on DASD and... rakaitn JCL & VSAM 3 Thu Mar 08, 2018 12:38 pm Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us