Having problem in Mainprogram Subprogram...



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

Having problem in Mainprogram Subprogram...

Postby muthu455 » Sat Jul 14, 2012 11:41 am

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.......
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Having problem in Mainprogram Subprogram...

Postby BillyBoyo » Sat Jul 14, 2012 2:16 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Having problem in Mainprogram Subprogram...

Postby muthu455 » Sat Jul 14, 2012 2:39 pm

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.
Last edited by muthu455 on Sat Jul 14, 2012 2:40 pm, edited 1 time in total.
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Having problem in Mainprogram Subprogram...

Postby muthu455 » Sat Jul 14, 2012 2:39 pm

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:
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Having problem in Mainprogram Subprogram...

Postby BillyBoyo » Sat Jul 14, 2012 5:30 pm

Have you looked at the compile listing of the program? You have five diagnostic messages somewhere.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Having problem in Mainprogram Subprogram...

Postby Anuj Dhawan » Sat Jul 14, 2012 6:29 pm

"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.
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Having problem in Mainprogram Subprogram...

Postby Robert Sample » Sat Jul 14, 2012 6:39 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Having problem in Mainprogram Subprogram...

Postby Monitor » Sat Jul 14, 2012 8:38 pm

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
. . .
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post