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 GOTO

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Vinay Pushpala

New User


Joined: 06 Nov 2013
Posts: 21
Location: India

PostPosted: Wed Mar 19, 2014 5:20 pm    Post subject: Problem with GOTO
Reply with quote

Hi all,

I am using GOTO in my program..
The program has only one error & that is with the GOTO.
The code looks like this.

Code:
IF FLAG_READ_NEXT = 2             
THEN DO;                         
     GOTO NEXT_SAL;               
END; /* END OF 'IF' OF FLAG = 2 */


Error message of the GOTO:

IDENTIFIER 'NEXT_IMS' AFTER 'GOTO' IS NOT A LABEL KNOWN IN THE CURRENT BLOCK. STATEMENT IGNORED

The GOTO is written in one PROC and LABEL of GOTO is in another PROC of the same program.

NEXT_SAL:
READ FILE (SAMPLE) INTO (SAMPLE_REC);

The proc ends after the read statement.
The label is not present in any "IF CONDITIONS, DO LOOPS, SELECT ".

I am unable to fix this error.
Any help on this issue would be appreciated.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Wed Mar 19, 2014 5:34 pm    Post subject: Reply to: Problem with GOTO
Reply with quote

The error message says NEXT_IMS, so you are showing/looking-at the wrong code anyway.
Back to top
View user's profile Send private message
Vinay Pushpala

New User


Joined: 06 Nov 2013
Posts: 21
Location: India

PostPosted: Wed Mar 19, 2014 5:35 pm    Post subject:
Reply with quote

Sorry for the mistake Woodger..
that was a typo..
It should be NEXT_SAL
Back to top
View user's profile Send private message
Vinay Pushpala

New User


Joined: 06 Nov 2013
Posts: 21
Location: India

PostPosted: Wed Mar 19, 2014 5:43 pm    Post subject:
Reply with quote

Got it..
The GOTO was in a two level procedure..
It was the problem..
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Wed Mar 19, 2014 5:55 pm    Post subject: Reply to: Problem with GOTO
Reply with quote

Your problem is using GOTO - it should only ever be used in the ON ERROR block. Every other use is bad design.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Mar 19, 2014 10:35 pm    Post subject: Reply to: Problem with GOTO
Reply with quote

I agree with Nic. PL/I is a marvelous HLL (eclipses COBOL) and should only require the use of GOTO's (as he has said) in ON ERROR blocks.

When I was coding PL/I (some 30 years ago), we were forbidden to use GOTO's and rightly so, except for exiting E15 and E35 PL/I Sort Exits. These are akin to a COBOL SORT INPUT PROCEDURE (E15) and OUTPUT PROCEDURE (E35).

HTH....
Back to top
View user's profile Send private message
Vinay Pushpala

New User


Joined: 06 Nov 2013
Posts: 21
Location: India

PostPosted: Thu Apr 10, 2014 4:32 pm    Post subject:
Reply with quote

Sorry for the late reply Nic. (you are right abt the problem)
But thanks for the corrections on GOTO.
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm
No new posts TXT2PDF problem - printing @ in PDF vipul65 All Other Mainframe Topics 9 Thu Aug 25, 2016 12:48 am


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