Can we use goto statement in inline_perform ?

Answer Posted / sivakumar sekharannair

Yes go to can be used in inline perform. when GO TO is used
in inline perform then irrespective of the number of times
the perform has to execute.. the control will go to GO TO.
example:
PERFORM VARYING A1 FROM 1 BY 1 UNTIL A1 > 4
DISPLAY 'SIVAKUMAR'
GO TO DISPLAY-PARA
END-PERFORM.

DISPLAY-PARA
DISPLAY 'KUMAR'.

SYSOUT:
SIVAKUMAR
KUMAR

Instead of
SIVAKUMAR
SIVAKUMAR
SIVAKUMAR
SIVAKUMAR


Actually the perform has to execute 4 times and so the
display should be executed 4 times. but because GO TO is
given inside the inline perform the control goes to display-
para and and dose not come back.

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Have you used comp and comp-3 in your project? And how?

2003


What is the difference between comp and comp-3 usage?

670


How do define dynamic array in cobol.

665


What is difference between static and dynamic call in cobol?

768


Difference between array and sub-script ?

1157






What is the default value(s) for an initialize? What keyword will allow for an override of the default?

650


How can you get the ksds file records into your cobol program?

637


) How do u handle errors in BMS macro

1500


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

679


Write a program to explain size error.

667


how do you reference the printer file formats from cobol programs

649


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17024


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1833


What are the access modes of START statement?

714


Which is not true about evaluate statement

1564