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 Renames clause

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

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Thu Dec 16, 2004 10:56 am    Post subject: What is the use of Renames clause
Reply with quote

hi all

can anyone explain me what is the use of renames clause.


regards
purushoth
Back to top
View user's profile Send private message

ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Thu Dec 16, 2004 12:51 pm    Post subject: Here is your answer...
Reply with quote

Hi,

RENAMES in cobol is used to declare a new data item in terms of an existing data item. The level number should be 66.

Eg: 01 MY-REC.
02 X PIC 9(3).
02 Y PIC X(10).
02 Z PIC X(20).
I want to declare a U-REC with same structure as MY-REC then

66 U-REC RENAMES MY-REC.
This is equilant to declaring U-REC with same structure of MY-REC.

If you want to declare U-REC with a part of MY-REC then u can declare it as...

66 U-REC RENAMES X THROUGH Y.
It means your record will contain only X,Y sub data items.


Bye,
Reddy.
Back to top
View user's profile Send private message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 42
Location: chennai, india

PostPosted: Tue Mar 01, 2005 6:21 pm    Post subject: regarding renames
Reply with quote

Hi reddy,

It is not possible to use renames in level numbers other than 02 to 49.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Wed Mar 02, 2005 11:04 am    Post subject:
Reply with quote

Hi muthukumarapandian

Quote:
It is not possible to use renames in level numbers other than 02 to 49.


I couldn't get you what you are saying? Do you mean to say we can use renames only with level numbers 02-49.

Renames should be used only with level number 66.
Back to top
View user's profile Send private message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 42
Location: chennai, india

PostPosted: Wed Mar 02, 2005 6:35 pm    Post subject:
Reply with quote

Hi ,

I am telling that u can rename the elements declared in 02 to 49 level.
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1203
Location: India

PostPosted: Fri Mar 04, 2005 1:13 am    Post subject: Re
Reply with quote

But the question is: "What's the use of Renames Clause"

The uses of RENAMES Clause:

1. To create a new group from one or more existing groups
2. To create an alias name

But the main purpose of RENAMES Clause, it can be used in DISPLAY statement effectively.

For example, assume that I have a group with 5 subjects. I want to display the second, third and forth subjects only.

Code:

01 MARKS.
 02 MARK1 PIC 99.
 02 MARK2 PIC 99.
 02 MARK3 PIC 99.
 02 MARK4 PIC 99.
 02 MARK5 PIC 99.

So I have to use DISPLAY M2, M3, M4. (if NO renames)

With RENAMES, I can do this like:

66 SUBMARKS RENAMES MARK2 THRU MARK4.

Now I can say: DISPLAY SUBMARKS.
    (Assume the efficiency if you have 100 fields in that group)
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 Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm
No new posts when=group clause: question about the... tuxama DFSORT/ICETOOL 2 Thu Mar 26, 2015 12:51 pm
No new posts pic clause on group variable error CuriousMainframer COBOL Programming 6 Mon Jul 14, 2014 6:33 pm


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