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
 
Usage of redefine Clause

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

New User


Joined: 20 Mar 2007
Posts: 8
Location: hyderabad

PostPosted: Fri Sep 14, 2007 11:34 am    Post subject: Usage of redefine Clause
Reply with quote

Hi,
i have redefined a variable with other variables,can i know how much bytes will be occupied for that.
The sample piece of code is shown below.

Code:
05 (XX)-O-T01-C-CURR-P-X           PIC X(03).
05 (XX)-O-T01-C-CURR-B             REDEFINES 
   (XX)-O-T01-C-CURR-P             PIC X(03).
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri Sep 14, 2007 12:17 pm    Post subject:
Reply with quote

what is picture clause of (XX)-O-T01-C-CURR-P ?
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Fri Sep 14, 2007 12:27 pm    Post subject:
Reply with quote

hi prudhvikumar,

Quote:

5 (XX)-O-T01-C-CURR-B REDEFINES
(XX)-O-T01-C-CURR-P PIC X(03).
05 (XX)-O-T01-C-CURR-P-X PIC X(03).


Your question is not clear will you retype the declarations.

Redefine clause is nothing but allotting same memory to both the variables.
If any change is made to any of the variables it will reflect in both the variables.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Sep 14, 2007 3:02 pm    Post subject:
Reply with quote

Hi Reddy,

Didn't get you? What else do you expect, as asked earlier.

Abhijit asked the right question, if you are REDEFINing something (here it's (XX)-O-T01-C-CURR-B) then we should know that what memory area is being redefined (more specifically 'what was the picture clasue of the original variable').

Further, in your post three variables, posted by OP, appears just opposite in sequence, how come. I think, 'Quote button' in this forum does not reverse the contents of the post icon_wink.gif .


P.S.: OP is used for Original Poster.
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: Fri Sep 14, 2007 8:47 pm    Post subject:
Reply with quote

Hello,

Quote:
i have redefined a variable with other variables,can i know how much bytes will be occupied for that
The only length that will be "occupied" is the length of the variables defined bafore the redefines. Variables that are part of a redefinition require no additonal bytes - they just re-use the already defined bytes.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Sep 17, 2007 1:20 pm    Post subject:
Reply with quote

hi Anuj,

I don't know how it got changed now, But previously it was like that which i specified it in the quote of my post.

Any how now it was clear.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Sep 17, 2007 4:19 pm    Post subject:
Reply with quote

balakrishna reddy wrote:
I don't know how it got changed now, But previously it was like that which i specified it in the quote of my post.

May be some Moderator changed it, not sure though. However, not a matter to worry. icon_smile.gif

balakrishna reddy wrote:
Any how now it was clear.

Good to know.. icon_smile.gif
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 Easytrive Redefine vidyaa CA Products 4 Mon Jun 19, 2017 6:01 pm
No new posts )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Redefine SYS1.PROCLIB farhad_evan JCL & VSAM 12 Mon May 22, 2017 10:54 pm
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm

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