Page 1 of 1

I am Getting the soc7 abend while i executing this program

PostPosted: Sat Apr 21, 2012 3:32 pm
by muthu455
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.....

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

PostPosted: Sat Apr 21, 2012 3:48 pm
by BillyBoyo
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.

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

PostPosted: Sat Apr 21, 2012 6:20 pm
by Robert Sample
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.

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

PostPosted: Mon Apr 23, 2012 11:54 am
by muthu455
please correct my errors.... and please give the correct code....... i am very new to mainframe......

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

PostPosted: Mon Apr 23, 2012 12:03 pm
by BillyBoyo
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.

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

PostPosted: Mon Apr 23, 2012 1:05 pm
by muthu455
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........

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

PostPosted: Mon Apr 23, 2012 1:15 pm
by BillyBoyo
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?

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

PostPosted: Mon Apr 23, 2012 1:51 pm
by muthu455
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.

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

PostPosted: Mon Apr 23, 2012 1:58 pm
by BillyBoyo
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.

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

PostPosted: Mon Apr 23, 2012 2:27 pm
by Robert Sample
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.