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 

Regarding 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
Vinodch
Beginner


Joined: 23 Dec 2002
Posts: 80
Topics: 32
Location: Chennai, India

PostPosted: Sat May 01, 2004 3:18 am    Post subject: Regarding Redefines Clause Reply with quote

If the redefined item has a level number other than 01, its length in bytes must not be less than that of any redefining item - Could anyone explain the reason ?. Sad
_________________
Thanks,
Vinod.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sun May 02, 2004 9:55 pm    Post subject: Reply with quote

Vinodch,

Quote:

If the redefined item has a level number other than 01, its length in bytes must not be less than that of any redefining item - Could anyone explain the reason ?.


where did you get that from ? . As far as I know I don't think it is a problem to redefine an item with less than the redefining item. I am sure that this code will compile without any problem except for giving an informational message it was redefined a larger item

Code:

                       
   05 VAR-A                   PIC X(05).
   05 VAR-B  REDEFINES VAR-A  PIC X(02).


Check this link for a detailed explanation of the REDEFINES clause

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vinodch
Beginner


Joined: 23 Dec 2002
Posts: 80
Topics: 32
Location: Chennai, India

PostPosted: Wed May 05, 2004 1:24 am    Post subject: Reply with quote

I tried the following combinations:

(i) RC=0

01 A PIC X(02).
01 B REDEFINES A PIC X(04).

(ii) RC=0

01 A1.
05 A PIC X(04).
05 B REDEFINES A PIC X(04).

(iii) RC=0. Informational Message is "B redefined a larger item".

01 A1.
05 A PIC X(04).
05 B REDEFINES A PIC X(02).

(iv) RC=12. Error Message is "B redefined a smaller item".

01 A1.
05 A PIC X(02).
05 B REDEFINES A PIC X(04).

In the above example A is a redefined item, length in bytes is less than
redefining item B.

Please let me know your comments.
_________________
Thanks,
Vinod.
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