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

SOC4 abend on field display


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Thu Nov 21, 2013 7:01 pm
Reply with quote

Hi ,

In my cobol program while doing display i am getting SOC4 abend,

Here the field WS-ABC passed from previous source thru linkage section.
In previous source it has low values and in calling source i just put the
display for WS-ABC and it is giving SOC4 abend. In expedite i have observed, this field has "FETCH PROTECTED AREA" message.

Can you please let me know how to rectify this error.

Thanks and Regards,
Pavan Kumar.M
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Nov 21, 2013 7:06 pm
Reply with quote

The program has not established addressability or has lost addressability. A S0C4 indicates a Protection Exception of which, there is no established field-address.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 21, 2013 7:11 pm
Reply with quote

You did not post anything that would let us help you. At a minimum, we need to see the variable definition in the calling program for each variable in the CALL statement (and a verfiication that you placed these variables in the WORKING-STORAGE SECTION of your calling program), the CALL statement, the LINKAGE SECTION in the called program, and the PROCEDURE DIVISION USING statement in the called program.

At a guess, you have not used the standard COBOL linkage mechanism thus preventing your called program from accessing the calling program variables.
Back to top
View user's profile Send private message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Thu Nov 21, 2013 7:21 pm
Reply with quote

below is the declartion.

In previous program the declartion is
02 ws-abc.
05 abc-length PIC S9(4) COMP.
05 FILLER PIC X(13998).

in calling program in linkage section:-

01 ls-abc.
05 ls-length pic s9(4) comp.
05 filler pic x(35).

thanks and Regards,
pavan Kumar.M
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Thu Nov 21, 2013 7:23 pm
Reply with quote

And on your PROCEDURE DIVISION USING statement in the called program as was requested?
And by now you should know how to use the code tags for posting code.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 21, 2013 7:28 pm
Reply with quote

If you placed the variable in the LINKAGE SECTION of the CALLING program, and not the CALLED program, how did you establish addressability for the LINKAGE SECTION of the CALLING program? Also, you did NOT post the PROCEDURE DIVISION USING statement of the CALLLED program as requested.

Furthermore, you almost certainly will have problems (such as S0C4 abneds) if your called program defines 37 bytes for the LINKAGE SECTION variable(s) and the calling program defines 14000 bytes. Linkage between calling and called programs need to match within 4096 bytes (assembler addressing limit). I have seen S0C4 abends before where the calling program passed 1500 bytes and the called program was expecting 10,000 bytes due to the mismatch between 1 address needed by the calling program and the 3 needed by the called program caused the S0C4.
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 ABEND 0717 during starting IMS IMS DB/DC 0
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts What is the most complex abend you've... Mainframe Interview Questions 8
Search our Forums:

Back to Top