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 |
Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.
I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
When we code these comp,comp1,comp-2,comp-3 and comp4 values. I know the differnece.I mean when we will prefer if it is new program.Explain in detail with memory examples. Thanks in advance.
When would you use in-line perform?
How to find How Many Lines in Sysin DD * Parameter Thru Cobol Coding? If any one knows the Answer Please Reply .....Thanks From Shree
What is the default value of DISP parameter?
In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference
What is an in-line perform ?
What is the problem of ordered sequential files access?
what happens of we dont give time stamp in precompilation process
why we are using set in searchall?
Re: 01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to display the value of NAME1 in reverse order i.e value should be displayed as "GNIMMARGORP LOBOC" HOW can I do that ??? please let me know if any one knows it.