View previous topic :: View next topic
|
Author |
Message |
Thilaga
New User
Joined: 29 Feb 2008 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Thilaga
New User
Joined: 29 Feb 2008 Posts: 5 Location: Chennai
|
|
|
|
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 |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
[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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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.. |
|
Back to top |
|
|
|