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

getting SOC4 abend while ZEROS moving in to COMP-3 fields?


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

New User


Joined: 11 Apr 2006
Posts: 93

PostPosted: Wed Nov 18, 2009 2:52 pm
Reply with quote

When i am moving ZEROS to COMP-3,i am getting SOC4 abend.why iam getting this abend.

05 WS-RTI-TRAN-AMOUNT PIC 9(12)V99 COMP-3.
10 RTI-AMOUNT PIC 9(12)V9(2) COMP-3.


MOVE ZEROS TO WS-RTI-TRAN-AMOUNT
RTI-AMOUNT.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Wed Nov 18, 2009 3:02 pm
Reply with quote

Hi Babu,

the information you provided is insufficient....but check the level number.

But S0c4 is protection exception. what is the reason code???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Nov 18, 2009 5:00 pm
Reply with quote

Are these fields in your Linkage Section, by any chance?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Nov 18, 2009 5:25 pm
Reply with quote

the location of the two fields (Working-Storage, Linkage, etc...)
is important.

A Sock 4 means, as Arvind suggested, that you are attempting to modify address space that does not belong to your task or with SSRANGE option,
you are off the end of a COBOL internal table.
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Fri Nov 20, 2009 1:14 am
Reply with quote

try assigning it default value in the WS only.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Fri Nov 20, 2009 1:33 am
Reply with quote

Is "WS-RTI-TRAN-AMOUNT" or "RTI-AMOUNT" a part of a record definition in an FD entry?

You can't reference a field in a record until the file is open, and for an input file before it is read.
Back to top
View user's profile Send private message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Tue Nov 24, 2009 1:18 am
Reply with quote

Code:
05 WS-RTI-TRAN-AMOUNT PIC 9(12)V99 COMP-3.
10 RTI-AMOUNT PIC 9(12)V9(2) COMP-3.


-As per definition WS-RTI-TRAN-AMOUNT is group and I never saw PIC for a GRP.

-As already mentioned, by some gentleman, S0C4 is protection exception. If this is not a part of any FD entry it should not thrown S0C4.


Happy coding!!!
Cheers icon_smile.gif
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: Tue Nov 24, 2009 1:35 am
Reply with quote

Is "10 RTI-AMOUNT" an elementary element to group "05 WS-RTI-TRAN-AMOUNT"? If this is true, then how did the program compile clean?

A group level cannot have a specific PICTURE clause, unless it specifies the PICTURE of all subordinate elementary items which belong to the group, in which case, you would specify "05 WS-RTI-TRAN-AMOUNT COMP-3." and all subordinates take on the COMP-3 PICTURE.

There's something fishy here, either that or you haven't be all forthcoming....

Bill
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: Tue Nov 24, 2009 1:36 am
Reply with quote

Hello,

Quote:
-As per definition WS-RTI-TRAN-AMOUNT is group and I never saw PIC for a GRP.
Why do you believe a group. . .? How about 2 elementary items at different levels?

If this code was a group, there would be no 0c4 as the code would not compile.

Why do you believe an 0c4 will only happen in an FD?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 24, 2009 1:46 am
Reply with quote

Quote:
If this is not a part of any FD entry it should not thrown S0C4.

  1. If the field is in the linkage section and the structure has not received addressability,
    you will receive a S0C4.
  2. also, with SSRANGE ON and you have walked off the end of a COBOL internal table
    (defined in Working-Storage or Linkage)
    you will receive a S0C4.

throwing an error and catching an error is JAVA or C talk.
COBOL does not throw errors,
the offending module receives an error
or has an error returned
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 ISAM and abend S03B JCL & VSAM 10
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top