I am Getting the soc7 abend while i executing this program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

I am Getting the soc7 abend while i executing this program

Postby muthu455 » Sat Apr 21, 2012 3:32 pm

hello i'm new to mainframe please help.
this is my mainprogram
IDENTIFICATION DIVISION.
PROGRAM-ID. MAINPR.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 99 VALUE 30.
77 B PIC 99 VALUE 40.
77 C PIC 99 VALUE 10.
PROCEDURE DIVISION.
START-PARA.
CALL "MAINPR" USING BY VALUE 30 40 10.
DISPLAY C.
STOP RUN.
and my subprogram is
IDENTIFICATION DIVISION.
PROGRAM-ID. MAINPR1.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
77 D PIC 99 VALUE.
77 E PIC 99 VALUE.
77 F PIC 99 VALUE.
PROCEDURE DIVISION USING D E F.
START-PARA.
COMPUTE F = D + E.
EXIT PROGRAM.
while i compiling i getting maxcc=0 after i execute the program i am getting the soc7 abend can any one help me please
how can i use the call by value in cobol program give me the example programs.....
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: I am Getting the soc7 abend while i executing this progr

Postby BillyBoyo » Sat Apr 21, 2012 3:48 pm

If you want to use "BY VALUE" you have to use it properly. Check the manuals.

It is fairly pointless here, because the value of C in your calling program, if you had got the rest right, would not change.

It may just be a typo, but you can't CALL a program from inside itself, for that program anyway.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: I am Getting the soc7 abend while i executing this progr

Postby Robert Sample » Sat Apr 21, 2012 6:20 pm

The S0C7 is not unexpected considering how badly you've messed up your code. I would also not be surprised to see other abends, such as S0C4, in your code.

You need to find out how to use BY VALUE -- both in the CALLING program and in the CALLED program -- before attempting to use it. Hint: you do not have it coded correctly in your posted code.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: I am Getting the soc7 abend while i executing this progr

Postby muthu455 » Mon Apr 23, 2012 11:54 am

please correct my errors.... and please give the correct code....... i am very new to mainframe......
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: I am Getting the soc7 abend while i executing this progr

Postby BillyBoyo » Mon Apr 23, 2012 12:03 pm

How can we do that if we don't know what the program is supposed to do?

How do you learn if we just "correct" your program?

Read through what people have said. When you compile your programs, take close account of the "diagnostic messages" at the end of the compile listing.

If you don't know what "BY VALUE" is doing, find out. If you then find you should be using something else, find out about that.

If you have more problems after that, post your actual code, not re-typed, in the Code takes to preserve spacing, and say what happened, with any messages/output, and what you expected to happen.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: I am Getting the soc7 abend while i executing this progr

Postby muthu455 » Mon Apr 23, 2012 1:05 pm

i need a example program for call by value.....
i have used this program for call by value
this is my main program
IDENTIFICATION DIVISION.
PROGRAM-ID. MAINPR.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 99 VALUE 30.
77 B PIC 99 VALUE 40.
77 C PIC 99 VALUE 10.
PROCEDURE DIVISION.
START-PARA.
CALL "MAINPR" USING BY VALUE 30 ,40, 10. [(here i used the reference like ) call 'mainp' using by a b c that the program was working] i can't using the call by values .
DISPLAY C.
STOP RUN.
here i am passing the values 30, 40,10
and my subprogram is
IDENTIFICATION DIVISION.
PROGRAM-ID. MAINPR1.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
77 D PIC 99 VALUE.
77 E PIC 99 VALUE.
77 F PIC 99 VALUE.
PROCEDURE DIVISION USING D E F.
START-PARA.
COMPUTE F = D + E.
EXIT PROGRAM.
i'm passing the values from mainprogram through subprogram...
when ever i am using call by value that time i'm getting the soc7 abend
i am not very good in English... if any mistake please forgive me........
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: I am Getting the soc7 abend while i executing this progr

Postby BillyBoyo » Mon Apr 23, 2012 1:15 pm

You are doing OK with the English.

If you have an exercise which requires "BY VALUE" for the call, then you just have to use it properly. Look at what people have said, look at the manuals. As a hint, your called program does not know that this is a call by value.

The strange part of your requirement is that C should not change in the main program and that it should be pointless to change F in your called program. Perhaps this is to demonstrate to you the difference with call by value?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: I am Getting the soc7 abend while i executing this progr

Postby muthu455 » Mon Apr 23, 2012 1:51 pm

im not clear about what u saying..can u just show me the exact coding for this by editing my program.so that it will be helpfull to understand better.thanks.
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: I am Getting the soc7 abend while i executing this progr

Postby BillyBoyo » Mon Apr 23, 2012 1:58 pm

No. You are supposed to be learning from this, not just getting a program from "somewhere".

Do you have Enterprise Cobol manuals? If not, they are available on the web.

You need BY VALUE on the PROCEDURE DIVISION USING, it has to match with the specification of BY VALUE on the CALL USING. You have VALUE statements in your Linkage section. The way you have them they will cause a compile error. If you give them values, the value will be ignored by the compiler with a diagnostic message.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: I am Getting the soc7 abend while i executing this progr

Postby Robert Sample » Mon Apr 23, 2012 2:27 pm

please correct my errors.... and please give the correct code....... i am very new to mainframe......
This is a HELP forum, not a DO-YOUR-HOMEWORK-FOR-YOU forum. You have been given the absolute best advice possible for you -- read the Enterprise COBOL manuals. Since you seem to have problems with performing even the simplest tasks asked of you, here is a link to those manuals: http://www-01.ibm.com/software/awdtools/cobol/zos/library/ and you need to use this link and start reading.

Since you are not listening to what you are being told, and we are not able to help you unless you actively start to do something yourself, this topic is locked.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post