View previous topic :: View next topic
|
Author |
Message |
babu_hi
New User
Joined: 11 Apr 2006 Posts: 93
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Are these fields in your Linkage Section, by any chance? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
t5590ag
Active User
Joined: 21 May 2009 Posts: 139 Location: United States
|
|
|
|
try assigning it default value in the WS only. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
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 |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
If this is not a part of any FD entry it should not thrown S0C4. |
- If the field is in the linkage section and the structure has not received addressability,
you will receive a S0C4. - 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 |
|
|
|