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

alternate method needed


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

New User


Joined: 16 Sep 2008
Posts: 4
Location: chennai

PostPosted: Tue Sep 16, 2008 4:32 pm
Reply with quote

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

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Tue Sep 16, 2008 4:55 pm
Reply with quote

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

New User


Joined: 16 Sep 2008
Posts: 4
Location: chennai

PostPosted: Tue Sep 16, 2008 5:02 pm
Reply with quote

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

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Tue Sep 16, 2008 5:55 pm
Reply with quote

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

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Tue Sep 16, 2008 5:56 pm
Reply with quote

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

New User


Joined: 27 Aug 2008
Posts: 3
Location: St. Louis, MO

PostPosted: Wed Sep 24, 2008 1:39 am
Reply with quote

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
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 Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Mainframe profiles needed @ Cognizant Mainframe Jobs 0
Search our Forums:

Back to Top