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

Problem with COBOL Redefines Clause


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

New User


Joined: 30 Jul 2004
Posts: 95

PostPosted: Mon Sep 13, 2004 11:10 am
Reply with quote

my coding is like this:

WORLING-STORAGE SECTION.
01 G-1.
05 FLD1 pic x(3) VALUE 'ABC'.
05 FLD2 pic x(6) VALUE 'DEFGHI'.
01 G-2 REDEFINES G-1.
05 FLD3 PIC X(6).
05 FILLER PIC X(3).
PROCEDURE DIVISION.
MOVE FLD3 TO FLD2.
DISPLAY 'RESULT OF G-1 AFTER MOVING FLD3 TO FLD2 = ' G-1.

O/P: RESULT OF G-1 AFTER MOVING FLD3 TO FLD2 = ABCABCABC

but how it is can any body explain.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Sep 13, 2004 9:24 pm
Reply with quote

Hi K,

The explanation is: you performed an overlapping MOVE and you deserve everything you got. icon_smile.gif

I've seen this technique (OL move) used to initialize a field to spaces. It was supposed to be more efficient. Don't remember the details though.

My advice: don't do OL moves.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Sep 13, 2004 9:46 pm
Reply with quote

Hi K,

Just a follow-up to my previous post. I notice that you pose quite a few questions to the gruop but you don't bother to answer questions about your problem or send an indication that the proposed solution works or not. Not even a simple "thank you for taking the time and expending the effort to help".

Do you think we get paid for doing this?
Back to top
View user's profile Send private message
ksivapradeep

New User


Joined: 30 Jul 2004
Posts: 95

PostPosted: Wed Sep 15, 2004 9:32 am
Reply with quote

hi jack,
thanks 4 ur advise, 4m now i will replly 4 every one who gave ans to me

regards
pradeep
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top