View previous topic :: View next topic
|
Author |
Message |
mathiprakash
New User
Joined: 29 Apr 2005 Posts: 14 Location: Pune, India.
|
|
|
|
Hi Everybody,
I have one array which occurs 7 times with PIC 9(2).
Now I want to redefine this array with 7 different individual variables which all having 88 level numbers as well.
How can we achieve that?
The context is like this
---------------------------
01 WS-LIST-CALENDER
05 THE-CALENDER OCCURS 7 TIMES INDEXED BY CAL1
10 CALENDER-DAY PIC 9(02)
Now I want to redefine this array with these individual variables.....
01 WS-SUNDAY PIC 9(02)
88 DAY-SET VALUE 00
88 DAY-NOT-SET VALUE 01
01 WS-MONDAY PIC 9(02)
88 DAY-SET VALUE 00
88 DAY-NOT-SET VALUE 02
::
::
01 WS-SATURDAY PIC 9(02)
88 DAY-SET VALUE 00
88 DAY-NOT-SET VALUE 07
Anybody help me in this..
Thanks,
Matty. |
|
Back to top |
|
|
vijay naidu
New User
Joined: 12 Jul 2005 Posts: 5 Location: pune
|
|
|
|
Hi Matty,
Good question but we can't redifned an array. but u can redifine an element in an array i don't what is ur logic in ur array but i am sending one solution in my way
01 WS-LIST-CALENDER
05 THE-CALENDER OCCURS 7 TIMES INDEXED BY CAL1
10 CALENDER-DAY PIC 9(02)
10 WS-SUNDAY REDEFINES CALENDER-DAY PIC 9(02)
88 DAY-NOT-SET VALUE 00
88 DAY-SET VALUE 01
10 WS-MONDAY REDEFINES CALENDER-DAY PIC 9(02)
88 DAY-NOT-SET VALUE 00
88 DAY-SET VALUE 02
::
::
10 WS-SATURDAY REDEFINES CALENDER-DAY PIC 9(02)
88 DAY-NOT-SET VALUE 00
88 DAY-SET VALUE 07
FOR EXAMPLE
SET CAL1 TO 1.
THEN THE ARRAY STARTS FROM BEGANING AND EACH ONE SHARES THE SAME MEMORY AREA |
|
Back to top |
|
|
mathiprakash
New User
Joined: 29 Apr 2005 Posts: 14 Location: Pune, India.
|
|
|
|
Thanks Vijay.
But I want like this.
The WS-SUNDAY should redefine the THE-CALENDER(1)
The WS-MONDAY should redefine the THE-CALENDER(2)
:
:
The WS-SATURDAY should redefine the THE-CALENDER(7)
Is it possible? |
|
Back to top |
|
|
mainframesguru
New User
Joined: 24 Jun 2005 Posts: 36 Location: Hyderabad
|
|
|
|
Hi,
Do it This Way:
It Works
Please check the Rough Sketch of it:
01 WS-TABLE.
03 WS-ARRAY1.
05 WS-ARRAY2 PIC 9(2).
88 WS-ARRAY2-TRUE VALUE 1.
88 WS-ARRAY2-FALSE VALUE 0.
05 WS-ARRAY3 PIC 9(2).
03 WS-ARRAY4 REDEFINES WS-ARRAY1.
05 WS-ARRAY5 OCCURS 2 TIMES.
07 WS-ARRAY6 PIC 9(2).
1. Define the variables with 88 level number first
2. Then Redefine it
3. Use occurs in Redefined Data-Item
For anyother Clarification Revert Back.
Thanks And Regards
Vamshi
ICC-ISH
Chennai |
|
Back to top |
|
|
|