IGYOP3093-W warning means what?



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

IGYOP3093-W warning means what?

Postby chenky » Thu Dec 06, 2012 11:20 am

I am getting the warning

IGYOP3093-W THE "PERFORM" STATEMENT AT "PERFORM (LINE 228.01)" CANNOT REACH ITS EXIT.

Could any one please help what this warning is about..from the warning i was able to conclude that Peform is unable to reach its closing..
chenky
 
Posts: 16
Joined: Tue Nov 20, 2012 4:59 pm
Has thanked: 7 times
Been thanked: 0 time

Re: IGYOP3093-W warning means what?

Postby BillyBoyo » Thu Dec 06, 2012 1:12 pm

Correct in your conclusion, and it probably means you have managed an endless loop. Can you post the code, in the Code tags, please?

These users thanked the author BillyBoyo for the post:
chenky (Thu Dec 06, 2012 3:15 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: IGYOP3093-W warning means what?

Postby chenky » Thu Dec 06, 2012 3:14 pm

MOVE PARM-VALUE TO WS-IND.               
IF WS-IND NOT EQUAL 'E' AND               
   WS-IND NOT EQUAL 'D' THEN             
   DISPLAY 'WSIND :' WS-IND     
   DISPLAY 'VALUE SHOULD BE ANY ONE OF THE '
           'FOLLOWING ONLY: '                     
   DISPLAY 'E'                           
   DISPLAY 'D'                           
   DISPLAY 'N'   
   PERFORM P9999-ABEND                           
      THRU P9999-ABEND-X                         
GOBACK                                           
END-IF.                           

P9999-ABEND.                             
      INITIALIZE RPT-LINE.               
      MOVE 4 TO RETURN-CODE.             
      MOVE 'JOB FAILED!' TO RPT-LINE.
      DISPLAY RPT-LINE.                   
                                         
P9999-ABEND-X.                           
      STOP RUN.


Hi Billy Boyo above is the part of code where I am getting the warning.
chenky
 
Posts: 16
Joined: Tue Nov 20, 2012 4:59 pm
Has thanked: 7 times
Been thanked: 0 time

Re: IGYOP3093-W warning means what?

Postby BillyBoyo » Thu Dec 06, 2012 3:25 pm

Well, you don't have a loop, but since you've coded "STOP RUN" in the second paragraph of your PERFORM ... THRU then the compiler has noticed you will never be able to return from the PERFORM.

Some comments and tips:

Use 88-level Condition Names in place of your test for literal values. You give the 88 a meaningful name, and the code is much clearer.

You list the valid options, but your test does not allow for all of them.

Don't have both GOBACK and STOP RUN. Better to just use GOBACK.

No need to use full-stops/periods in the Procedure Division except to end paragraph/section/program and after the PROCEDURE DIVISION itself.

Use meaningful names. You say "ABEND" when this is not caused.

Don't INITIALIZE things unnecessarily. RPT-LINE is not used before it is the target of a MOVE, so it's value at the start of the MOVE is irrelevant.

Use a data-name for your literal 4, again allowing you to describe what the four means.

Can you show the definition of PARM-VALUE, including the group it is part of, please.

These users thanked the author BillyBoyo for the post:
chenky (Thu Dec 06, 2012 3:43 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: IGYOP3093-W warning means what?

Postby c62ap90 » Thu Dec 06, 2012 6:26 pm

The P9999-ABEND PERFORM " CANNOT REACH ITS EXIT " because you do not have an "EXIT." Statement.
Change "STOP RUN." to "EXIT."
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: IGYOP3093-W warning means what?

Postby BillyBoyo » Thu Dec 06, 2012 6:42 pm

c62ap90 wrote:The P9999-ABEND PERFORM " CANNOT REACH ITS EXIT " because you do not have an "EXIT." Statement.
Change "STOP RUN." to "EXIT."


Nope, this is wrong. A PERFORM will (should, except in cases like these) exit whether or not an EXIT statement is present.

An EXIT statement does nothing itself. As it does nothing, it can be included or omitted as per local standards or choice. As it does nothing, anything coded after it gets executed.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: IGYOP3093-W warning means what?

Postby c62ap90 » Thu Dec 06, 2012 7:07 pm

Before I posted I tried it out; changing the "STOP RUN." to "EXIT." will take care of the IGYOP3093-W warning in the original post.
Thanks.

BillyBoyo wrote:
c62ap90 wrote:The P9999-ABEND PERFORM " CANNOT REACH ITS EXIT " because you do not have an "EXIT." Statement.
Change "STOP RUN." to "EXIT."


Nope, this is wrong. A PERFORM will (should, except in cases like these) exit whether or not an EXIT statement is present.

An EXIT statement does nothing itself. As it does nothing, it can be included or omitted as per local standards or choice. As it does nothing, anything coded after it gets executed.
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: IGYOP3093-W warning means what?

Postby Robert Sample » Thu Dec 06, 2012 7:21 pm

c62ap90, there is a subtle point I think you've missed. Try just removing the
STOP RUN.
statement totally. You will find the program compiles and executes just fine. The error message went away, not because you changed STOP RUN to EXIT, but because you removed the STOP RUN statement. The error message is indicating that the STOP RUN will keep the PERFORM THRU from completing the PERFORM (because the program stops running). Stating, as you did, that the program needs an EXIT in the exit paragraph is misunderstanding how COBOL works and is wrong.
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: IGYOP3093-W warning means what?

Postby c62ap90 » Thu Dec 06, 2012 8:25 pm

Yes, taking the STOP RUN out will eliminate the warning message. I did not miss your subtle point Robert and I did not say the program "needs an EXIT". I'm speaking of "best practices" (forum for beginners and students) for a PERFORM THRU and I would expect/insist having the EXIT statement. In this example having the STOP RUN was no harm other than getting a warning message and sloppy code; STOP RUN and GOBACK in the same PERFORM.

So, in my opinion, code the EXIT in your PERFORM THRU statements - it's cleaner knowing the coders intent, no compile warnings, no possibility of executing code at the end of your THRU paragraph (P9999-ABEND-X), and best practice for all levels of COBOL developers.
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: IGYOP3093-W warning means what?

Postby Robert Sample » Thu Dec 06, 2012 8:57 pm

You said
The P9999-ABEND PERFORM " CANNOT REACH ITS EXIT " because you do not have an "EXIT." Statement.
and this is a completely wrong statement. You have missed the concept here -- the error message is NOT because the EXIT is missing (it is not required) but because the STOP RUN inteferes with the PERFORM code. Saying "becuase you do not have" is just plain wrong. The EXIT statement has nothing to do with the error. Certainly it is good coding practice to have an EXIT (or CONTINUE) in the exit paragraph -- but it is NOT required to do so.
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

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post