Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Problem with NEXT SENTENCE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
Author Message
Thilaga

New User


Joined: 29 Feb 2008
Posts: 5
Location: Chennai

PostPosted: Thu Mar 06, 2008 1:01 pm    Post subject: Problem with NEXT SENTENCE
Reply with quote

Hi,

i got an error message "IGYPS2059-E The "NEXT SENTENCE" phrase was invalid in this context. The phrase was discarded."

My code goes like:
IF IT-SUBLINE-1-3 = '999'
---
NEXT SENTENCE
ELSE
---
---
END-IF

So, i just got a doubt can we use NEXT SENTENCE with some other statements in the IF or ELSE part? or whether it should be the only statement in the block? Please help me..
Back to top
View user's profile Send private message
References
acevedo

Senior Member


Joined: 11 May 2005
Posts: 315
Location: Spain

PostPosted: Thu Mar 06, 2008 1:37 pm    Post subject:
Reply with quote

see this topic
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2233
Location: Mumbai, India

PostPosted: Thu Mar 06, 2008 1:44 pm    Post subject:
Reply with quote

Hi,

Respecify and/or remove the indicated NEXT SENTENCE phrase in the indicated statement so that, if used at all, it is used only in the context of IF .
Back to top
View user's profile Send private message
Thilaga

New User


Joined: 29 Feb 2008
Posts: 5
Location: Chennai

PostPosted: Thu Mar 06, 2008 2:40 pm    Post subject: Reply to: Problem with NEXT SENTENCE
Reply with quote

Hi Anuj,
"if used at all, it is used only in the context of IF ."

im not getting this point. here i used in the context of IF only right?

so, do u mean that NEXT SENTENCE should be the only statement in the IF or ELSE block?
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

PostPosted: Thu Mar 06, 2008 4:26 pm    Post subject: Re: Problem with NEXT SENTENCE
Reply with quote

[quote="Thilaga"]Hi,

i got an error message "IGYPS2059-E The "NEXT SENTENCE" phrase was invalid in this context. The phrase was discarded."

quote]

Can u copy and paste some more code after the End-if
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1641
Location: germany

PostPosted: Thu Mar 06, 2008 5:25 pm    Post subject:
Reply with quote

Code:

IF IT-SUBLINE-1-3 = '999'
---                                      <<<<<<<what is this?
NEXT SENTENCE
ELSE
---
---
END-IF



if you have code between the if and the next sentence, that is your problem. remove the next sentence.

next sentence and continue should be the only code within an execution block.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 125
Location: Bangalore

PostPosted: Thu Mar 06, 2008 6:28 pm    Post subject: Reply to: Problem with NEXT SENTENCE
Reply with quote

IF IT-SUBLINE-1-3 = '999'
Quote:
--- <<<<<<<what is this?
NEXT SENTENCE
ELSE
---
---
END-IF


Just a guess, are you executing a calculation statement between IF and ELSE . Something like:
A = b*c

In such case, the Verb COMPUTE is missing.


Check if any cobol VERB is missing before NEXT SENTENCE and after IF.

Thanks,
Ajay
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2233
Location: Mumbai, India

PostPosted: Fri Mar 07, 2008 5:40 am    Post subject: Re: Reply to: Problem with NEXT SENTENCE
Reply with quote

Thilaga wrote:
i m not getting this point. here i used in the context of IF only right?

so, do u mean that NEXT SENTENCE should be the only statement in the IF or ELSE block?
Hi Thilaga,

Dick has already answered Your concern..
Quote:
if you have code between the if and the next sentence, that is your problem. remove the next sentence.
Thanks Dick.. icon_smile.gif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1