Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
View previous topic :: :: View next topic  
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

acevedo

Active User


Joined: 11 May 2005
Posts: 344
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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: 216
Location: India

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

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: 205
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us