Some FUN with GO TO
Posted: Wed Oct 06, 2010 3:27 pm
Guys,
I want to understand the flow using GO TO. Can u guys tell me what will the displays in order for the below code .
I want to understand the flow using GO TO. Can u guys tell me what will the displays in order for the below code .
PROCEDURE DIVISION
PERFORM A1.
PERFORM B1.
STOP RUN.
A1 SECTION.
DISPLAY 'A1 SECTION'.
A11.
DISPLAY 'A11 PARA'.
A12.
DISPLAY 'A12 PARA'.
A13.
DISPLAY 'A13 PARA '.
EXIT.
B1 SECTION.
B11.
DISPLAY 'B11 PARA'.
B12.
DISPLAY'B12 PARA'.
GO TO A12.
B13.
DISPLAY 'B13 PARA'.
EXIT.
PERFORM A1.
PERFORM B1.
STOP RUN.
A1 SECTION.
DISPLAY 'A1 SECTION'.
A11.
DISPLAY 'A11 PARA'.
A12.
DISPLAY 'A12 PARA'.
A13.
DISPLAY 'A13 PARA '.
EXIT.
B1 SECTION.
B11.
DISPLAY 'B11 PARA'.
B12.
DISPLAY'B12 PARA'.
GO TO A12.
B13.
DISPLAY 'B13 PARA'.
EXIT.