Which One of the Following Is an INCORRECT Specification for a Data-Name ?

Which One of the Following Is an INCORRECT Specification for a Data-Name ?

EDS COBOL TEST

COBOL TEST

Instructions : Do not write on this quiz paper.

Please answer on the sheet provided.

Time : 1hr.Marks : 80

1.Which one of the following is an INCORRECT specification for a data-nme?

a) LAST-NAME

b) 1234

c) 12A3

d) SALES

2.Which of the following is an INVALID paragraph name ?

a)999

b)A-1

c)A+1

d)XX9

3.Level numbers range from _____ to _____ .

a)00, 49

b)01, 50

c)01, 49

d)00, 50

4.Two data names at the same level within a record must

a) be unique

b) not necessarily unique

c) necessarily unique

d) none of the above

5.With COBOL 85 the use of the word FILLER.

a) cannot be ommitted

b) is used to report memory usage

c) can be omitted entirely

d) is a form feed control command to the printer

6.The maximum number of digits in a numeric item is

a) 16

b)17

c)18

d)20

7. Which of the following is not a VALID COBOL figurative constant

a) ZERO

b) ZEROS

c) ONES

d) QUOTES

8.A STOP RUN statement

a) must appear only once in a program

b) can appear in several places in a program

c) was not available in COBOL 74

d) is used to stop the printer.

9.The VALUE clause

a) is used to obtain the value of a variable.

b) is used to initialise a variable to a certain value.

c) cannot be used in the data division of a program.

d) cannot be used to initialise a nonnumeric varaible.

10.Which of the following declarations is essential in the IDENTIFICATION DIVISION.

a)DATE-COMPILED.

b) PROGRAM-ID.

c)AUTHOR.

a) INSTALLATION.

11.When the UNTIL option is used with PERFORM verb, the condition is tested

a) before

b) after

c) before and after

d) not at all

the object of PERFORM is executed.

12.The association between a file-name and physical device on which the file reside is established by the select statement which should appear in :

(a) FILE section. ENVIRONMENT division.
(b) FILE-CONTROL paragraph, INPUT-OUTPUT section, ENVIRONMENT, division.
(c) CONFIGURATION section, ENVIRONMENT division.
(d) FILE section, DATA division.

13.The BLANK WHEN ZERO clause can be applied to

a)Numeric edited items

b)Alphanumeric edited items

c) Both of the above

d) is not a valid clause in COBOL - 85.

14. One of the following correctly describe the concepts of ‘statement’ and ‘sentence’ in COBOL:
(a) A COBOL sentence is a sequence of COBOL sentences, the last of which is terminated by a period.
(b) A COBOL sentence is a sequence of COBOL statements, the last of which is terminated by a period.
(c) There is no concept of ‘sentence’ in COBOL. English sentences can, however, appear in comment lines.
(d) The concept of ‘sentence’ and ‘statement’ are identical in COBOL.

15. Use of the EXTEND option with the OPEN verb causes the

file to be positioned

a) at the first record

b) at the last record

c) after the last record

d) before the last record

16.The Procedure Division entry for the called program

includes a ______clause.

a) GIVING

b) USING

c) VALUE

d) PIC

The following table gives the PICTURE declarations of the values assumed

(immediately preceeding the arithmetic statement given in each question )

by four data names DATA1, DATA2, DATA3 and DATA4.

Data Name PICTUREValue immediately prior to the execution of the statement.

in bytesnumerical value

DATA199902424

DATA2999V9019919.9

DATA399V9900180.18

DATA4999V9012.012

Answer the following four questions with reference to the above table :

17.The statement

ADD DATA1 DATA2 TO 23

results in

a) values of 47 and 42.9 for DATA1 and DATA2 respectively.

b) values of 22 and 11.2 for DATA1 and DATA2 respectively.

c) all the data-names retain their values.

d) a syntax error.

18.The statement

SUBTRACT DATA3 0.79 FROM 100.0 GIVING DATA2 ROUNDED

results in

a) values of 0.18 and 99.1 for DATA3 and DATA2 respectively.

b) values of 0.18 and 99.0 for DATA3 and DATA2 respectively.

c) values of 99.03 and 99.0 for DATA3 and DATA 2 respectively.

d) a syntax error.

19.The statement

MULTIPLY DATA2 by 10.0 GIVING DATA3 ROUNDED

ON SIZE ERROR NEXT SENTENCE

results in

a) values of 19.9 and 199.0 for DATA2 and DATA3 respectively.

b) values of 19.9 and 99.0 for DATA2 and DATA3 respectively.

c) all the data-names retaining their values

d) a syntax error.

20.The statement

DIVIDE DATA4 INTO DATA1

ON SIZE ERROR MOVE 0 TO DATA1.

