View previous topic :: View next topic
|
Author |
Message |
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Hi,
INITIALIZE I J.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 2
MOVE SPACES TO MEM-field1(I)
MOVE SPACES TO MEM-field2(I)
MOVE SPACES TO MEM-field3(I)
end-perform.
all mem-fields are PIC x().
I am experiencing SOC 7 when 1st move statement in perform is encountered.
Please help ....
Thanks & Regards,
Ranjit... |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Can you provide the full code including the decalration of MEM-FIELD1/2/3. Are they all COBOL tables. why did you have subscript for all , I doubt you may have declared one table and want to use subscript to refer the three occurances. |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Actually this is not the actual code.
Its a pretty big file rec.
Yes all these field are table elements.
The record layout is like :
01 OUT-REC.
02 SR-NUMBER PIC X(8).
02 BEFORE-AFTER OCCURS 2 TIMES.
05 MEM-DATA.
10 MEM-FIELD1 PIC X(4).
10 MEM-FIELD2 PIC X(9).
10 MEM-FIELD3 PIC X(10).
NO PROBLEM WHILE MOVING SPACES TO SR-NUMBER.
BUT GETTING SOC7 WHEN
MOVE SPACES TO MEM-FIELD1(I) IS ENCOUNTERED.
TRIED USING WS-REC SIMILAR TO OUT-REC BUT STILL GETTING SOC7 WHILE MOVING TO BEFORE-AFTER.
Please help. |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Quote: |
MOVE SPACES TO MEM-FIELD1(I) IS ENCOUNTERED.
|
How can you use this code? MEM-FIELD1 by itself is not a table but BEFORE-AFTER is. Since there is no occurance you are naturally getting S0C7. Instead move spaces to BEFORE-AFTER(I). |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
prasadvrk wrote: |
Quote: |
MOVE SPACES TO MEM-FIELD1(I) IS ENCOUNTERED.
|
How can you use this code? MEM-FIELD1 by itself is not a table but BEFORE-AFTER is. Since there is no occurance you are naturally getting S0C7. Instead move spaces to BEFORE-AFTER(I). |
MEM-FIELD1 is subordinate to an occurs therefore it must be subscripted or indexed when it is used. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What is the definition of I? |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
05 I PIC 9(03) VALUE ZEROS.
I dunno why its giving SOC 7 for moving spaces to an alphanumeric variable.
Please help. |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Quote: |
MEM-FIELD1 is subordinate to an occurs therefore it must be subscripted or indexed when it is used. |
Sorry for missing out on that.
I strongly doubt that it has something to do with I and the subscripted item does not exist. Why don't you try displaying I. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How did you verify the 0c7 happens on the MOVE SPACES?
As an experiment, you might put a DISPLAY I immediately before the MOVE SPACES.
Post what happens then.
It may help if you post more of your code. |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
I am expediting the program. And it does give the SOC7 at that point.
Yeah I am keeping the I and it does gets value 001. I also tried using
I PIC s9(3). but no success.
I am really out of Ideas. Please do suggest something.
Thanks,
Ranjit |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How long is the source code? If we could see more/all of it, that may help. If you can post all of the source, someone may be able to load it on their machine and see if the same problem occurs. |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Thanks Dick.
But I don't think I can post the actual code on the web.
The problem is weird though. I hope I find something soon.
I know that I am not able to give more information due to the shop restrctions but just let me know if you think of any possible solutions.
Thanks,
Ranjit |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Might it be possible to post the working-storage section?
Not being able to see the code does make trouble-shooting a bit more difficult |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I'm sure you have done this, but if you have a dump, look at the instruction in front of the address in the psw provided by the abend.
It should be a decimal instruction, what is it and where is it getting its data from? |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
This is the working storage section entries for the record.
Code: |
05 I PIC 9(03) VALUE ZEROS.
05 J PIC 9(03) VALUE ZEROS.
01 WS-UPDATE.
02 WS-PLN-NUMBER PIC X(8) VALUE SPACES.
02 WS-BEFORE-AFTER OCCURS 2 TIMES.
05 WS-DEP-COUNT PIC S9(3) VALUE ZEROS.
05 WS-COV-COUNT PIC S9(3) VALUE ZEROS.
05 WS-MEM-DATA.
10 WS-MEM-DIV-NR PIC X(4) VALUE SPACES.
10 WS-MEM-NR PIC X(9) VALUE SPACES.
10 WS-MEM-EFF-DT PIC X(10) VALUE SPACES.
10 WS-MEM-UNIQUE-ID PIC X(9) VALUE SPACES.
10 WS-MEM-STATUS PIC X(1) VALUE SPACES.
10 WS-MEM-NAME PIC X(30) VALUE SPACES.
10 WS-MEM-ADDR-1 PIC X(30) VALUE SPACES.
10 WS-MEM-ADDR-2 PIC X(30) VALUE SPACES.
10 WS-MEM-ADDR-3 PIC X(30) VALUE SPACES.
10 WS-MEM-CITY-AD PIC X(19) VALUE SPACES.
10 WS-MEM-ST-ABBR-CD PIC X(2) VALUE SPACES.
10 WS-MEM-ZIP PIC X(10) VALUE SPACES.
10 WS-MEM-CNTRY-CD PIC X(3) VALUE SPACES.
10 WS-MEM-CARD-BOOK-IND PIC X(1) VALUE SPACES.
10 WS-MEM-OPT-16 PIC X(1) VALUE SPACES.
10 WS-MEM-INS-CLASS PIC X(4) VALUE SPACES.
10 WS-MEM-FAMILY-IND PIC X(1) VALUE SPACES.
10 WS-MEM-TERM-REASON-CD PIC X(3) VALUE SPACES.
10 WS-MEM-TERM-DATE PIC X(10) VALUE SPACES.
10 WS-MEM-COV-DATA OCCURS 1 TO 100 TIMES
DEPENDING ON WK-COV-COUNT.
15 WS-MEM-BTBN PIC X(8) VALUE SPACES.
10 WS-MEM-DEP-DATA OCCURS 0 TO 20 TIMES
DEPENDING ON WK-DEP-COUNT.
15 WS-MEM-DEP-NAME PIC X(30). |
I am not able to initialize or move values to any of the WS-BEFORE-AFTER
variables.
For any of those variables I am getting SOC7.
THanks,
Ranjit... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When you execute the problem MOVE what values are in WK-COV-COUNT and WK-DEP-COUNT? There is no MOVE SPACES to WS-UPDATE is there?
I'll be on the road for a bit, but will check back in later to see what these values are. If they are not numeric, that could be a problem. |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
Thanks Dick, its solved.
This SOC 7 did su** my head for almost 2 days. Finally its over.
Thanks a lot. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is solved
What was the cause and what was the fix? |
|
Back to top |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
WK-COV-COUNT and WK-DEP-COUNT was the problem. As we moved zeros to it at the begining and after moving values to the variable item it got solved. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thank you for posting your solution |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
Change I to PIC S9(4) COMP. (COMP will not cause an OC7). Note that changing I to COMP is not the solution to your problem - just a diagnostic experiment.
Display contents of I before and after the first MOVE.
Do not run under the debugger - to eliminate possibility that the debugger is somehow responsible for OC7. The only field involved in your MOVE statements that could cause an OC7 is I.
My bet is that OC7 is happening on another statement and that your debugger is misleading you. But perhaps not... |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
Is there any redefinition of WS-BEFORE-AFTER. why don't you compile with TEST option and get the exact line where you are getting S0C7. It may be due to some other reason. I know you have expedited but still let us explore this way and see. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please note that this 0c7 has been resolved. TS posted the resolution last week. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Try move spaces to WS-Update remembering that ALL group moves are alpha numeric and you will then need to init any numeric fields with zero. Then init wk-cov-count and wk-dep-count to zeroes. Then move zero to WS-DEP-COUNT (1)
WS-COV-COUNT (1)
WS-DEP-COUNT (2)
WS-COV-COUNT (2)
10 WS-MEM-COV-DATA OCCURS 1 TO 100 TIMES
DEPENDING ON WK-COV-COUNT.
15 WS-MEM-BTBN PIC X(8) VALUE SPACES.
10 WS-MEM-DEP-DATA OCCURS 0 TO 20 TIMES
DEPENDING ON WK-DEP-COUNT.
WS-BEFORE-AFTER OCCURS 2 TIMES. |
|
Back to top |
|
|
|