View previous topic :: View next topic
|
Author |
Message |
stly Warnings : 1 New User
Joined: 25 Jul 2005 Posts: 93
|
|
|
|
Hi,
This may be a simple Doubt,but i am not sure of the internal process thats why raisng in the forum after performing proper search in the forum.
05 WS-A PIC X(05) VALUE 'ABCDE'.
05 WS-C REDEFINES WS-A PIC 9(05).
If i display WS-A and WS-C both are displaying the 'ABCDE'.How its happening.
If WS-C is declared as 9(03) the its displaying 'ABC'.
Can any one throw some lite on this |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi stly,
According into my knowledge, The REDEFINE Cluase is used for to REFER a same memory location in main memory with another DATA ITEM(It can have same data type or diffrent data type)
lets consider example
Code: |
01 WS-A PIC X(10) VALUE "1234567890".
01 WS-B REDEFINES WS-A.
--- 10 WS-NUM1 PIC X(05).
--- 10 WS-NUM2 PIC 9(05). |
In the above example, The variable WS-NUM1 and WS-NUM2 is referring a memory location of WS-A
ie;
Code: |
12345 by WS-NUM1
67890 by WS-NUM2 |
So it simply pick out the contents from WS-A will showed to you but actual DATA TYPE for contents(1234567890) is ALPHANUMURIC.
Regards,
Raghavendra |
|
Back to top |
|
|
|