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

What is the use of redifines


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srebba
Warnings : 1

New User


Joined: 26 Apr 2007
Posts: 37
Location: USA

PostPosted: Thu Aug 09, 2007 10:29 pm
Reply with quote

Hi,

I have searched and read all the topics related to this.. but frankly speaking iam not clear on this,, please help me..

what is the use redifines..
I know the defination says we can use the storage space by utilising original item lenght,..
But if move any value to origanl feild then other feild is also populated,,
then throught the prorgam how can we know which is the variable which value.. i think u understood, so then what is the use of same value on both varaibles.. please let me know if iam not clear...

exactly i would like to know .. what is the use... when we should use,, when we can use.. when we should not use ... please let me know

thank you
sree
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 09, 2007 11:07 pm
Reply with quote

Hello,

One use for a redefines is to break down a field.

Say you have a date:
Code:
       01  my-date    pic x(8).

Now let's say you want to be able to use data components without using reference modification:
Code:
       01  my-date-r redefines my-date.
           05 my-cc      pic 99.
           05 my-yy      pic 99.
           05 my-mm      pic 99.
           05 my-dd      pic 99.

With these (re)definitions, you can directly access the entire date or only pieces of the date.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 09, 2007 11:19 pm
Reply with quote

Go to manuals button (very top of any page of this website), right-click, open a new tab (or window), click on any of the language references for COBOL, page-down to the index, click on index, find 'REDEFINE' and look at the write-up and examples. If you have more questions after that, come back to the forum.
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts REDIFINES with different PIC clause a... COBOL Programming 3
No new posts redifines example COBOL Programming 7
Search our Forums:

Back to Top