MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

doubt on cobol redefines clause

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rsk
Beginner


Joined: 16 Jun 2005
Posts: 2
Topics: 1
Location: chennai

PostPosted: Wed Jun 29, 2005 1:57 am    Post subject: doubt on cobol redefines clause Reply with quote

In a particular Cobol program there are two 01 level working storage group variables are there. Their structures are as follows:

01 Variable-X.
05 A PIC X(9).
05 B PIC X(10). --------Length of Variable-X is 29 bytes
05 C PIC 9(10).

01 Variable-Y.
05 A1 PIC X(5).
05 B1 PIC X(10). ----------Length of Variable-Y is 35 bytes
05 C1 PIC X(20).

Now I have to redefine the Variable-X with another 01 level variable Variable-Z whose length is greater than the Variable-X. Lets take the length of Variable-Z as 40 bytes. Now my question is whether the last 11 bytes of the Variable-Z(40-29=11) will point to the memory location of the first 11 bytes of the Variable-Y. My basic doubt is whether all the variables in the working storage section will be in contiguous memory location or not?


Regards,
rsk.
_________________
Regards,
rsk
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Jun 29, 2005 3:00 am    Post subject: Reply with quote

No, position of variable-y will be adjusted accordingly.
Back to top
View user's profile Send private message Send e-mail
rsk
Beginner


Joined: 16 Jun 2005
Posts: 2
Topics: 1
Location: chennai

PostPosted: Wed Jun 29, 2005 3:10 am    Post subject: Reply with quote

Thanks a lot for your reply.
_________________
Regards,
rsk
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group