Can we use goto statement in inline_perform ?

Answers were Sorted based on User's Feedback



Can we use goto statement in inline_perform ?..

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

Can we use goto statement in inline_perform ?..

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

Can we use goto statement in inline_perform ?..

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

Can we use goto statement in inline_perform ?..

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

Can we use goto statement in inline_perform ?..

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

Post New Answer

More COBOL Interview Questions

Write down the divisions of cobol program?

0 Answers  


What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. 05 MM PIC 99. 05 YY PIC 99. (a) Nothing is wrong. (b) Under W-DATE all level 05 items are having a PIC 99 but level 01 has PIC X(6). (c) PIC can't be specified for a group item. (d) DD, MM, and YY are invalid datanames.

6 Answers   Mphasis, TCS,


Can we put move statement in COBOL copybook

3 Answers   Global Logic,


if you give cylinder(1,1)how many cylinders it will be allocate?

3 Answers   Hewitt,


Explain about different table spaces.

0 Answers  






what is SYNCHRONIZATION?

3 Answers   Syntel,


I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?

1 Answers  


I hav vari declaration like..... 77 a pic s9(9).99. 77 b pic s9(9).99 comp. 77 c pic s9(9).99 comp-3. if i use MOVE 123456789.99 to a,b,c what happen every one working fine ?

1 Answers   Mphasis,


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

0 Answers  


how to transfer the file from pc to mainframe??

4 Answers  


Program A calls program B. Will the working storage variables declared in program B be initialized every time it is called by program A or will the values be retained until the end of program A?

7 Answers  


hi friends,can any one post the ibm mainframe inteqview questions for 1year exp candidate,for itc infotech interview?. have any body attended for this in the past?...

1 Answers   ITC Infotech,


Categories