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

How to abend a cobol program with S0C7


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

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Thu Dec 08, 2005 11:48 am
Reply with quote

Members,

Can any one of you provide me the simplest code to abend a COBOL program with SC07 at run time?

Note: The code should be working.

reply awaited......
Back to top
View user's profile Send private message
sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Thu Dec 08, 2005 12:17 pm
Reply with quote

hi

this is the code

01 a pic 9(2).
01 b pic 9(2).
.....

add a to b.

in the run prgm give input as '1 for a and 02 for b. any special character except & will give abend. pl if i am worng correct me .
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Thu Dec 08, 2005 12:20 pm
Reply with quote

Hi Sunish,

Good job man.

Keep doing big things early.
Back to top
View user's profile Send private message
rohit_y

New User


Joined: 23 Nov 2005
Posts: 4

PostPosted: Thu Dec 08, 2005 4:13 pm
Reply with quote

ABEND SOC7 is a Data Exception Error.
it means if there is an exception for the pic clause of a stated variable, this abend will occur.

it can also occur when u try to do computation on variables including alphanumerics or alphabteics.
(u can move numerics into alphanumeric but cant do any calculation stuff including both)

so Please try this and let me know if i m wrong!
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Thu Dec 08, 2005 8:35 pm
Reply with quote

Hi rohit_y,

What you said is absolutely right. SOC7 abend occurs in many ways.

I suggest you to check our forum on articles on SOC7. This will give you all the details about SOC7.

Hope this helps.
Back to top
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Mon Dec 12, 2005 10:06 am
Reply with quote

Hi All,

I know all the reasons for which SOC7 occurs and how to solve it.
But my problem is to write a COBOL program that will abend with SOC7 on runtime. The program must have only the required statements to abend it.

And please don't put any reponse to this question if you have not tried it on PC.

Good Luck GUY'S!!
Back to top
View user's profile Send private message
vrakeshmbt

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Tue Dec 13, 2005 5:10 pm
Reply with quote

IDENTIFICATION DIVISION.
PROGRAM-ID. RAKESH.
***************
ENVIRONMENT DIVISION.
***************
DATA DIVISION.
WORKING-STORAGE SECTION.

01 A.
02 BA PIC 9(18) COMP-3.
01 B PIC 9(2).

PROCEDURE DIVISION.

MOVE 12 TO A.
MOVE A TO B.
ADD BA TO B.
DISPLAY 'A= ',A.
DISPLAY 'B= ',B.
STOP RUN.



the above program will compile well and while run time u will get s0c7 error. i have checked it.

hope u got the required answer.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top