|
|
| Author |
Message |
rajeevdas03
New User
Joined: 21 Jan 2006 Posts: 8 Location: Mumbai
|
|
|
|
Hi,
Can I redefined a variable like this.
05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(5).
during compilation it is giving error;
Original item is smaller than redefinition (7 < 8).
in book it is mentioned you can redefine variable like this |
|
| Back to top |
|
 |
References
|
Posted: Thu Apr 17, 2008 4:59 pm Post subject: Re: Regarding Redefined |
 |
|
|
 |
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 8 Location: Indian
|
|
|
|
Hi Rajiv,
X is alphanumeric and 9 is just numeric. This may create problem redefining Alpha-num to Num.
Nirmal |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1050 Location: germany
|
|
|
|
Rajiv,
| Quote: |
05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(5).
|
WS-PCT-ALPHA PIC -9.9(5). is an edit mask - it is alpha 8 char
did you mean
WS-PCT-ALPHA PIC S9V9(5). which is numeric display 7 char
you can redefine anything as long as your redefinition is not larger than the redefine object. |
|
| Back to top |
|
 |
rajeevdas03
New User
Joined: 21 Jan 2006 Posts: 8 Location: Mumbai
|
|
|
|
nirmal,
I redefined like this , it is working now.
thaks |
|
| Back to top |
|
 |
rajeevdas03
New User
Joined: 21 Jan 2006 Posts: 8 Location: Mumbai
|
|
|
|
sorry nirmal,
like this i redefined.
05 WS-PCT-ALPHA PIC X(07) VALUE SPACES.
05 WS-PCT-ALPHA-R
REDEFINES WS-PCT-ALPHA PIC -9.9(4). |
|
| Back to top |
|
 |
|
|