Page 1 of 1

Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 11:41 am
by muthu455
hai i am getting the Maxcc=8 while i'm executing the below programs......
my Mainprogram is
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. MAINP.
000300 ENVIRONMENT DIVISION.
000400 DATA DIVISION.
000500 WORKING-STORAGE SECTION.
000600 77 A PIC 9(2) VALUE 22.
000700 77 B PIC 9(2) VALUE 33.
000800 77 C PIC 9(2).
000900 PROCEDURE DIVISION.
001000 STARTP.
001100 DISPLAY'BEFOR SUBPROGRAM'.
001200 DISPLAY C.
001300 CALL "SUBPRO" USING A B C.
001400 DISPLAY "AFTER SUBPROGRAM CALL".
001500 DISPLAY C.
001600 STOP RUN.


And My Subprogram is like this
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. SUBPRO.
000300 ENVIRONMENT DIVISION.
000400 DATA DIVISION.
000500 LINKAGE SECTION.
000600 77 D PIC 9(2).
000700 77 E PIC 9(2).
000800 77 F PIC 9(2).
000900 PROCEDURE DIVISION USING D E F.
001000 STARTP.
001100 COMPUTE F = E + D.
001200 EXIT PROGRAM.
While i'm compile the main program that time i am getting the maxcc=8 . in spool area i can't see any error messages... some one solve this.......

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 2:16 pm
by BillyBoyo
Does your compile JCL have a linkedit/binder step? Please post the final page of the compile, plus anything which appears after that. In the Code tags, please.

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 2:39 pm
by muthu455
BillyBoyo wrote:Does your compile JCL have a linkedit/binder step? Please post the final page of the compile, plus anything which appears after that. In the Code tags, please.

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 2:39 pm
by muthu455
when i'm compiling i am getting the message
17.04.27 JOB02389 $HASP165 SHRDV08A ENDED AT N1 MAXCC=8 CN(INTERNAL)
***
And
spool Area
this message only there
Messages    Total    Informational    Warning    Error    Severe    Terminating
Printed:       5              2                            3                                     
* Statistics for COBOL program MAINP:

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 5:30 pm
by BillyBoyo
Have you looked at the compile listing of the program? You have five diagnostic messages somewhere.

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 6:29 pm
by Anuj Dhawan
"I've a problem while I log in to my PC, please help! Can anyone?"

Above is kind of posts you are making to us, if you can answer what I'm asking, possibly I, for one, will try to answer your question. Otherwise please start over and post the diagnostic information. MAXCC=8 does not tell us anything.

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 6:39 pm
by Robert Sample
1. You are displaying an unitialized variable C. This is NEVER a good idea. At best you get garbage displayed, at worst your program will ABEND.
2. You are mixing quotes and apostrophes in your DISPLAY statements. This is not a good idea, either. Pick one or the other and stick with it, making sure the compiler option is set correctly for whichever one you choose.
3. You need a space between the DISPLAY and apostrophe in your first DISPLAY statement.
4. You need to learn how to find and read the compiler output, since the diagnostic messages are EXTREMELY important in getting a program to compile.
5. Terminology is critical in IT, where similar terms may mean very different things. The ONLY time you should use the term "MAXCC" as you did in your post is when you are executing IDCAMS and using the MAXCC variable. Other than that, you should be referencing step return codes or condition codes since the term MAXCC has ABSOLUTELY no application in the context you used it.

Re: Having problem in Mainprogram Subprogram...

PostPosted: Sat Jul 14, 2012 8:38 pm
by Monitor
My assumption is that the Link Edit step doesnt run at is should, as you specify
CALL "SUBPRO" USING A B C.

This means Static Call and the called supgrogram has to be included by the Linkage Editor.
If use use Dynamic Call instead, the subprogram is expected to be its own load-module and has not to be included by linkage-editor..
Change the call like this:
Working-Storage Section.
01 Mysubpgm   Pic X(08) Value 'SUBPRO'.
. . .
Procedure Division.
. . .
Call Mysubpgm Using A B C
. . .