IF WS-IO-NUM NOT NUMERIC THEN
MOVE ZERO TO WS-IO-FILE-REQUEST-NUM.
GO TO 210-IO-READ
215-IO-READ-GTEQ
220-IO-READ-UPDATE
225-IO-READ-UPDATE-GTEQ
230-IO-WRITE
240-IO-REWRITE
250-IO-DELETE
260-IO-UNLOCK
270-IO-STARTBR
280-IO-READNEXT
290-IO-READPREV
300-IO-ENDBR
230-IO-WRITE
310-IO-READ-SET
I have code like above in one of the progs..Does this mean - if my "IF" condition is satisfied all the mentioned lables are executed one after another?? Thanks.
Bhairon..thanks..
I too have never seen more than one label in GO TO statement..I am still wondering..if this gives control to only first label why the rest of all are coded..this code is very much in live..i still wonder is there any possiblity that all the labels are executed??
Description
The conditional GO TO statement transfers control to one of a series of procedures, depending on the value of the identifier. The maximum number of procedure-names for a conditional GO TO statement is 255.
Format 2 (Conditional GO TO)
*---------------*
V +
->->---GO-*--*--procedure-name-1*-DEPENDING--*--*-identifier--><-
*TO* *ON*
procedure-name-1
Procedure-name-1 must be a procedure or a section in the same Procedure Division as GO TO.
Identifier
Identifier must be a numeric elementary data item which is an integer.
If 1, control is transferred to the first statement in the procedure named by the first occurrence of procedure-name-1;
If 2, control is transferred to the first statement in the procedure named by the second occurrence of procedure-name-1, and so forth.
If the value of identifier is anything other than a value within the range of 1 through n, (where n is the number of procedure-names specified in this GO TO statement), no control transfer occurs. Instead, control passes to the next statement in the normal sequence in running the
Joined: 28 May 2009 Posts: 8 Location: Oklahoma City, OK USA
I would avoid a "Go TO ... DEPENDING" construct and replace it with an EVALUATE construct. It will be much clearer to the person that comes after you and has to do maintenance.
Always write code for maintenance, and you will make everyone's job easier.