CpSc 361 - Data Management Systems Midterm Review

Document Sample
CpSc 361 - Data Management Systems Midterm Review Powered By Docstoc
					                         CpSc 361 - Data Management Systems Final

Multiple Choice (70 pts total, 2.5 pts each)

    1. Which of the following represents a hierarchy of operators (from highest to lowest precedence)?
        a) ** * + / -
        b) *,/ ** +,-
        c) ** *,/ +,-
        d) *,/ +,- **
    2. Which of the following verbs handles selection in COBOL?
        a) EVALUATE
        b) PERFORM
        c) IF
        d) GOTO
        e) b and c
    3. The DD statement in JCL…
        a) marks the beginning of the job.
        b) identifies the program or procedure to run.
        c) describes each data set member used in the program.
        d) none of the above
        e) b and c
    4. What is the purpose of the Environment Division?
        a) Identify the source and object computers.
        b) Connect the filenames used in the program to the files that exist in the mainframe data sets.
        c) Identify the program and programmer.
        d) a and b
        e) none of the above
        01    KOUNT-TABLE.
                03 KOUNT            PIC 9(5) OCCURS 5 TIMES VALUE ZERO.
               VARYING SUB FROM 1 BY 1
        UNTIL SUB > 5.
               IF KOUNT (SUB) > 100
                      ADD KOUNT (SUB) TO ANSWER.
        Values of the array:             KOUNT (1) = 10
                                         KOUNT (2) = 100
                                         KOUNT (3) = 200
                                         KOUNT (4) = 75
                                         KOUNT (5) = 175

        What is the value of ANSWER after the PERFORM is executed?
        a) 375
        b) 475
        c) 0
        d) 85
e) none of the above
 6. For each file used in a COBOL program, a SELECT statement must be used.
     a) True
     b) False
 7. Suppose the input from a file is read into a record called IN-REC. IN-REC has a field, GPA, that
    contains a floating point number with 1 digit before the decimal point and 4 digits after the decimal
    point. How would you declare the GPA field?
     a) 9.9999
     b) 9V9999
     c) 9Z9999
     d) 9(5)
 8. The acronym COBOL stands for
     a) Common Business Operational Language
     b) Computerized Business Oriented Language
     c) Common Business Oriented Language
     d) Call Others Before One Laughs
     e) none of the above
 9. Which of the following is not a COBOL division?
     a) DATA
     b) FILE
10. Which of the following data elements is defined with a 01 level indicator in COBOL?
     a) file
     b) record
     c) field
     d) none of the above
 11. Which of the following is a true statement?
     a) All divisions start in the A margin.
     b) All sentences start in the B margin.
     c) All sections start in the A margin.
     d) All paragraphs start in the A margin.
     e) All are true statements.
12. The acronym JCL stands for…
     a) Jumbo COBOL Language
     b) Just COBOL Linkage
     c) Job Control Language
     d) Job Control Linkage
     e) none of the above
 13. Which FD entry would be appropriate for the following SELECT statement?


    a) FD MASTER…
    c) FD DA-S-MASTER…
    e) none of the above
14. Which of the following is not an I/O verb?
    a) CLOSE
    b) READ…INTO
    d) OPEN
     e) none of the above
 15. The PERFORM…THROUGH causes…
     a) a set of paragraphs to be executed.
     b) a set of sections to be executed.
     c) structured programmers to cringe.
     d) an implicit set of paragraphs/sections to be executed.
     e) all of the above
16. In general, the execution of a READ from a sequential file causes…
     a) the next record to be READ.
     b) the first record to be READ.
     c) the next record in key order to be READ.
     d) the last record to be READ.
     e) none of the above
 17. The SUBTRACT verb cannot incorporate both the FROM and GIVING clauses in the same
     a) True
     b) False
 18. Which of the following is not a COBOL math verb?
     a) COMPUTE
     c) ADD
     d) MULTIPLY
     e) DIVIDE
 19. In COBOL, there are special tests you can use to check if a data-field is…
     a) Numeric
     b) Positive
     c) Alphanumeric
     d) a and c
     e) a and b
 20. The JCL statement to sort records based on the information in columns 25-40 in descending order
     by description would be…
     a) SORT FIELDS=(16,25,D,CH)
     b) SORT FIELDS=(25,40,CH,D)
     c) SORT FIELDS=(25,16,CH,D)
     d) SORT FIELDS=(40,16,CH,D)
 21. The data in the master file and the transaction file…
     a) must be in ascending order.
     b) must be in descending order.
     c) must be in the same order (both ascending or both descending).
     d) do not need to be in any particular order.
     e) must be in the order they happened.
 22. When the master key equals the transaction key, which of the following can take place?
     a) Add
     b) Change
     c) Delete
     d) all of the above
     e) a and c
     f) b and c
 23. To execute a REWRITE properly, you must first…
     (Hint: A REWRITE is used on indexed files when you wish to update a record.)
     a) Execute INVALID KEY
     b) Execute a READ successfully
      c) Execute a WRITE successfully
      d) Execute a RECORD KEY
24.   Which PICTURE clause is a different size?
      a) 9(5)V9(2)
      b) 99999V9(2)
      c) 9(2)V9(3)V9(2)
      d) 99999v9(9)
      e) 9(5)V99
25.   Which of the following verbs handles iteration in COBOL?
      a) EVALUATE
      b) PERFORM
      c) IF
      d) GOTO
      e) none of the above
26.   A level indicator used for a field must be in the range 02 to…
      a) 39
      b) 40
      c) 49
      d) 50
27.   When declaring records in the WORKING-STORAGE SECTION, a group item…
      a) has to be a 77-level item.
      b) must be declared as the first record in the WORKING-STORAGE SECTION.
      c) is subdivided into more fields.
      d) includes fields that have a higher level indicator.
      e) b and d
      f) c and d
28.   Which of the following is a COBOL math rule?
      a) Fields used in math operations must be formatted for input.
      b) The last data-name referenced in a math operation will hold the result.
      c) All results may be rounded.
      d) all of the above
      e) none of the above