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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


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