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 |
whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?
Whats the difference between search & search ALL?
what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?
in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?
what is the maximum error code in mainframe
a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?
What is Static and Dynamic linking ?
Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
6 Answers ABC, IBM, Mphasis, Wipro,
suppose a cobol programme A calling programme B,C and D. If C undergoes some change what if A,B,C,D need to be recompiled or only C nee to be recompliled.
what is meant by binary search?
i friends greetings to the day...!!! I face a quation like"while runnig the programe every day i have to access the previous day updates only...!! Ex:- Let last day 100 customers took bank account i have to select those customers only.."