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 |
what is rediffine clause?in what situation it can use?give me real time example?
how many subpgms we can use in a main pgm ? how do u link sub pgm to main pgm ? how can i use the parameters declared in main pgm to sub pgm ?
Hi Guys, I have faced one interview question if I have requirement to add 5 new columns to existing table what are prerequisite do i need to take.
how would find total records in files using seqientional
what is the difference between occurs and occurs depending on? i dont think so there is the difference in storage..then why we should use occurs depending on?
What is the meaning of 'TALLING' verb in cobol?
a. Can the OPTIONAL clause in COBOL only be coded for input files? b. If it is coded for files opened in OUTPUT, I-O or EXTEND mode, will it give a compilation error? c. If there are no compilation errors and if such files are not coded in the JCL, will the OPEN statement run fine when these files are opened? d. How will a WRITE statement work for the above files?
If there are two copybooks which have same variables and we are using both the copybooks in our program. will there be an error and if i move values to the variable which copybook varibales gets the values i move in.
what is soc7 abend?how u can trace it?
how to display comp3 variables reply soon ?
01 x pic s9(8) comp. How will the following value be internally allocated '18787'
i need a program by giving input as a abcd in any randem order but i need a output as 1234 related to abcd. i.e,. a for 1,b=2,c.....etc..