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 How to delete large data. Mounika Nemani DB2 1 Wed Jun 13, 2018 1:58 pm Ways to share data between Cobol and ... Benchwarmer Java & MQSeries 3 Thu May 10, 2018 9:16 pm 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am How to list data set names with diffe... murali.andaluri CLIST & REXX 10 Thu Apr 12, 2018 11:33 pm Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am

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