This action might not be possible to undo. Are you sure you want to continue?
Ovewview:COBOL Multiple Choice Questions and Answers,Mainframe COBOL Technical Test Questions,COBOL Technical Aptitude Test.
1) The following statement WRITE OUT-REC.Which one of the following modes of operating the Sequential file is not true
(a) OPEN INPUT (x) (b) OPEN INPUT-OUTPUT (c) OPEN EXTEND (d) OPEN OUTPUT
2) The same file name can be specified in the USING and GIVING phrase of a SORTstatement. (1) True (x) (2) False
3) If USING is specified in the SORT verb, then GIVING must also be specified. (1) True (2) False (x)
4) In SORT statement, all keys must be specified as ascending or descending but not as combination of the two (1) True (2) False (x)
5) SORT RAFFLES_FILE ON ASCENDING KEY IBM-MAIN Y2K-MAIN USING NPUT-FILE GIVING OUTPUT-FILE. Which one the following is true.
(1) The sorted file will contain all Raffles records in ascending order of Y2K-MAIN. (2) IBM-MAIN is the major key and Y2K-MAIN is the minor key (x) (3) The statement is wrong as there should be only one key since the clause ascending key appears only once.
. (2) The data-names CLASS-NUMBER and STUDENT-NAME must appear in the record description of STUDENT-FILE. (3) The files INPUT-FILE and OUTPUT-FILE should be opened by an OPEN statement before the SORT statement. GIVING (2) USING ……. INPUT PROCEDURE (3) USING ……. 6) SORT STUDENT-FILE ON ASCENDING KEY CLASS-NUMBER STUDENT-NAME USING INPUT-FILE GIVING OUTPUT-FILE. INPUT-FILE and OUTPUT-FILE must be equal. (1) REWRITE STATEMENT (x) (2) WRITE STATEMENT (3) START STATEMENT .. (2) Does not require that the input file to be merged be sorted on the merge keys. (1) Can merge a maximum of three files.(4) Both INPUT-FILE and OUTPUT-FILE must be described in the DATA DIVISION with SD entries. (1) All records with same CLASS-NUMBER will appear together in the consecutive positions of the sorted file. 8) Indicate which one the following is not a valid combination of a SORT verb (1) USING …….. OUTPUT PROCEDURE 9) Indicate which one of the following will not have the INVALID KEY Phrase when used in connection with sequentially accessed relative file in a PROCEDURE DIVISION with out any declarative section. 7) About the MERGE verb. (3) Requires that all files mentioned in the statement must have records of same size (x) (4) Does not require that the position of the merge keys with in the records descriptions of each of the files must be same.which one of the following is true. (x) (4) The sizes of the records described for STUDENT-FILE . Which one of the following is false. OUTPUT PROCEDURE (x) (4) INPUT PROCEDURE …..
(1) a and b (2) a and c (3) c and d (4) a and d (x) 11) which of the following is true about the file which is referenced in a DELETE statement (1) It must be opened in INPUT mode (2) It must be opened in OUTPUT mode (3) It must be opened in I-O mode (x) (4) As in the case of SORT statement. Indicate which of the following are not valid modes of opening the INDEXED file of which MASTER-REC is a record (a) OPEN INPUT (b) OPEN OUTPUT (c) OPEN INPUT-OUTPUT (d) OPEN INDEXED. the file must be closed before the use of this statement 12) Indicate which of the following statement is not allowed when a relative file is opened to I-O mode and the ACCESS mode is RANDOM (1) READ (2) WRITE (3) REWRITE (4) START 13) Indicate which of the following is not a PROCEDURE DIVISION verb (1) START (2) SEEK (3) RERUN (4) DELETE 14) Indicate which of the following is not a PROCEDURE DIVISION verb (1) REWRITE (2) INSERT (x) .10) WRITE MASTER-REC INVALID KEY GO TO PARA-ERROR.
(1) True (x) (2) False 18) With a READ statement either AT END clause or INVALID KEY clause must be specified (1) Yes (2) No (x) 19) Relative key clause must be mentioned in case of a Relative file organisation. the ACCESS MODE clause must always be specified.D 16) In case of a disk file. (1) True (2) False (x) 17) A READ statement can have AT END clause and INVALID KEY clause.C.(3) DELETE (4) START 15) Indicate which of the statements may indicate DUPLICATE alternative key warning if it occurs in case of an INDEXED ORGANISATION without DUPLICATE phrase (A) READ (B) REWRITE (C) WRITE (D) DELETE (E) START (1) A. but both must not appear simultaneously.B. (1) Yes (2) No (x) 20) The START statement enables the programmers to start processing from any record position. (1) True (x) (2) False .C (3) A.D.E (2) A.D (4) B.C.
(1) Yes (2) No (x) 24) The STRING verb can be used to tranfer characters from one alphanumeric field to another alphanumeric field starting at some particular position in receiving field (1) False (x) (2) True 25) If the DELIMITED BY SIZE phrase is used with STRING verb. 23) The UNSTRING verb is used to transfer data from several sources to one receiving field. (3) The EXAMINE statement is incorrect as it is used to replace a single character by another single character but not a group of characters.21) Both the RECORD KEY and ALTERNATIVE KEY clause can be specified for and INDEXED file. the transfer of characters in to the receiving field stops as soon as a blank is encountered in the sending field (1) Yes (2) No (x) .Indicate which one of the following is true (1) The EXAMINE statement is incorrect because A does not contain the character “ABC” in a continuous sequence (2) The EXAMINE statement is incorrect as it can be used to replace a numeric literal by another numeric literal. (x) (4) The EXAMINE statement is incorrect as TALLYING OPTION is missing. (1) True (x) (2) False 22) 77 A PIC X(10) VALUE IS “AABBCCDDEE”.In PROCEDURE DIVISION contains the statement EXAMINE A REPLACING ALL “ABC” BY “XYZ” .
as the statement does not contain any DELIMITED BY phrase. (1) There will be a syntax error. (1) True (2) False (x) 28) If the OVER FLOW option is not used in a STRING statement and the overflow condition occurs.26) The INSPECT statement can be used to check whether the value in a data name is numeric (1 True (2 False (x) 27) In an UNSTRING statement a receiving field receives the characters of the sending field including the delimiter. (2) There will be a syntax error. (x) (3) The statement is correct and after the execution of the statement field-1 will contain the three characters “ABC” from the left-most position and the remaining positions of field-1 will remain unchanged (4) The statement is correct and after the execution of the statement field-1 will contain the three characters “ABC” from the left-most position and the remaining positions of field-1 will get filled with spaces. (1) True (2) False (x) 29) In an UNSTRING statement if a receiving field with PICTURE X(06) receives only two characters from the sending field the remaining four positions will retain their original characters (1) True (2) False (x) 30) UNSTRING “ABC” INTO FIELD-1. the REPORT NAME does not appear (1) RD entry . Indicate which one of the following is correct. as the sending string must be identifier and not a literal. 31) Indicate in which of the following. the STRING operation is terminated.
(2) INITIATE statement (3) SELECT clause (x) (4) TERMINATE statement 32) Which of the following Report groups must have a data name for its identification. (1) MOVE (2) TOTAL (x) (3) SUM (4) SOURCE 36) A formal parameter name can appear more than once in the USING phrase of the PROCEDURE DIVISION header of the subroutine . performs the initialization of the sum controls. (1) RESET (2) INITIATE (x) (3) VALUE (4) GENERATE 35) Which of the following is not allowed to assign a value to a data name in a REPORT SECTION. LINECOUNTER and PAGE-COUNTER to their initial values. (1) REPORT HEADING (2) REPORT FOOTING (3) DETAIL (x) (4) PAGE HEADING (48) CONTROL FOOTING 33) Indicate which of the following clause is not allowed in a RD entry (1) FIRST DETAIL (2) LAST DETAIL (3) CONTROLS (4) LINE NUMBER (x) 34) Indicate which of the following.
(1) True (2) False (x) 37) The calling program contains the statement CALL “RAFF” USING A.Mainframe Interview Questions with their respective answers.C.A. (4) CALL RAF-SUB USING PARAM-1 UNTIL PARAM-1 >10 (x) Interview__ques COBOL Frequently Asked Questions and Answers Posted Under COBOL-Interview. Actual C with Formal A. (2) Actual A with Formal B. Mainframe-Interview-Questions Overview:COBOL Frequently Asked Questions Answers. (4) None of the above 38) Identify the incorrect statement (1) CALL RAF-SUB. Actual C with Formal C. Which one of the following gives the correct information about the actual and formal parameters has been connected. Actual B with Formal C. And the PROCEDURE DIVISION header of the called subroutine(called RAFF) is PROCEDURE DIVISION USING C.B. (3) CALL RAF-SUB USING PARAM-1. Actual B with Formal B. (2) CALL RAF-SUB ON OVER FLOW GO TO MIS-SUB. (3) Actual A with Formal C.B. (1) Actual A with Formal A. Actual B with Formal B. Actual C with Formal A. .
the file must be opened in I-O mode. 3 What does a CLOSE WITH LOCK statement do? Ans: The statement closes an opened file and it prevents the file from further being opened by the same program. Hence AT END clause can be used. rd03. Therefore. 01 rd02 PIC X(n). rd02. but the file is positioned following the last record on the existing file.1. 4 Which mode of opening is required when REWRITE is used? Ans: I-O mode 5 Why is it necessary that the file be opened in I-O mode for REWRITE? Ans: Before the REWRITE is performed. 6 Which clause can be used instead of checking for FILE STATUS = 10? Ans: FILE STATUS 10 is the end of file condition. EXTEND mode opens the file for output. 2 When will you open a file in the EXTEND mode? Ans: When an existing file should be appended by adding new records at its end. 7 How will you position an indexed file at a specific point so that the subsequent sequential operations on the file can start from this point? Ans: Use START .How will you define your record descriptions in the FILE SECTION if you want to use three different record descriptions for the same file? Ans: FD filename DATA RECORDS ARE rd01. Hence REWRITE includes an input operation and an output operation. the record must be read from the file. 01 rd01 PIC X(n). 01 rd03 PIC X(n).
9 What is the LINKAGE SECTION used for? Ans: The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program. An index can only be modified using PERFORM. Comp is defined as the fastest/preferred numeric data type for the machine it runs on.START filename KEY IS EQ/GT/LT.' . 8 What are the access mode requirements of START statement? Ans: Access mode must be SEQUENTIAL or DYNAMIC. IBM Mainframes are typically binary and AS400's are packed. Subscripts use the value of the occurrence... SEARCH & SET. which is preferable .. You SET an index to a value and SET it UP BY value and DOWN BY value. Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. typically a PIC (999) where a value must be moved to the subscript and then increment or decrement it by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. It is the part of the called program where these share items are defined. It is part of a called program that 'links' or maps to data items in the calling program's working storage. Indexing uses binary displacement.a subscript or an index? Ans: It's not possible to pass an index via linkage. while comp-3 indicates packed decimal. Display is the default. 12 What is the difference between comp and comp-3 usage? Explain other COBOL usages. dataname INVALID KEY . The index is not part of the calling programs working storage. Need to have index for a table in order to use SEARCH. SEARCH ALL Cobol statements. 10 If you were passing a table via linkage. 11 What is the difference between a subscript and an index in a table definition? Ans: A subscript is a working storage data definition item. Ans: Comp is a binary usage. The other common usages are binary and display.
COMP-2 . 15 How many bytes does a S9(7) COMP-3 field occupy ? Ans: Will take 4 bytes. 17 What is the maximum value that can be stored in S9(8) COMP? Ans: 99999999 18 What is COMP SYNC? Ans: Causes the item to be aligned on natural boundaries.99 and 9v99? Ans: PIC 9. 19 What is the maximum size of a 01 level item in COBOL I? in COBOL II? Ans: 16777215 20 What is the difference between PIC 9. For example. then the binary data item will start from address 4. on main frame the memory word size is 4 bytes. but the access to this computational field is faster. Uses 8 bytes. 14 How do you define a variable of COMP-1? COMP-2? Ans: No picture clause to be given. For binary data items. where n=7 in this example. If you specify SYNC. If my first variable is x(3) and next one is s9(4) comp. S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). Sign is stored as hex value in the last nibble. General formula is INT((n/2) + 1)).Double precision floating point. the address resolution is faster if they are located at word boundaries in the memory.Single precision floating point. You might see some wastage of memory. Example 01 WS-VAR USAGE COMP-1.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC .13 What is COMP-1? COMP-2? Ans: COMP-1 . 16 How many bytes does a S9(7) SIGN trailing separate field occupy ? Ans: Will occupy 8 bytes (one extra byte for sign). This means that each word will start from an address divisible by 4. then if you do not specify the SYNC clause. Can be SYNCHRONIZED LEFT or RIGHT. Uses 4 bytes.
99 is a four position field that actually contains a decimal point where as 9v99 is a three position numeric field with an implied or assumed decimal point.Missing Select statement(during compile) • Bad Subscript/index • Protection Exception • Missing parameters on called subprogram • Read/Write to unopened file • Move data from/to unopened file.May be due to • Missing or misspelled DD name • Read/Write to unopened dataset • Read to dataset opened output • Write to dataset opened input • Called subprogram not found. S0CB abends ? Ans: S0C1 . 23 What happens when we move a comp-3 field to an edited ( say z(9). 21 How is PIC 9. the v means an implied decimal point. which is the default. S0C5. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.9v99 is THREE-POSITION numeric field with implied or assumed decimal position. S0C7.99 is different from PIC 9v99? Ans: PIC 9. 22 What does PIC 9v99 Indicate? Ans: PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position. 24 What are the causes for S0C1. S0C4 may be due to • 1. When you try displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal.zz-) Ans: The editing characters are to be used with data items with usage clause as display. S0C4. S0C5 May be due to .
S0C7 may be due to • Numeric operation on non-numeric data • Un-initialize working-storage • Coding past the maximum allowed sub script. 25 What is the difference between an External and a Global Variable 's? Ans: Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library.• Bad Subscript/index • Close an unopen dataset • Bad exit from a perform • Access to I/O area(FD) before read. .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.