results in

a) values of 2 and 12.0 in DATA1 and DATA4 respectively.

b) values of 0 and 12.0 in DATA1 and DATA4 respectively.

c) all the data-names retaining their values

d) a syntax error.

21.Data-names BAL1, BAL2, BAL3 and BAL4 have the following definitions in the WORKING-STORAGE section.

01BAL1PIC9-

01BAL2PIC9+

01BAL3PIC9CR

01BAL4PICZZZ

the statement

MOVE -5 TO BAL1, BAL2, BAL3, BAL4.

will produce the following bytes in BAL1, BAL2, BAL3 and BAL4 respectively :

(b stands for space)

a)5b5-5CR5bb

b)5-5-5bb005

c)5-5-5CRbb5

d)5-5b5bb500

22.Data names A,B and C assume values 2, 3 and 4 respectively , at some stage in the computation, when the following PROCEDURE DIVISION statement is executed. What is the resulting value of D ?

IF (A > B) OR (B < C)

COMPUTE D = A + B * C

ELSE

COMPUTE D = A * B + C .

a) 14

b) 20

c)10

d)none of the above.

23. IF CHAR-1 < CHAR-2

WRITE LINE-1

ELSE

WRITE LINE-2

If before executing this statement, CHAR-1 contains alphanumeric literal ‘1’ and CHAR-2 contains alphanumeric literl ‘A’ then ...

a) LINE-1 is always written.

b)LINE-2 is always written.

c) Action depends on the computer system on which the program is run.

d) compiler error results.

24.IF PAY-CODE = ‘A’

IF PAY-BASIC < 500 MOVE 0 TO PAY-DEDUCT

ELSE IF PAY-BASIC < 1000 MOVE 120 TO PAY-DEDUCT

ELSE MOVE 150 TO PAY-DEDUCT

ELSE MOVE 80 TO PAY-DEDUCT.

COMPUTE PAY-DEDUCT = PAY-DEDUCT * 0.9.

If this program segment is entered with PAY-CODE = ‘B’,

PAY-BASIC = 900 AND PAY-DEDUCT = 90

the resulting value of PAY-DEDUCT will be ...

a)0

b)72

c)108

d)135

25. What is the correct interpretation of the statement

PERFORM B010-PROCESS-PARA UNTIL STATUS = 1.

a) Do the paragraph B010-PROCESS-PARA once if STATUS has a value of 1.

b) Keep repeating paragraph B010-PROCESS-PARA as long as STATUS has a value 1.

c) Keep repeating paragraph B010-PROCESS-PARA as long as STATUS has a value other than 1.

d) Do the paragraph B010-PROCESS-PARA once if STATUS has a value other than 1.

26.The statement

PERFORM B010-CALC-PARA VARYING I FROM 1 BY 1 UNTIL I = 5

causes this paragraph to be entered .

a)in a continous loop, at least until I overflows

b)thrice

c) four times

d)none of the above

  1. In the choices below, a level number is followed by a COBOL clause is expected to go with the data descrtption at that level. Which of them is an incorrect pair?
    (a) 01PICTURE
    (b) 10REDEFINES
    (c) 20RENAMES
    (d) 88VALUES
  1. The function of the SYNCHRONIZED clause is to ensure that:
    (a) The data-name begins or/and ends at a word boundary for word oriented computers.
    (b) The record begins or/and ends at a word boundary for word oriented computers.
    (c) The record always stays at a disk sector (disk segment) boundary for disk files.
    (d) The data-name assumes binary and not DISPLAYnumber representation.
  1. The data-name LINE-1 has following FILE section entry:
    05 LINE-1 PIC X(25)
    The effect fo the statement ...
    MOVE SPACE TO LINE-1
    would be to :

