View previous topic :: View next topic
|
Author |
Message |
rukkunudeen
New User
Joined: 16 Sep 2008 Posts: 4 Location: chennai
|
|
|
|
moving one array value to an another array value[both has the same name]
problem is : the array is ambigious[ the copybooks i use use the same name for the array] |
|
Back to top |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
Please provide some more details as your requirement doesnt look very clear. If you can put these arrays under different 01 group level variables thn by using "of" clause u might be able to resolve this problem.
Cris |
|
Back to top |
|
|
rukkunudeen
New User
Joined: 16 Sep 2008 Posts: 4 Location: chennai
|
|
|
|
i have two copy books
copy sfm0030
copy sfm0040
both uses same array called s123
01 s123 occurs 8 times indexed by wsub.
05 jobnm
05 date
05 time
01 s123 occurs 8 times indexed by wsub1.
05 jobnm
05 date
05 time
i want to move jobnm of 30 to jobnm of 40
MOVE JOBNM(WSUB) OF SFM0030 TO JOBNM(WSUB1) OF SFM0040. IS NOT WORKING!!!!!!!! |
|
Back to top |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
rukkunudeen,
Are u sure that "01 s123 occurs 8 times indexed by wsub" was compiled without any error. As we cannot have occurs clause at 01 level variable.
Once this gets clear you can try:
MOVE JOBNM(WSUB) OF S123 OF SFM0030 TO JOBNM(WSUB1) OF S123 OF SFM0040
Cris |
|
Back to top |
|
|
Krishna Velamur
New User
Joined: 22 Aug 2008 Posts: 22 Location: Hyderabad
|
|
|
|
Hi,
Try Move JOBNM OF SFM0030(WSUB) TO JOBNM OF SFM0040(WSUB1). Just a guess. Iam not sure about this.
Or else, Redefine the copybooks and use your working storage array structure. See below.
copy sfm0030
01 W-SFM0030-RED redefines W-SFM0030.
10 FILLER PIC X(100).
10 W-SFM0030-S123 OCCURS 8 TIMES.
15 W-SFM0030-JOBNM PIC X(1).
15 W-SFM0030-DATE PIC X(10).
15 W-SFM0030-TIME PIC X(4).
W-SFM0030 is high level group variable in sfm0030 copybook. This is just an example. Redefine structure will differ based on your copybook structure. Corrections are welcome. |
|
Back to top |
|
|
John K
New User
Joined: 27 Aug 2008 Posts: 3 Location: St. Louis, MO
|
|
|
|
Using COPY REPLACING will also allow you to qualify the datanames or you can simply replace all of the datanames you plan to reference.
COPY SFM0030
REPLACING ==S123== BY ==X123==
==jobnm== BY ==x-jobnm==
==date== BY ==x-date==
==time== BY ==x-time==. |
|
Back to top |
|
|
|