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 |
how can we get current dat and time thru cobol pgm
how to move the records from file to array table. give with code example
How To move a value to an array using move verb?
What is the Importance of GLOBAL clause According to new standards of COBOL?
How can I tell if a module is being called DYNAMICALLY or STATICALLY?
In COBOL "BEFORE" advancing is there or not ?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Mention the guidelines to write a structured cobol program?
input:- 12233344445555566666... output:- 1=1,2=4,3=9... Here firstno i.e 1 should be displayed and after that the alikeno.s should be added n displayed.i.e 2+2=4 like tat it goeson.
01 a pic s9(5) value '-12345' how it will be stored
How do you set a return code to the JCL from a COBOL program?
How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?