View previous topic :: View next topic
|
Author |
Message |
srebba Warnings : 1 New User
Joined: 26 Apr 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|