CSCI 465 Name _____________________ Summer, 2009 Quiz 9 (10 points) Multiple-choice questions are 2 points each and true-false questions are 1 point each. On multiple choice questions, pick the best available answer. 1. Suppose I am defining a variable called Customer-ID in Working- Storage which will contain a 6-digit number. Suppose my program will not need to do arithmetic with Number-Waiting, but there will be a need to print its value in the format 999999. What is the most efficient way to choose the Usage clause for this variable? *** A. Usage is Display (or no Usage clause at all). B. Usage is Comp-3. C. Usage is Comp. D. It makes no difference. E. None of the above. 2. In COBOL, the default is to pass all arguments to external subprograms by content rather than by reference. A. True *** B. False 3. Suppose our main program (called MAJOR) is executing an external subprogram (called MINOR) which is written in COBOL. MAJOR passes 2 arguments AB and CD, in that order, to MINOR. Which of these statements (A - D) is not true? A. MINOR needs to have a Linkage Section listing two 01-level items EF and GH to match AB and CD, in that order. B. The Procedure Division statement for MINOR must end with "Using EF GH". C. The Procedure Division of MINOR must end with "GoBack". D. The number of bytes defined for EF must be exactly the same as the number of bytes defined for the corresponding argument AB. *** E. All of A - D are true. 4. Which of these is not true about static and dynamic calls in COBOL? A. With either kind of call, we can pass arguments to a subprogram. B. In a static call, the name of the subprogram is hard-coded into the COBOL program. *** C. A static call requires us to include something in STEPLIB of the fetch step. *** D. If we use a static call, the load module will be a bit smaller than if we use a dynamic call. E. The subprogram has no way of knowing whether we are calling it with a static call or a dynamic call. Typo. Sorry about that! 5. Suppose a COBOL program has an EXEC-line PARM. Then the Linkage Section should contain one 01-level group item starting with a 2-byte binary field to contain the PARM's length. *** A. True B. False 6. Suppose I want to sort a file. The key field for the sorting will be one of the fields in the data record. What information (A - D) is needed to do the sorting? A. The type of data in the key field. B. The number of bytes in the key field. C. The location (starting column) of the field within the record. D. Whether we want ascending order or descending order. *** E. All of the above.