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
 

 

What is the use of redifines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests
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    Post subject: What is the use of redifines
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

Site Director


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

PostPosted: Thu Aug 09, 2007 11:07 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REDIFINES with different PIC clause a... William Thompson COBOL Programming 3 Wed Jul 11, 2007 7:01 pm
No new posts redifines example kris COBOL Programming 7 Mon Feb 16, 2004 11:05 am


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