| Other COBOL Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Can we use goto statement in inline_perform ? | IBM | 2 |
| What is different between variable length and fixed length? | | 2 |
| How do we get current date from system with century? | | 2 |
| I have PS flat file with 14 records. I want to read from
4th to 9th record and want to write those 6 records (4th
record to 9th record) to another PS file (output file).
there is no key defined in the input file. I just want read
a certain Consecutive records. can any one please give me
the procedure division Coding for this. I have coded the
below coding but the READ-PARA is performing only 1 time
even though I have 14 records in my input file (i.e FILE-1):
PROCEDURE DIVISION.
A000-SECTION.
MOVE 0 TO I.
OPEN INPUT FILE-1.
IF CHECK-KEY1 > 0
DISPLAY "OPEN ERROR FOR FILE-1, CODE IS:" CHECK-KEY1
END-IF.
OPEN EXTEND NEWFILE-1
IF CHECK-KEY3 > 0
DISPLAY "OPEN ERROR FOR NEWFILE-1 COD IS" CHECK-KEY3
END-IF.
PERFORM READ-PARA THRU EXIT-PARA UNTIL EOF-REC = 'YES'.
DISPLAY " FINALLY OUT OF LOOP"
CLOSE FILE-1
CLOSE NEWFILE-1
STOP RUN.
READ-PARA.
ADD 1 TO I
READ FILE-1
AT END MOVE 'YES' TO EOF-REC
IF I > 3 AND < 10
PERFORM WRITE-PARA
ELSE
DISPLAY "NOT IN RANGE"
END-IF.
EXIT-PARA.
EXIT.
WRITE-PARA.
WRITE NEW-REC FROM FILE1-REC.
| IBM | 5 |
| In a COBOL II PERFORM statement, when is the conditional
tested, before or after the perform execution? | | 3 |
| What is the output generated by the following code?
01 GRP-I.
05 SUBFLD1 PIC XX VALUE "AB".
05 FILTER PIC X(6) VALUE SPACES.
01 GRP-2 REDEFINED GRP-1.
05 SUB-FLD2 PIC XX.
05 SUB-FLD3 PIC XX.
05 FILTER PIC X(4).
IF SUB-FLD1 NOT = SPACES
DISPLAY "SUBFLD1"
MOVE "ABBCCD" TO GRP-1
IF SUB-FLD3 = SPACES
DISPLAY "SPACES"
ELSE
DISPLAY "SUBFLD3"
DISPLAY "END"
ELSE
DISPLAY "SPACES"
DISPLAY "END".
(a) SUBFLD1
SUBFLD3
END
(b) SPACES
END
(c) SUBFLD1
END
(d) SUBFLD1
SPACES
| TCS | 5 |
| What is the meaning of 'Eject' verb in cobol?
| Wipro | 2 |
| How does IDMS communicate with CICS? | Satyam | 1 |
| What are different file OPEN modes available in COBOL? | Sun-Life | 2 |
| A paragraph PARA-X is to be executed when none of the data names
A, B and C have value of 1. Which of the following will
achieve this ?
(a) IF A NOT = 1 OR B NOT = 1 OR C NOT = 1 PERFORM PARA-X
(B) IF NOT A= 1 AND B= 1 AND C = 1 PERFORM PARA-X
(C) IF A NOT =1 IF NOT B = 1 OR C= 1 PERFORM PARA-X
(C) IF A NOT = 1 AND B NOT = 1 AND C NOT = 1 PERFORM PARA-X
| TCS | 3 |
| Explain about Redefines cluse? | | 3 |
| What care has to be taken to force program to execute above
16 Meg line? | | 1 |
| What is the point of the REPLACING option of a copy
statement? | | 3 |
| How do you do in-line PERFORM? | | 2 |
| How to find How Many Lines in Sysin DD * Parameter Thru
Cobol Coding?
If any one knows the Answer Please Reply .....Thanks From
Shree | Merrill-Lynch | 1 |
| Describe the difference between subscripting and indexing ? | | 2 |
| Can JUSTIFIED be used for all the data types? | | 1 |
| consider the following piece of code
01 GROSS-PAY
05 BASIC-PAY PIC 9(5)
05 ALLOWENCES PIC 9(3)
if BASIC-PAY has a value 1000 and ALLOWENCES has a value
of 250,what will be
displayed by the statement
DISPLAY GROSS-PAY
a.1250
b.01000250
c.01250
d.1.250
| TCS | 3 |
| How many bytes will be allocated for the following record
description
entries?
01 REC-A.
05 A PIC S9(4).
05 B PIC XXXBXXX.
05 C PIC ____9.99.
05 D PIC S9(5) COMP-3.
05 E PIC 9(3) COMP.
| TCS | 10 |
| What are subroutines ? and how do we pass data to the sub
routines? | Xansa | 2 |
| |
| For more COBOL Interview Questions Click Here |