View previous topic :: View next topic
|
Author |
Message |
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
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 |
|
|
sunish
New User
Joined: 23 May 2005 Posts: 19
|
|
|
|
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 |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi Sunish,
Good job man.
Keep doing big things early. |
|
Back to top |
|
|
rohit_y
New User
Joined: 23 Nov 2005 Posts: 4
|
|
|
|
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 |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
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 |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
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 |
|
|
vrakeshmbt
New User
Joined: 17 Aug 2005 Posts: 30
|
|
|
|
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 |
|
|
|