Can we use goto statement in inline_perform ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / shan
The example used by Sivakumar is perfect,
Perform is used for looping, so it should have a exit
condition. simply perform and end perform wont make wright
syntax.
another kind of perform is
PERFORM <paragraph name> until < conditions>
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / chaitanya
could u please clarify d perform which was specified
PERFORM VARYING A1 FROM 1 BY 1 UNTIL A1 > 4
is inline perform??
I think the format of inline perform is...
perform
...
....
,,,
end perform.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / rajesh
In-line PERFORMs work as long as there are no internal GO
TOs, not even to an exit.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sroul4
The format of inline perform is...
perform
...
....
Go TO para2
display' inline perform'
end perform.
Para2
you can put a GO TO but the control would pass to the go to
label , and it would not display inline perform.
| Is This Answer Correct ? | 2 Yes | 0 No |
which is better comp or comp-3 in terms of memory utilization?
How to print 10 to 1 if the input have only 10 digit number?
HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS WHAT ARE THE VALUES WE CAN SEE IN HIGHVALUES AND LOWVALUES, CAN U PLEASE GIVE ME THE ANSWER
How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
how to crack cts interview apps? NOVEMBER 21 2010
Explain complete concept of table handling in COBOL with an example?
what is the difference between start and startbr?
What is 66 level number and where it is used in real time by software developers?
2 Answers ITC Indian Tobacco Company, TCS,
How do we get current date from system with century in COBOL?
.How to add one input & one Out file in existing cobol program. how approach tell me step by step.
What is the default value(s) for an initialize and what keyword allows for an override of the default?
should I use Go back in the main program ? Yes we can use Go back in main program as well.