Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DIFF B/W REDEFINES AND RENAMES ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
malla

New User


Joined: 16 Nov 2005
Posts: 15

PostPosted: Thu Jan 12, 2006 10:11 am    Post subject: DIFF B/W REDEFINES AND RENAMES ?
Reply with quote

What r the major differences between REDEFINES AND RENAMES

:)
Back to top
View user's profile Send private message

iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Jan 12, 2006 11:51 am    Post subject: Re: DIFF B/W REDEFINES AND RENAMES ?
Reply with quote

Hi malla,

Please search the forum before you post your queries.

The topic has already been discussed.

Please stick to the forum rules.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Jan 12, 2006 1:58 pm    Post subject:
Reply with quote

I think you can clearly see the differnce between REDEFINES and RENAMES from the fine manual.

O.
Back to top
View user's profile Send private message
malla

New User


Joined: 16 Nov 2005
Posts: 15

PostPosted: Thu Jan 12, 2006 4:45 pm    Post subject:
Reply with quote

iknow wrote:
Hi malla,

Please search the forum before you post your queries.

The topic has already been discussed.

Please stick to the forum rules



u r name itself says that u know. but i was not aware. Still i searched the forum, i didn't get a clear picture. therefore i posted.

:wink:




ofer71 wrote:
I think you can clearly see the differnce between REDEFINES and RENAMES from the fine manual.

O.




thanks.. ofer71

:)
Back to top
View user's profile Send private message
prashantshinde

New User


Joined: 25 Nov 2005
Posts: 44
Location: Pune

PostPosted: Thu Jan 12, 2006 5:13 pm    Post subject: hello all
Reply with quote

rename is used to rename or regroups the previously defined data items.
whereas redefines is used to redefines the data item.
01 rty.
05 a pic a(10).
05 b redefines a pic a(10).

in this redefines both data items will share same memory space.

regard.
manjinder........
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Jan 12, 2006 5:53 pm    Post subject: Re: DIFF B/W REDEFINES AND RENAMES ?
Reply with quote

Hi malla,

Check the information below.

The RENAMES clause does not use any extra space within the program as all it is doing is supplying a replacement name for use in a data definition attached to the program via a COPY statement. This allows the same code to be copied multiple times and given different names. All of this is resolved by the compiler and does not affect the size of the resultant program.

The REDEFINES clause is used to provide a different data definition for the same data area. In this instance both of the names supplied are accessible to be used in the PROCEDURE DIVISION. As such the code generated by the compiler may be different depending on which of the names that is used.





NOTE
Additional information on REDEFINES

Restrictions on REDEFINES
[list=]OCCURS and REDEFINES cannot be combined
Qualification of data-name-2 not required
Value Clauses only in Condition Names
Redefinition Ceases Whenever a Level No is <= that of data-name-1 or data-name-2 is encountered
The Size of Data-name-1 must be Less than or equal to Data-name-2
Data item lengths and types can also be respecified within an area [/list]

REDEFINES Examples:
Quote:
05 NAME-2.
10 SALARY PICTURE XXX.
10 SO-SEC-NO PICTURE X(9).
10 MONTH PICTURE XX.
05 NAME-1 REDEFINES NAME-2.
10 WAGE PICTURE 999V999.
10 EMP-NO PICTURE X(6).
10 YEAR PICTURE XX.


When an area is redefined, all descriptions of the area are always in effect. That is, redefinition does not cause any data to be erased and never supersedes a previous description.

Thus, if B REDEFINES C has been specified, either of the two procedural statements, MOVE X TO B and MOVE Y TO C, could be executed at any point in the program.


Hope this helps.
Back to top
View user's profile Send private message
dhanunjayperakam

New User


Joined: 12 Jan 2006
Posts: 1
Location: hyd

PostPosted: Fri Jan 13, 2006 9:07 am    Post subject: Re: DIFF B/W REDEFINES AND RENAMES ?
Reply with quote

Hi Iknow and prashantshinde,


thanks alot guys. I got a clear picture now.

icon_smile.gif
Back to top
View user's profile Send private message
malla

New User


Joined: 16 Nov 2005
Posts: 15

PostPosted: Fri Jan 13, 2006 9:15 am    Post subject:
Reply with quote

thanks for the detailed explanation. Nice to see guys like u spending some time to help us.

thanks again.
icon_smile.gif
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Fri Jan 13, 2006 6:02 pm    Post subject: Re: DIFF B/W REDEFINES AND RENAMES ?
Reply with quote

Hi,

Helping others is forums goal. I am a part of it.
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
No new posts Another redefines in COBOL RahulG31 COBOL Programming 1 Fri Mar 20, 2015 4:09 am
No new posts Compare PD Values with same storage &... Shrinika Rajendran JCL & VSAM 5 Wed Nov 05, 2014 3:17 pm
No new posts merge records from 2 ps files with di... kishpra DFSORT/ICETOOL 6 Wed Mar 19, 2014 1:00 pm
No new posts Need help on SORT to write each input... rahul sijoriya JCL & VSAM 4 Mon Dec 02, 2013 9:09 pm
No new posts DB2 delete row from one table with a ... Shereen Samuel DB2 1 Thu Apr 11, 2013 12:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us