IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Experiencing SOC 7 when 1st move statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Wed Jun 27, 2007 7:09 pm
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 27, 2007 7:19 pm
Reply with quote

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
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Wed Jun 27, 2007 7:26 pm
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Jun 27, 2007 7:32 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 27, 2007 8:07 pm
Reply with quote

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).

icon_sad.gif
MEM-FIELD1 is subordinate to an occurs therefore it must be subscripted or indexed when it is used.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 27, 2007 8:09 pm
Reply with quote

What is the definition of I?
Back to top
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Jun 28, 2007 11:03 am
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 28, 2007 12:22 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 12:23 pm
Reply with quote

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
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Jun 28, 2007 12:32 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 12:56 pm
Reply with quote

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
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Jun 28, 2007 1:02 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 1:11 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jun 28, 2007 2:39 pm
Reply with quote

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
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Jun 28, 2007 3:07 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 6:23 pm
Reply with quote

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
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Jun 28, 2007 6:55 pm
Reply with quote

Thanks Dick, its solved.

This SOC 7 did su** my head for almost 2 days. Finally its over.

Thanks a lot.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 28, 2007 7:11 pm
Reply with quote

Good to hear it is solved icon_smile.gif

What was the cause and what was the fix?
Back to top
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Fri Jun 29, 2007 2:37 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 29, 2007 6:14 pm
Reply with quote

Thank you for posting your solution icon_smile.gif
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Fri Jun 29, 2007 9:35 pm
Reply with quote

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
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jul 05, 2007 1:06 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 05, 2007 8:02 pm
Reply with quote

Hello,

Please note that this 0c7 has been resolved. TS posted the resolution last week.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Jul 06, 2007 7:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts How to move DB2 Installation HLQ DB2 4
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
Search our Forums:

Back to Top