View previous topic :: View next topic
|
Author |
Message |
Vinay Pushpala
New User
Joined: 06 Nov 2013 Posts: 21 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The error message says NEXT_IMS, so you are showing/looking-at the wrong code anyway. |
|
Back to top |
|
|
Vinay Pushpala
New User
Joined: 06 Nov 2013 Posts: 21 Location: India
|
|
|
|
Sorry for the mistake Woodger..
that was a typo..
It should be NEXT_SAL |
|
Back to top |
|
|
Vinay Pushpala
New User
Joined: 06 Nov 2013 Posts: 21 Location: India
|
|
|
|
Got it..
The GOTO was in a two level procedure..
It was the problem.. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Vinay Pushpala
New User
Joined: 06 Nov 2013 Posts: 21 Location: India
|
|
|
|
Sorry for the late reply Nic. (you are right abt the problem)
But thanks for the corrections on GOTO. |
|
Back to top |
|
|
|