IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Usage of redefine Clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 691
Location: Earth

PostPosted: Fri Sep 14, 2007 12:17 pm
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: 128
Location: Guntur

PostPosted: Fri Sep 14, 2007 12:27 pm
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

Superior Member


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

PostPosted: Fri Sep 14, 2007 3:02 pm
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

Moderator Emeritus


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

PostPosted: Fri Sep 14, 2007 8:47 pm
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: 128
Location: Guntur

PostPosted: Mon Sep 17, 2007 1:20 pm
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

Superior Member


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

PostPosted: Mon Sep 17, 2007 4:19 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To search DB2 table based on Conditio... DB2 1
No new posts STEM usage in REXX CLIST & REXX 14
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts JCL and TAPE drives: how to maximize ... JCL & VSAM 9
Search our Forums:

Back to Top