(a) Move spaces to all the bytes of LINE-1.
(b) Move a single space to the first byte of LINE-1 leaving the others unchanged.
(c) Move a single space to the last byte of LINE-1 leaving the others unchanged.
(d) Nove of the above.

  1. Indicate which one of the following is not a valid form of PERFORM statement.
    (a) PERFORM P1 THREE TIMES.
    (b) PERFORM P1 VARYING I FROM 1 BY 1 UNTIL I > 3.
    (c) PERFORM P1 UNTIL MORETHAN3.
    (d) PERFORM P1 THRICE.
    (e) PERFORM P1 UNTIL THREE > 3.
  1. The following statement is used in a COBOL program:
    PERFORM UPDATE-INPUT UNTIL DONE.
    (a) DONE is a data-name whose value gets decremented at each entry of the paragraph.
    (b) DONE is a data-name whose value gets decremented at each exit of the paragraph.
    (c) DONE is a data-name whose value gets defined in an exception heading section.
    (d) DONE is a condition name.
  2. Which one of the following is NOTcorrect?
    (a) ADD A, B GIVING C, D.
    (b) ADD CORRESPONDING A TO C.
    (c) ADD A TO B GIVING C.
    (d) ADD A TO B, C TO D.
  3. Which of the following is incorrect?
    (a) MULTIPLY A BY B GIVING C.
    (b) MULTIPLY A INTO B.
    (c) DIVIDE A BY B GIVING C.
    (d) DIVIDE A INTO B.
  1. Which one of the following if NOT a PROCEDURE DIVISION verb?
    (a) ADD
    (b) SUBTRACT
    (c) INSERT
    (d) DELETE
  1. Which of the following PICTURE clauses is invalid as a floating symbol?
    (a) -
    (b) $
    (c) S
    (d) +
  1. In COBOL-85, the minimal set of clauses that are necessary to set up and initialise a table of integer values to all zeros in the WORKING-STORAGE section consists of

a) VALUE

b) VALUE, OCCURS

c) VALUE, OCCURS, REDEFINES

d) VALUE, OCCURS, REDEFINES, INDEXED BY

  1. Assuming a 32-bit word , how many words does the following occupy.

01 BILLS.

05INDIVIDUAL-BILL occurs 10 times.

10 BILL-NOPIC 9(5)V99SYNC.

10 BILL-AMOUNT PIC 9(3) SYNC.

a) 1 word.

b) 2 words.

c) 3 words.

d) 4 words

  1. Study the following WORKING_STORGAGE SECTION entries:

01TABLE-ENTRY OCCURS 100 TIMES INDEXED BY ITAB.

10TAG-NOPIC 99.

10TAG-NAMEPIC X(20).

01TAG-DATA PIC 99.

Which of the four choices can be considered as the best description of the SEARCH statement.

SEARCH TABLE-ENTRY

AT END PERFORM PRINT-TAG-ERROR

WHEN TAG-DATA = TAG-NO(ITAB)

PERFORM PROCESS-TAG.

a) There is a syntax error in the SEARCH statement.

b) Statement is syntactically correct but may fail to do the search correctly if ITAG is not initailised before the SEARCH statement.

c) There is a syntax error in the table definition.

d) Statement is syntactically correct; the index value gets automatically initialised.

  1. A table GRADE-TABLE has the following record description in a COBOL program.

01GRADE-TABLE.

05GRADE OCCURS 5 TIMES.

10CLASS-TYPEOCCURS 9 TIMES.

15YEAROCCURS 9 TIMES.

It is desired to pick up the first grade in the 9th class-type in the 7th year. Which of the following will give the correct field ?

a) GRADE(7,9,1)

b) YEAR (1,9,7)

c) GRADE(1,9,7)

d) YEAR (7,9,1)

  1. A MOVE CORRESPONDING is not usually used because :

a) it is a very time-consuming way of moving data.

b) it uses more memory compared to moving each field using MOVE instead of MOVE CORR .

c) A MOVE CORR may produce unintended results if data names are altered during program modification.

d) none of the above.

  1. A data-name HRD-WORD meant for holding the text for a report header is specified in the WORKIN-STORAGE SECTION as :

HRD-WORDPIC X(30)

VALUE “------REPORT LIST------”.

The value of HRD-WORD is changed at execution time by the statements .

INSPECT HRD-WORD REPLACING LEADING “-” BY “*”.

INSPECT HRD-WORD

TALLYING COUNT-1 FOR ALL “-” BEFORE INITIAL “ “

COUNT-2 FOR ALL “-” AFTER “ “.

After the two INSPECT statements are executed in the given order the data-names COUNT-1 and COUNT-2 will assume values

a) 9 and 9 respectively.

b) 0 and 9 respectively.

c) 0 and 0 respectively.

d) 9 and 0 respectively.

  1. A COBOL program contains the WORKING-STORAGE SECTION declaration

01A-1.

05B1OCCURS 10 TIMES.

10 C OCCURS 5 TIMES PIC X.

05DPIC 99.

01A-2.

05B2OCCURS10 TIMES.

10C OCCURS 5 TIMES PIC X.

05DPIC 99.

  1. Which of the following statement is INCORRECT .

a) MOVE SPACES TO B2(5).

b) MOVE SPACE TO C OF B1 OF A-1(1,1).

c) MOVE SPACE TO C(1,1) OF B1 OF A-1.

d) MOVE SPACE TO B2(D OF A-1).

  1. Which of the following is not necessarily true .

a) Structured programming improves the maintainability of a program.

b) Structured programming is possible in COBOL.

c) Structured programming reduces the execution timings.

