View previous topic :: View next topic
|
Author |
Message |
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Hi,
Part of copy book :
05 WS-OUTPUT-PARAMETERS OCCURS 1 TO 200 TIMES
DEPENDING ON WS-REQUEST-COUNT.
15 WSO-RETURN-CODE PIC X(04).
15 WSO-HASMORE-ROWS PIC X(01).
15 WSO-RESPONSE-COUNT PIC 9(03).
15 WSO-RESPONSE OCCURS 1 TO 30 TIMES
DEPENDING ON WSO-RESPONSE-COUNT.
20 WSO-ABC PIC X(10).
20 WSO-TYPE PIC X(10).
20 WSO-XYZ PIC X(09).
This gives me a compilation error as there is DEPENDING ON clause with in OCCURS and DEPENDING ON caluse elements.
Can anyone please give me a solution how to solve this problem ASAP ?
Please respond ASAP,
Thanks |
|
Back to top |
|
|
ramesh_m
New User
Joined: 27 Sep 2006 Posts: 10 Location: Sydney
|
|
|
|
Hi,
Can you please let me know the error which you are getting |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Error MSG from Endeavor :
"OCCURS DEPENDING ON" OBJECT "WSO-RESPONSE-COUNT" WAS DEFINED AS A TABLE ELEMENT. THE "DEPENDING ON" PHRASE WAS DISCARDED.
Thanks & Regards,
Ranjit |
|
Back to top |
|
|
ramesh_m
New User
Joined: 27 Sep 2006 Posts: 10 Location: Sydney
|
|
|
|
Hi,
From the error, we can't use the varriable WS-RESPONSE-COUNT in depending on clause, because it is coming under another occur clause.
I am not sure about the other solution....... |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Thanks but I am aware about that.
What I need to know if there is any other way that we can modify the copy book to use same variables with same effect.
Please help, I am stuck in this program.
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
What u want to modify in copybook? |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
The problem is there is a variable length table within a variable length table in the given copy book.
Now I can't remove
15 WSO-RESPONSE OCCURS 1 TO 30 TIMES
DEPENDING ON WSO-RESPONSE-COUNT.
as it will change the way the varibles behave, as the given copy book is also used by some other program.
Is there anyway I can change the OCCURS clause to keep the functionality of the variable similar.
Or how to modify the given ODO clause so the program will be compiled successfully.
Please help !!!!!!!!! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
If the copybook is failing to compile in your program, what makes you think the copybook will compile clean in another program? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Ranjitbhingare,
Dick is right it wont wrk in any program So u dont have ne option other than modifying the copybook |
|
Back to top |
|
|
toddnugen
New User
Joined: 01 Nov 2006 Posts: 9
|
|
|
|
Can use no copy book or redefines it, and so the change wont affect to the rest of system. Looks like WSO-RESPONSE-COUNT needs an index.
If it cant fix, then replace it with a new data name, then change the program logic correspondingly. Good luck. |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Thank you very much guys !
Finally we changed the copybook itself and removed ODO object which was causing the problem.
Releived.
Thanks,
Ranjit |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Hi,
Just wanted to share this.
We found a way to solve the problem :
WORKING-STORAGE SECTION.
01 WS-RESPONSE-CT PIC 9(03) VALUE ZERO.
PROCEDURE DIVISION.
MOVE WS-RESPONSE-COUNT(N) TO WS-RESPONSE-CT.
And we can use 'WS-RESPONSE OCCURS 1 to 30 TIMES DEPENDING ON WS-RESPONSE-CT " in copybook .
Regards,
Ranjit Bhingare |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
well guys saw this topic and was bit amazed. Think we should forgot a rule. Whenever u have to use depending on clause then the variable on which your value depends must be defined prior. For e.g
01 table1
02 ws-rec pic 99.
02 ws-fil pic x(20) occurs 1 to 200 times depending on ws-rec.
Above syntax is correct. Where as the following is not
01 table1
02 ws-fil pic x(20) occurs 1 to 200 times depending on ws-rec.
working-storage section.
01 ws-rec pic 99. |
|
Back to top |
|
|
vijay_bn79
New User
Joined: 20 Nov 2006 Posts: 48 Location: Hyderabad
|
|
|
|
Hi
this may work, please try with this
i think we should give INDEXED BY as follows:-
INDEXED BY WS-INDEX
Modify this code as given below and compile again:-
05 WS-OUTPUT-PARAMETERS OCCURS 1 TO 2 TIMES
DEPENDING ON WS-REQUEST-COUNT INDEXED BY WS-INDEX. |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
indexed by is used when u like the organisation of table on index rather than using subscripts. |
|
Back to top |
|
|
|