Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to abend a cobol program with S0C7

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to abend a cobol program with S0C7
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    Post subject: Re: HOW TO ABEND A COBOL PROGRAM WITH SC07?
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: 413
Location: Colarado, US

PostPosted: Thu Dec 08, 2005 12:20 pm    Post subject: Re: HOW TO ABEND A COBOL PROGRAM WITH SC07?
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    Post subject:
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: 413
Location: Colarado, US

PostPosted: Thu Dec 08, 2005 8:35 pm    Post subject: Re: How to abend a cobol program with S0C7
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    Post subject:
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us