d) Structured programming enables a programmer to concentrate on one function at one time.

  1. IN-QNT is a formal parameter in a subprogram. Which one of the following is NOT true about IN-QNT ?

a) IN-QNTshould appear in the PROCEDURE DIVISION header of the subprogram.

b) The actual parameter in the CALL statement corresponding to the IN-QNT should have the same name .

c) IN_QNT should appear in the LINKAGE SECTION of the subprogram.

d) none of the above.

  1. The COBOL verb that is not directly concerned with an index name is ...

(a) SET
(b) SEARCH
(c) PERFORM
(d) SORT

  1. The PROCEDURE DIVISION of a program contains the statement
    WRITE MASTER-REC
    This clearly suggests that the OPEN statement for this file must NOT be
    (a) OPEN I-O
    (b) OPEN INPUT
    (c)OPEN OUTPUT
    (d) OPEN EXTEND
  1. The PROCEDURE DIVISION OF a program contains the statement ...
    START MASTER-FILE KEY IS > REC-KEY.
    This clearly suggests that the SELECT clause specification for MASTER-FILE must be
    (a) ORGANIZATION IS INDEXED with ACCESS MODE RANDOM.
    (b) ORGANIZATION IS INDEXED with ACCESS MODE DYNAMIC.
    (c) SEQUENTIAL with ACCESS MODE SEQUENTIAL
    (d) SEQUENTIAL with ACCESS MODE RANDOM.
  1. Which of the following is true about the file which is referenced in a DELETE statement?
    (a) It must be opened in INPUT mode.
    (b) It must be opened in OUTPUT mode.
    (c) It must be in I-O mode.
    (d) File Access mode must be RANDOM.

True or False

  1. The END-PERFORM is present in the COBOL-74 standard.
  1. In the COBOL-85 standard, the END-IF must always be used to terminate an IF statement.
  1. SEARCH ALL denotes a binary search.
  1. An index can be manipulated by a MOVE statement
  1. The ASCENDING or DESCENDING KEY clause is required whenever the SEARCH ALL is applied to a table.
  1. A SEARCH statement automatically initializes the index to 1 in the case of a sequential search.
  1. The statement CLOSE INPUT BIO-DATA-FILE is valid.
  1. WRITE EMP-DATA-RECORD

AT END MOVE 1 TO CODE.

The above is not valid in COBOL.

  1. KOUNTPIC 9.

FIRST-NAME PIC X(10)

VALUE 'EDS'.

MOVE 1 TO KOUNT.

STRING FIRST-NAME DELIMITED BY SPACES

INTO NAME-OUT

WITH POINTER KOUNT.

After the STRING operation the value of KOUNT is 7

  1. If the OUTPUT PROCEDURE is specified with the SORT verb, then the INPUT PROCEDURE is required
  1. The order of the parameters passed to the program is determined by the order of their declaration in the LINKAGE SECTION.
  1. The ALTERNATE KEY associated with a record must be a unique key value in the file.
  1. Relative files can be opened in EXTEND mode.
  1. The instructions

MOVE 08 TO EMP-NO

START FILE1

KEY IS > EMP-NO

INVALID KEY DISPLAY "ERR".

will read a record into storage with a key greater than 8.

  1. If you code a USE AFTER ERROR PROCEDURE ON filename statement, you need not use an INVALID KEY with the READ or WRITE statement to dislay error messages.
  1. COBOL takes care of collision resolution in case of relative files.
  1. With the MERGE statement, pre-processing is done with the help of INPUT PROCEDURE and post-processing is taken care of by the OUTPUT PROCEDURE.
  1. Records stored randomly in a relative file can be accessed sequentially.
  1. A table described by a DEPENDING ON CLAUSE is allocated space dynamically on execution.
  1. If we require that the instructions in a loop are to be executed at least once before testing the condition COBOL provides the TEST AFTER option with the PERFORM ... UNTIL.
  1. The sign is not normally allocated a separate storage unit.
  1. Indexed files have lower access times as compared to relative files.
  1. For a relative file, the RELATIVE KEY is part of the data record.
  1. SYNC results in compact storage of data items with no wastage between the data items
  1. COMP increases the speed of computation as compared to DISPLAY.
  1. REDEFINES clause allocates another storage area for the item being redefined.
  1. A RELATIVE KEY is optional when reading from or writing to a realtive file sequentially
  1. The FILE STATUS clause can be used with the SELECT statement to determine the specific type of error that occured when reading or writing to a file

The next three questions pertain to the following :

The content of a data item stored with a picture clause of 9(7)v99 is 1234567.89. What will be the resulting numbers printed in each of the following cases:

  1. 9(6)v99
  1. *(8).**
  1. $(5).$$

ER/ORG/TST/001 Ver 0.00a Page 1