Anda di halaman 1dari 6

Cobol MCQ S (1) Index in Cobol is defined as _______ a) b) c) d) Array occurence Displacement from begining of Array It is sequentially accessible

Not for Random process

(2) Study the following : 01 A PIC 99v0 value 5 01 B PIC 9V9 VALUE 6. 01 C PIC 9 9V9 VALUE 2.8. 01 D PIC 99 VALUE 3. COMPUTE A ROUNDED B C = A + B * C / D a) b) c) d) A=11,B=0.6,c=10.6 A=10,B=0.6,C=10.6 A=11,B=0,C=10 A=10,B=6,C=10

(3) Which of the following statements will not indicate duplicate key warning if it occurs in case of an indexed organisation without DUPLICATES Phrase a) b) c) d) Read Write Rewrite Delete

(4) What will happen if you code GO BACK instead of STOP RUN in a standalone COB OL program i.e. a program which is not calling any other program? a) b) c) d) Shows Error Nothing happened Return to previous step Infinite Loop

(5) In packed decimal number +2431 how would be stored? a) b) c) d) +2431f 02431f 02431 +2431

(6) Just one -------- statement allows several alternative paths of execution a) b) c) d) evaluate if statements perform statement copy statement

(7) Given the following Data Division Entries: 01 T1. 03 N PIC 99. 03 T2. 04 M OCCURS 1 TO 20 DEPENDING ON N. 05 P PIC XX. Indicate which one of the following is incorrect? a) T1 will have variable size.

b) m will have variable no of occurrences c) T2 will have variable size. d) The above description is wrong (8) No. of bytes 01 A PIC 9(6) V 9(3) COMP-3 will take: a) b) c) d) 6 5 7 9

(9) How can you reference an element of a 3 dimensional table? a) b) c) d) 2 indexes Subscripts Search Search-all

(10 ) Identify the Syntax error in the following : 01 B pic A(7). 02 C PIC 9(4). ..................... IF(B NUMERIC) ADD 10 TO C. a) b) c) d) condition in the if statement is wrong. nothing is wrong C is initialized,Add 10 TO C is wrong. both b and c should have the same size

(11) A binary search starts with what entry in the table and proceed in what ord er through the table entries. a) The first and works forward b) The value of the index before the SEARCH starts and works forward c) The value of the subscript before the SEARCH starts and works forward d) The last and works backward e) The middle and works either backward or forward depending on the value found. (12) What do you mean by file status 37. a) b) c) d) File file Open File attribute logically specified opened in mismatch error on the file that doesn t support open mode. write mode

(13) How is sign stored in Packed Decimal fields? a) b) c) d) Sign Sign Sign None is is is of stored as a hex value in the last nibble (4 bits ) of the storage over punched with numeric value stored in the last bite stored in hex value in first 4 bits of storage the above

(14) Consider the following two statements MOVE 10 TO N. PERFORM PARA-X N TIMES STOP RUN. PARA-X. MOVE 5 TO N. How many times PARA-X will be executed? a) 10 b) 05 c) Infinite

d) Execution Error (15) How do you set a return code to the JCL from a COBOL program a) b) c) d) By By By By moving moving moving moving a a a a value value value value to to to to RETURN-CODE reg RETURN_CODE RCODE RETURNCODE

(16) Indicate which one of the following is not true about the SET verb. a) The verb b) The verb ntifiers c) The verb ral value. d) The verb value. can be used to set one or more indexes to a particular value can be used to move the current value of an index to one or more ide can be used to increment one or more identifiers by a positive integ can be used to decrement one or more indexes by a positive integral

(17) PERFORM ACCUMULATE-TOTALS VARYING A FROM 1 BY 2 UNTIL A > 2 AFTER B FROM 1 BY 1 UNTIL B > 2 AFTER C FROM 2 BY -1 UNTIL C < -9 How many times accumulate-tot als will be executed? a) b) c) d) 10 09 11 infinite loop.

(18 ) How many times PARA-A is performed PERFORM PARA-A VARYING TIMES-COUNTER FR OM 1 BY 1 UNTIL TIMES-COUNTER >0. STOP RUN. PARA-A. SUBTRACT 1 FROM TIMES-COUNTE R . DISPLAY HAI . a) b) c) d) 10 infinite loop 2 0

(19) Consider the following: 77 W-NUM PIC 9 VALUE 0. ---------------- MOVE 1 TO W-NUM PERFORM PARA-X UNTIL W-NUM > 9. - ------------ PARA-X. ADD 1 TO W-NUM How many times PARA-X will execute? a) b) c) d) 12 10 09 Infinite Loop

(20) Indicate what value will be displayed after the execution of the DISPLAY st atement in the paragraph named P3. == MOVE 2 to M.P1. PERFORM P2 9 TIMES. P2. MU LTIPLY 2 BY M. P3. DISPLAY M a) b) c) d) 2048 2036 1048 None of the above

