Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
getting SOC4 abend while ZEROS moving in to COMP-3 fields?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: getting SOC4 abend while ZEROS moving in to COMP-3 fields?
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Nov 18, 2009 5:00 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Nov 18, 2009 5:25 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 24, 2009 1:35 am    Post subject: Reply to: getting SOC4 abend while ZEROS moving in to COMP-3
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

Site Director


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

PostPosted: Tue Nov 24, 2009 1:36 am    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Tue Nov 24, 2009 1:46 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts C03 ABEND sjiraga PL/I & Assembler 1 Thu Jun 01, 2017 4:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us