COBOL Interview Questions
Questions Answers Views Company eMail

which of the following can be used as a check protection symbol a.Z b.S c.* d.+

TCS,

2 7455

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

TCS,

5 7826

study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level

TCS,

4 6591

study the following 01 A PIC 99V0 VALUE 5 01 B PIC 9V9 VALUE 6 01 C PIC 99V9 VALUE 2.5 01 D PIC 99 VALUE 3 COMPUTE A ROUNDED B C = A+B*C/D ON SIZE ERROR PERFORM PRINT-ERROR the comments of A.B.C after execution of the above statement are a.A=10 B=0 C=10 b.A=10 B=9.9 C=9.9 c.A=10 B=0 C=9.9 d.A=10 B=6 C=10

TCS,

4 7742

how many times PARA-A is performed : PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1 UNTIL TIMES-COUNTER >0 PARA-A MOVE P TO Q MOVE H TO TIMES COUNTER a.10 b.1 c.11 d.0

TCS,

4 8907

consider the following piece of code 01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

TCS,

10 12624

consider the following progrm statements MOVE 0 TO SW.NO.OF.REC PERFORM PRI-OUT UNTIL SW=1 DISPALY NO.OF.REC STOP RUN PRE-OUT READ IN-FILE AT END MOVE 1 TO SW WRITE OUO-REC FROM IN-REC ADD 1 TO NO.OF REC if the IN-FILE contains 1000 records what value will be displayedafter the PERFORM is over?assume that N0.OF.REC has PIC 9(4) a.1000 b.1001 c.1 d.none of the above since there is a syntex error

TCS,

4 6029

study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid

TCS,

4 5480

C1 C2 C3 are three conditions whose TRUTH values are as folloes. C1-TRUE C2-FALSE C3-TRUE A,B,C are defined as given below A:C1 AND(NOT C2) OR C3 B.(NOT C1) OR (NOT C2 AND NOT C3) C.(C1 OR C2)AND C3 D.C1 AND C2 OR C3 given the above information which of the following statements are valid? a.only A,B and C are TRUE b.only A,C and D are TRUE c.A,B,C and D are TRUE d.only C and D are TRUE

TCS,

1 4393

consider the following FD FILE-1 01 REC-1 PIC X(80) ...... WORKING-STORAGE SECTION 01 W-REC PIC X(90) ........ PROCEDURE DIVISION FIRST-PARA ....... READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG which of the following is true with respect to the above? a.REC-1 will contain nothing and W-REC will contain the contains of the record read b.REC-1 and W-REC contain the same data c.syntex is invalid and error will occur d.REC-1 and W-REC must be of same size

TCS,

1 5131

PERFORM ACCUMULATE-TOTALS VARYING A FROM 1 BY 2 UNTIL A >2 AFTER B FROM1 BY 1 UNTIL B>2 AFTER C FROM 2 BY -1 UNTIL C<2 How many times the paragraph ACCUMULATE-TOTALS would be exicuted?

TCS,

5 9774

there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it

TCS,

3 7470

consider the following PROCEDURE DIVISION entry OPEN EXTEND IN-FILE identify the correct statement a.organization of IN-FILE is sequential and records can be added in the beginning b.organization of IN-FILE is sequential and records can be added in the end c.organization of IN-FILE is indexed and records can be added in the beginning d.organization of IN-FILE is indexed and records can be added in the end

TCS,

3 6153

what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99

TCS,

2 6346

consider the following two IF statements: IF X AND NOT Y MOVE A TO B IF Z=1 OR 9 MOVE A TO B select one of the following data divusion entries which gives identical results for both the above IF statements a.01 Z PIC 9 88 X VALUE 1.9 88 Y VALUE 0.2 THRU 8 b.01 Z PIC 9 88 X VALUE 0.2 THRU 8 Y VALUE 1.9 c.01 Z PIC 9 88 X VALUE 1.9 88 NOT-Y VALUE 0.2 THRU 1.9 d.none of yhe above

TCS,

3 5538


Post New COBOL Questions

Un-Answered Questions { COBOL }

I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10527


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

809


Mention the guidelines to write a structured cobol program?

601


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1219


What are literals?

620






Explain about different table spaces.

638


What are the different rules for performing sort operation?

749


Write the code implementing the perform … varying.

635


How do we get current date from system with century in COBOL?

790


How to remove 2 duplicate records and copy only one using job control language?

724


How arrays can be defined in COBOL?

653


How to know whether the module is dynamical or statistical?

646


how can i see junk values in dclgen or in hostvariable of comp ?

2532


What is the difference between comp and comp-3 usage?

669


Can we change the password using ALTER? anyone tried and changed?

1533