(21) What is the compiler option to show line where the error occurred? a) b) c) d) ARITH(EXTEND) TEST RENT ARITH(COMPAT)

(22) Consider the following program statements MOVE 0 TO SW. PERFORM PRI-OUT UNT IL SW=1 DISPALY NO-OF-REC STOP RUN PRI-OUT. READ IN-FILE AT END MOVE 1 TO SW. WR ITE OUO-REC FROM IN-REC. ADD 1 TO NO-OF-REC. if the IN-FILE contains 1000 record s what value will be displayed after the PERFORM is over? Assume that NO-OF-REC has PIC 9(4) a) b) c) d) 1000 1001 1 None of the above

(23) 77 WA PIC 9(3) V99 VALUE 23.75. 77 WB PIC ZZ9V99 VALUE 123.45. After MOVE W A TO WB The contents of WB will be? a) b) c) d) b2375 ( b indicates space ) 023.75 b23.75 ( b indicates space ) None of the above

(24) The ---- Statements has always allowed you to develop program functions tha t can be stored seperately from other program code and then be included in the p rogram at a) b) c) d) Perform and Evaluate copy and perform call and perform Copy and call

(25) Identify the incorrect statement a) CALL MY-SUB b) CALL MY-SUB ON OVERFLOW GO TO PARA1. c) CALL MY-SUB USING PARM-1. d) CALL MY-SUB USING PARM-1 UNTIL PARM-1=10 26) What is the limit of linkage section? a) 132 MB b) 120 MB c) 128 MB c) 150 MB 27) Is dynamic allocation is possible in cobol ? if yes, how? 28) What is the difference between ON SIZE ERROR and ON OVERFLOW? 29) To use SEARCH ALL, the table should be in sorted order I am loading the tabl e from one of the PDS members.The PDS member data is not in sorted order.How w ill load the table in sorted order? You should not use the SORT utility in JCL.

30) It is known that relative file organization is much more efficient than othe r type of organization then why we donot usually prefer it. Give reason. 31) What is the use JUSTIFIED clause? Explain with example. 32) In a PERFORM, what corresponds to DO UNTIL? a) test until b) test while c) do until d) test before e) test after 33) Which division requires device specification changes if the program is run o n a different computer? a) IDENTIFICATION DIVISION b) ENVIRONMENT DIVISION. c) DATA DIVISION d) PROCEDURE DIVISION 34) What function do you use to convert date in GEORGIAN Calendar from standard date form to integer date form? a) INTEGER-OF-DATE b) INTEGER-OF-DAY c) DAY-OF-INTEGER d) WHEN-COMPILED 35) What will be the output of the following code snippet? 01 WS-A PIC 99 VALUE 10. 01 WS-B PIC 99 VALUE 30. IF WS-A = 10 IF WS-B = 20 DISPLAY WS-A = WS-A ELSE CONTINUE END-IF DISPLAY I M END-IF. DISPLAY SUCCESSFUL . a) 10 b) I M c) SUCCESSFUL d) I M SUCCESSFUL COBOL LAB 1. The formula to convert a temperature from Fahrenheit to Celsius is C= (F - 32) 5/9. Write a program that calculates the temperature in Celsius from Fahrenheit. 2. Suppose you are working in TCS, Chennai and your client situated in USA send some data in which the date is in format MM/DD/YYYY but you require the for mat of date to be converted into Indian Date format before doing any manipulatio n on data. Write a Program to achieve the above goal. 3. Write a program to multiply two 2-d matrices. 4. Write a program to display INDIA as below: I NN DDD I I I I AAAAA

5. Write a program to show the usage of REDEFINE and RENAME Clause. 6. I have the following string AAAABBCCCCDDD. Write the program to convert the above string in the form ABCD. 7. Write a Cobol program to create a Menu having following options: MENU 1. ADD 2. SUBTRACT 3. MULTIPLY 4. DIVIDE Now the user inputs two numbers and choice. Based on this choice the respective subprogram is called and result is shown to the user. 8. Write a COBOL program to search the details of an employee in the PS. 9. Write a COBOL program to add a record in the existing employee PS. 10. Write a COBOL program to update the salary of the employee in the employ ee PS by Rs. 1000. The employee-id is to be inputted by the user at run-time. 11. Write a program to delete the records from the PS whose salary is less than Rs.5000. 12. There are two PS, emp1 and emp2 write a program to add only those record s to emp1 from emp2 that do not exist in the emp1. 13. Write a program to arrange the records of emp PS in the ascending order of emp-id. 14. Merge the records of empfil1, empfil2 and empfil3 into empout file. 15. Create an indexed file empindex with some employee ids and a PS empmaste r with raw data. Write a program to fetch only those records whose ids exists in the indexed file and write the fetched records to another PS empout.

Anda mungkin juga menyukai