COBOL Snippet: Tell where the control will when the below
code execute
IF (A=B)
CONTINUE
ELSE
NEXT SENTENCE
PERFORM <IMP-STMT>
END-IF.
Answers were Sorted based on User's Feedback
Answer / lu
First of all, when you code , you have to know what do you
want to do....
Perform after next sentence doesn't make sense ..it never
executes....
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / manj
CONTINUE inside IF loop searches for the first terminator
END-IF and comes out.
NEXT SENTENCE searches for the first FULL STOP and goes to
the next line after that.
The above code does nothing. IF A=B, control comes to the
next line after END-IF and same for ELSE part too.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / hitesh karnani
First of all, when you code , you have to know what do you
want to do....
Perform after next sentence doesn't make sense ..it never
executes....
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / meg
Lu is very correct no body code like
NEXT SENTENCE
PERFORM <IMP-STMT>
this
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / chandrababu naidu
if both values A and B values are equal, then control go to
'perform' statement, if both values A and B values are not
equal then control come out of if condition.
Is This Answer Correct ? | 3 Yes | 5 No |
Answer / niveditha
This code looks funny.but still some times it is useful. If
A=B the control will be start immediately from after end-if.
If A not = B then perform loop will executes. there is no
meaning of next sentence
Is This Answer Correct ? | 1 Yes | 8 No |
subscript and index r not coded in u r application program what will happen?
When and how can we use index & subscript ?
What is COMP SYNC?
How to open and see copy book ?
diffrence between renames and redifnes with examples
Can printer files (having 133 characters) be of variable length?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
How to remove 2 duplicate records and copy only one using job control language?
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?
Can we move X(9) to 9(9). If yes what are the ways for doing this?
How do you reference the fixed block file formats from cobol programs
If a sub program is called from mainprogram.I have opened cursor in main program and Fetch the result in subprogram ,Is it possible ?If yes please tell me the reason.