View previous topic :: View next topic
|
Author |
Message |
s.thinakaran
New User
Joined: 14 Dec 2005 Posts: 6
|
|
|
|
Hi All,
PSB for a part of an Online program code, here TIF906-ARG3R REDEFINES TIF906-ARG3 and again TIF906-ARG3R is coded in 01 level inside a copy book and code is working fine , i have a doubt here how a same data name is declared for 2 times in 01 level .
01 TIF906-ARG3.
05 FILLER PIC X(2100).
01 TIF906-ARG3R REDEFINES TIF906-ARG3
01 TIF906-ARG3R .
02 FILLER PIC X.
02 IXIN11MR PIC X.
02 IXIN11MC COMP PIC S9(4).
02 SHITEIL COMP PIC S9(4).
02 SHITEII PIC X(1).
Rgs,
Siva |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
You must be getting error in compilation with RC=8.
In such cases if you are not referring the group element TIF906-ARG3R you will not get any error as compiler is able to resolve the memory that you are trying to access. In your case the first occurrence of TIF906-ARG3R doesn?t has any sub-elements and only the second occurrence of TIF906-ARG3R has sub-elements. This makes life of compiler easier. Let say you have used IXIN11MR, than compiler can decide that you are referring to the second occurrence of TIF906-ARG3R.
Compiler gives error only when it is not able to resolve the variable you are referring.
Correction welcome. |
|
Back to top |
|
|
shivakr
New User
Joined: 09 Jan 2006 Posts: 8
|
|
|
|
Hi Umesh,
But when refer 01 TIF906-ARG3 will it have values declred under second occurance of TIF906-ARG3R.
Siva |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
See as their are no values 9elements) under the first occurence of TIF906-ARG3, compiler can resolve variable.
Even if values are defined under first occurence of TIF906-ARG3 and with different name (not same as second occurence) compiler will not give any error.
Basic point is compiler must be able to resolve the variable referred. |
|
Back to top |
|
|
shivakr
New User
Joined: 09 Jan 2006 Posts: 8
|
|
|
|
Hi Umesh,
Thanx for the answers.
Siva |
|
Back to top |
|
|
malla
New User
Joined: 16 Nov 2005 Posts: 15
|
|
|
|
What r the major differences between REDEFINES AND RENAMES ? |
|
Back to top |
|
|
|