View previous topic :: View next topic
|
Author |
Message |
rajeevdas03 Warnings : 1 New User
Joined: 21 Jan 2006 Posts: 19 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 |
|
|
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Hi Rajiv,
X is alphanumeric and 9 is just numeric. This may create problem redefining Alpha-num to Num.
Nirmal |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 Warnings : 1 New User
Joined: 21 Jan 2006 Posts: 19 Location: Mumbai
|
|
|
|
nirmal,
I redefined like this , it is working now.
thaks |
|
Back to top |
|
|
rajeevdas03 Warnings : 1 New User
Joined: 21 Jan 2006 Posts: 19 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 |
|
|
|