View previous topic :: View next topic |
Author |
Message |
Vinodch Beginner
Joined: 23 Dec 2002 Posts: 80 Topics: 32 Location: Chennai, India
|
Posted: Sat May 01, 2004 3:18 am Post subject: Regarding Redefines Clause |
|
|
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 ?. _________________ Thanks,
Vinod. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sun May 02, 2004 9:55 pm Post subject: |
|
|
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 |
|
|
Vinodch Beginner
Joined: 23 Dec 2002 Posts: 80 Topics: 32 Location: Chennai, India
|
Posted: Wed May 05, 2004 1:24 am Post subject: |
|
|
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 |
|
|
|
|