Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with COBOL Redefines Clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem with COBOL Redefines Clause
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us