PAGE1
COBOL PRACTICE TEST
1. INDICATE WHAT IS WRONG IN THE FOLLOWING PARTIAL REFORD DESCRLIPTIONS.
A 01EMP-RECORD
02EMP-ADDRESS.
05STREET-NUMBER PIC X(4)
05 STREET-NAME PIC X(26)
03SECOND-PART.
05 CITY PIC X(10)
05 PIN-CODE PIC X(6)
B 01 INITILAL-RECORD VALUE 120284
02 DAY PIC 99.
02MHT PIC99
02 YEAR PIC 99
C WORKING-STORAGE SECTION.
FD KARD-FILE.
PIC X(80)
KARD-REC
2. INDICATE WHETHER OR NOT THE FOLLOWING PICTURE SPECIFICATIONS ARE CORRECT.
A $$$$Z(4).99 B $9(4)ZZ.99 C. A(4)BB D. +9(5).99CR E. Z(5).Z9 F. A(5)00
3. TO DESCRIBE A RECORD THE LEVEL NUMBER MAY BE CHOSEN FROM
- 01 TO 49 (BOTH INCLUSIVE)
- 01 TO 49 (BOTH INCLUSIVE) AND 77
- ALL ODD NUMBERS FROM 01 TO 49 (BOTH INCLUSIVE)
- ALL EVEN NUMBERS FROM 01 TO 49
- 01 TO 77 (BOTH INCLUSIVE)
- NONE OF THE ABOVE.
4. INDICATE WHICH OF THE FOLLOWING IS AN INVALID PARAGRAPH NAME.
A. 1234 B. ZZ99 C. ABC..5 D. ABC+5 E. PARA-123
5. INDICAATE WHILCH OF THE FOLLOWING IS CORRECT.
A. ADD A B GIVING C D.
B. ADD A TO B GIVING C
C. ADD A TO B C TO D
D. ADD A B TO C D GIVING E F
6.INDICATE WHICH OF THE FOLLOWING IS INCORECT.
A. SUBTRACT A B C FROM D E F
B. SUBTRACT A B C FROM D
C. SUBRTACT A FROM D B FROM E C FROM F.
D. SUBRTACT A FROM B GIVING D E F
7. INDICATE WHICH OF THE FOLLOWING IS CORRECT
A. MULTIPLY A TIMES B
f B.MULTIPLY A INTO B
C. MULTIPLY A BY B GIVILNG C
D. MULTIPLY A BY B BY C
8. THE COBOL COMPILER AT THE TILME OF COMPILATION INDICATES AN ERROR IN THE FOLLOWING STATEMENT.
MULTILPLY 0.1 BY A.
WHICH OF THE FOLLOWING GIVES THE CORRECT CAUSE
- ‘A’ HAS A PIC CLAUSSE 9 (4) V99
- ‘A’ IS DECLARED IN THE FILE SECRTION AND NOT IN THE WORKING-STORAGE SECTION.
- ‘A’ HAS A PIC CLAUSES ZZZ9.99
- THE GIVING OPTION IS MISSING.
THE FOLLOWING ARE DATA DIVISIION ENTRIES.
01 A.
02 B OCCURS 10 TIMES.
03 C PIC 999
03 D OCCURS 15 TIMES
04 E PIC 999
04 F OCCURS 20 TIMES
05 G PIC XXX
05 H PIC 999
- DESTERMINES THES TOTAL NUMBESR OF BYTES IN ‘A’ FROM ABOVE DATA DIVISION ENTRIES.
- INDICATE WHICH ONE OF THE FOLLOWING IS CORRECTLY REFESRED AS AN IDENTIFIER IN THE PROCEDURE DIVISION.
A. D(9) B. E(15,10) C. G(8,12) D. C(20) E. B(6) F. F(5,10)
PAGE-2
COBOL TEST
PART-A
True or False
- FILE STATUS clause is used to test the status after 1-O operation
- The division that specifies the computer devices to be used is these DATA DIVISION
- The INPUT OUTPUT SECTION of the ENVIRONMENT DIVISION assigns the file-names
- A maximum of three files may be defined in the INPUT-OUTPUT SECTION
- A File is a collection of records each of which consists of a collection of fields
- Numeric Interals may contain as many as 30 Characters.
- In a nonnumeric move high-order nonfilled positions are replaced with paces
- A VALUE clauses may be used in the File Section to initialize fields
- DIVIDE 0 INTO A GIVING B will result in an ON SIZE ERROR condition
- The GIVING clauses must be used when a REMAINDER is specified
- The ASSIGN clause associates a printer to main memory
- The DELETE verb deletes the mentioned field from the file
- The identifiers specified in both the called and calling program must be same
- COBOL is ideally suited for scientific as well as business applications
- An OCCURS clause may only be used to define entries in the FILE SECTION
PART-B
FILL IN THE BLANKS
- Two techniques for simplifying the design of a COBOL program and facilitating debugging are called ………………..and
- The REDEFINES clause must not be used for items in level numbers……..&…………..
- ………….. …………. ……………. Are the entries must be coded in Area a
- The INVALID KEY option tests the validity of the ………….key
- To read an indexed file sequentially beginning at some point others than the first record in the file you must use the ………..statement
- With the ………….statement you can include prewritten entries in your program
- The ordering which defines the relative rank of all characters in a computer system is called………………
- In file organization omission of the access clause results in…………..
- A……………statement is used for accessing a subprogram
- A…………. clause is used in the data division to ensure that a field consisting of all zeros will print as blank
- A…………is assigned to a specific value or a range of values that an identifier can assumes.
- A…………….statement without a para name which is followed by all instructions to be executed at that point.
- ……………&…………clause can be used to initialize the tables.
- The …….. statement is used to replace characters in an input field with other characters.
- To read an Indexed file both randomly and sequentially in the same program the preferred access mode is………..
PART_C
Answer all the Questions
1 How many times will the paragraph named 400- PROCESS-RTN be executed by the fp;;pwomg PESRFORM statement?
- PEREFORM 400-PROCESS-RTN
VARYING X FROM 1 BY 1UNTIL X=10
B. PERFORM 400-PROCESS-RNT
VARYING X FROM 1 BY 1 UNTIL X>10
C. PERFORM 400-PROCESS-RTN
VARYING X FROM 0 BY 1 UNTIL X=10
2. How many tomes PART- b gets executed if N is 5
PART-A
PERFORM PARA-B N TIMES
PART-B
ACCEPT WA-A
COMPUTE WS.SUM=WS.SUM + WS-A
PART-C
DISPLAY WS-SUM
STOP RUN
3.DATA DIVISION
01 WS-A PIC X (10)JUSTIFIED RIGHT
PROCEDURE DILVISION
ACCEPT WS-A
IF WS-A NEGATIVE
DISPLAY IT IS NEGATIVE
ELSE
DISPLAY IT IS POSITVE
END-F
STOP RUN
If WS.A =’CBSI’ what is the output?
4. DATA DIVISION
01 WS.A PIC S99
PROCEDURE DIVISION
PARA.A.
ACCEPT WS.A.
IF WA.A IS NEGATIVE
DISPLAY “IT IS NEGATIVE”
ELSE
DISPLAY “IT IS POSITVE”
END-IF
STOP RUN
IF WA.A is –20, what is the output?
5.
MOVE 0 TO X
PERFORM PARA-B UNTIL X = 0
PARA-B
ACCEPT WS-A
COMPUTE WS-SUM = WS.SUM +WA-A
ADD 1 TO X
PARA-C
DISPLAY WS-SUM
How many times PARA-B gets executed?
PAGE-3
COBOL PRACTICE TEST-3
- TWO TECHINQUES FOR SIMPLIFTYING THE DESIGN OF A CONOL PROGRAM AND ACILITATING DEBUGGING ARE…………&……….
- AN ……………. STATEMENT INDICATES WHICH FILES ARE INPUT AND WHICH ARE OUTPU
- (T OR F) A PERFORM…….UNTIL INSTRUCTION EXECUTES A MODULE REPEATEDLY UNTIL SOME CONDITION IS MET
- (T OR F)IF 1370 IS READ INTO A FIELD WITH A PIC CLAUSE OF 99V99 IT WILL STORE AS 13^70
- (T OR F)IF THE PRECEEDING FIELD WERE MOVED TO AN OUTPUT AREA WILTH A PIC CLAUSSE OF 99.99 IT WOULD BE PRINTED AS 13.70
- (T OR F) FILE 12 IS VALID FILE NAME.
- WHEN LABEL RECORDS ARE STANDARD IS SPECIFIED HEADER AND TRAILER LABELS WILL BE…………ON INPUT FILES AND ………..ON OUTPUT FILES.
- FOR PRINT FILES LABNEL RECORDS ARE…………….
- THE BLOCK CONTAINS CLAUSE IS USED ONLY FOR………..
10. WRITE AN FE ENTRY FOR AN INPUT SALES FILLF B AND A DISK, BLOCKED 20 WITH 100 POSITION RECORDS AND STANDARE LABELS
11. MAKE ANY NECESSARY CORRECTIONS TO THE FOLLOWING IN DATA DIVISION DATA DIVISION
FILE-SECTION
FD SALF FILE.
LABELS ARE OMITIED.
12. LEVEL……..TO………MAY NE USED TO REPRESENT FIELDS WITHIN A RECORD
13. (T OR F) THE
14. TO PRINT ‘ZEROS’ RESULTS IN THE PRINTING OF ………TO PRINT ZEROS RESULTS IN THE PRINTING OF ……..ZEROS IS CALLED A ……..
15. THE COBOL RESERVE WORD ………….CAN BE USED TO DENOTE AN AREA OF A RECORD THAT WILL NOT BNE USED FOR PROCESSING
16. WHAT ILF ANYTHING IS WRONG IN THE FOLLOWING NUMERIC LITERALS.
(A) 123 (B) 15.8 (C) 1,000,000,00 (D) $38.90 (E) 58
17. WHAT IF ANYTHING IS WRONG IN THE FOLLOWING NON-NUMERIC LITERALS.
A. ‘THIS IS CODE-1’ B. ‘INPUT’ C.’ZERO’ D. ‘123’ E.’ ‘
18. A PIC CLAUSE OF 9V9 INDICATES A………POSITION NUMERIC DATA FIELD.
19. (T OR F) PIC CLAUSE CANNOT BE DESCRIBNED ON THE GROUP LEVEL.
20. (T OR F) A DATRA NAME OR IDENTIFIER CANNOT EXCEED 30 CHARACTERS.
21. LEVEL NO ………IS USED FOR CONSTANTS.
22. IN SEQENTIAL FILES, FILE IS OPENED IN ………MODE TO APPEND A RECORD.
23. WHEN A FILE IS OPENED IN OUTPUT MIODE…………,……….&………. ARE THE OPERATIONS PERFORMED.
24. (T OR F) THE ORDER IN WHICH FIELDS ARE SPECIFIED IN REOCRD DESCRIPTION IS NOT SIGNIFICANT.
25. CORRECT THE FOLLOWING DIVISION ENTRIES
DATA DIVISION
FILE_SECTION
FD SALES HERE
01 INPUT
05.TRANS.NO PICTURE 9999
05.TRANSACTION NAME PICTURE 20X
05.ADDRESS
10 NUMBER PICTURE XXXX
10 STREET PICTURE A(15)
10 CITY PICTURE AAA
05.CREDIT RATING PICTURE XX
10 CREDIT-CODE PICTURE X
10 LIMIT OF PURCHASE PICTURE X
05.UNIT-PRICE PICTURE 99.9
05.QTY-PURCHASED PICTURE 9(5)
05.DISCOUNT-% PICTURE V99
26. STATEMENTS ARE EXECUTED IN ORDER __________UNLESS A ___________ OCCURS. (2)
27. THE PERFORM PARAGRAPH-NAME UNTIL (CONDITION) TRANSFERS CONTROL TO THE ____________. WHEN THE CONDITION SPECIFIED IS MET. CONTROL RETURNS TO _________. (2)
PAGE-4
COMPLETE THE FOLLOWING SENTENCE
(A) A HYPHEN (-) IN COLUMN 7 IS USED TO INDICATE________
(B) AN ASTERISK (*) IN COLUMN 7 IS USED TO INDICATE________
(C) A SLASH (/) IN CLOUMN 7 IS USED TO INDICATE________
(D) COLUMNS 1 TO 6 ON THE CODING SHEET IS USED FOR ________
(E) COLUMNS 73 TO 80 ON THE CODING SHEET IS USED TO FOR ________
(F) 78 LEVE NUMBER IS USED FOR ________
2.________AND________ STATEMENTS ARE REQUIRED FOR MINIMUM NUMBER OF LINES SUCCESSFULLY COMPILE THE COBOL PROGRAM.
3. ________,________,________AND ________STATEMENTS ARE REQUILRED FOR MINIUMUM NUMBER OF LINES SUCCESSFULLY RUN THE COBOL PROGRAM.
4. INDICATE WHICH OF THE FOLLOWING CORRECTLY COMPLETES THE STATEMENTS 77 LEVEL ENTRIES ARE PERMITTED IN ________
(A) ANY PART OF THE DATA DIVISION.
(B) ANY PART OF THE FILE SECTION.
(C) ANY PART OF THE WORKING-STORAGE SECTION
(D) BEFORE ALL 01 LEVEL WNTRIES IN THE WORKING- STORAGE SECTION.
5. SHOW HOW THE FOLLOWING VALUES MUST APPEAR ON THE CARDS SO THAT THESE CAN BE READ WITH THE CORRESPONDILNG PICTURE SPECIFICATIONS.
SENDING VALUES PICTURE CLAUSE VALUES
* (A) 12.38 S99V99 __________
(B) 45000 99PPP ___________
© .00123 SPP999 ___________
(D) XYZ A (4) ___________
(E) 8765 $9,999,99 ___________
(F) 8765 $*,***,99 ___________
(G) 0001 $$$.$9,99CR ___________
(H) –012345 +++,++++ ____________
(I) +012345 +++,++++ ____________
(J) +012345 3 – 4 ____________
(K) 010684 99B99B99 ____________
(L) 000000 $Z.ZZZZ.ZZ _____________
(M) 000020 $$,$$$$$9 _____________
(N) 000020 $$,$$$$$$ _____________
6. INDICATE WHAT IS WRONG IN THE FOLLOWING STATEMENT
(A) IF AGE IS GREAATER THAN 58
GO TO PARA-RETILRED
MOVE 5 TO ID-CODE.
(B) IF AGE IS GREATER THAN 58
MOVE “58”TO AGE
GO TO PARA-RETIRED.
COBOL PRACTICE TEST – 2
7. PROCEDURE DIVISION.
0000-MAIN-PARA
DISPLAY “ENTER THE NUMBER “ NO ADVANCING
ACCEPT WS-A
PERFORM 1000-PARA-A WA-S TIMES
1000-PARA-A
ADD 1 TO WS-A.
2000-CLOSE-PARA.
STOP “EXIT”
STOP RUN
FROM THE ABOVE PROCEDURE DIVISION ENTRIES IF WS-A IS 5 HOW MANY _______TIMES 1000-PARA-A PERFORMS.
8. INDICATE WHICH ONE OF THE FOLLOWING IS NOT A VALID FORM OF PERFORM STATEMENT.
(A) PERFORM P1 THREE TILMES.
(B) PERFORM P1 VARUYILNG WS-1 FORM 1 BY 1 UNTIL WS-1<>
(C) PERFORM P1 UNTIL MORETHAN3
(D) PERFORM P1 THRICE
(E) PERFORM; UNTIL THREE>3
- THE STATEMESNT
PERFORM P2 VARYING WS-1 FROM 1 BY 1UNTIL WS-1<10
WILL EXECUTE P2.
(A) 9TIMES.
(B) 10 TIMES
(C) 0TIMES
(D) 1TIMES
IDENTIFY THE CORRECT ALTERNATIVE.
- WHICH ONE OF THE FOLLOWING CANNOT CAUSE MORE THAN ONE EXECUTION OF THE PARAGRAPH (S) THAT MAY BE NNAMED IN THE STATEMENT.
(A) THE SIMPLE PERFORM STATEMENT.
(B) THE PERFORM WITH TIMES OPTION
(C) THE PERFORM WITH UNTIL OPTION
(D) THE PESRFORM WITH VARYING OPTION
PAGE-5
COBOL MODULE TEST
PART-A
1. Write down the difference between the PERFORM & GOTO statements?
2. Where does the START verb is used and why it is used?
3. Specify the different syntaxes of PERFORM.
4. What is the difference between Elementary dataitem and Group dataitem?
5. What are the three main features of Visualage COBOL?
PART-B
TRUE OR FALSE
1. Fields being compared in an IF statement must always be the same size.
2. Evaluate can be nested.
3. DELETE
4. FILE STATUS clause is used to test the status before I-O operation.
5. Once condition in an EVALUATE is met, then the computer will test other condition in the Evaluate.
6. The RELEASE statement uses a filename, as does the RETURN statement
7. The SEARCH ALL can only test an equal condition.
8. If a field is not positive, it must be negative.
9. If a file is described by an SD it is not necessary to define in a SELECT clause.
10. A START statement reads a specifie record into the storage,
PART-C
1. Abbreviation of CODASYL is ________________
2. Perform when used with Until will run only if condition is _________
3. ON SIZE ERROR is invoked when _________ of data occurs in calculation.
4. The Characters in the Col.73 to 80, including a period in 73 are _______
5. In place of READ statement in an OTPUT PROCEDURE, the ________verb is used to read the records from the sort or work file.
6. RENAMES provides the capability of _____________
7. The INVALID KEY option tests the validity of the___________
8. As an alternative to the arithmetic verbs arithmetic operators can be used in conjunction with the _______verb.
9. REWRITE should be used in the _________mode.
10. if a record cab be accessed by more than one key the option to be used in indexed files is ______________
PART-D
Choose the best Answer
1. The Compiler-direction verb allows the text of routine to be included in other programs.
A) USE B) COPY C) ENTER D) INCLUDE
- The Non-numeric literal is delimited by
A) Quotation marks B) Spaces C) Brackets D) Parenthesis
- Which of the following is NOT a Valid sentence?
A) If X IS LESS THAN Z MOVE 1 TO Y
B) IF IS GRTEATER THAN –1 ADD 1TO X
C) IF X < x="Z">2 GOTO NUTS.
D) IF X IS GREATER THAN OR EQUAL TO Y MOVE Z TO 1
- which of the following clause two data items to refer to the same storage location.
A) ALTER B) OCCURS C) REDEFINES D) INDERXED
- Which of the following statement is TRUE?
A) In a SORT statement the word KEY must refer to unique data item,
B) In a SORT statement, if neither the ASCENDING nor the DESCENDING is explicitly coded, the DECENDING phrase is implied.
C) In a SORT statement the OUTPUT PROCEDURE clause and the GIVING clause are mutually exclusive.
D) SORT and MERGE are synonymous.
- Which of the two paragraphs are contemned in the INPUT-OUTPUT SSECTION?
A) I-O CONTROL & FILE CONTROL
B) FILE- DEFINITION & I-O CONTROL
C) FILE-DEFINITION & DATA-DEFINITION
D) LILNKAGE-CONTROL & REORE-CONTROL
- which verb allows the expression of mathematical functions using mathematical terminology?
A) COMPUTER B) TALLYING C) CALCULATE D) COMPUTATIONAL
- A data record describes a
A) file B) record’s position in a file C) logical record in memory D) block of data on an external storage
- A STORY work file is
A) a temporary file B) a permanent file C) a virtual file D) a temporary or permanent file depending upon how the SD is coded
- Which of the following is NOT a reserved word?
A) ON B) UNTIL C) FORMAT D) SESSCTION
- which of the following can be used with the FORM Clause?
A) DISPLAY B) MERGE C) RECEIVE D) ACCEPT
- what is the size of TABLE-H?
01 TABLE-H
01 A OCCURS 10 TIMES.
02 10 B PIC X (4)
03 10 C PIC 99
A) 6 characters B) 10 Characters C) 50 Characters D) 60 Characters
- The PERFORM..THRU format permits the execution of
A) ONE PROCIDURE B) TWO PROCEDURES C) THREE PROCEDURES D) TWO OR MOIRE PROCEDURES
- Which of the following is WRONG.
A) MOVE CORR A-REC TO B-REC.
B) MULTIPLY CORR A-REC TO B-REC
C) ADD CORR A-REC TO B-REC
D) SUBTRAT CORR A-REC TO B-REC
- The last statement to be executed in a program is normally
A) END B) EXIT C) FINISH D) STOP RUN
PAGE-6
1. FILL UP THE BLANKS
1. __________ & ___________ are the sections in Environment Division
2. Picture clause designates _________ & ________ to a data-name
3. REPORT SECTION is found in _________ Division
4. __________ & __________ are the control transfer verbs in Procedure Division
5. SPECIAL NAMES Paragraph comes in _______ Section
!! State True or False
- MOVE is a control transfer verb
- All Sections & paragraphs in PROCEDURE DIVISION are user defined
- 88 level on is used for condition names
- INSTALLATION paragraph is found in Identification Division
- Editing symbol “z” is for trailing Zero suppression
III Give the output of following Picture items
PIC ture declaration Value supplied Value displayed
9999 78961
9 (3) V99 4567
z.zz9.99 0.55
X(7) MACHAGAN5
9(6) v99 123456.678
****999 4201
+9(4) -4679
99b99b99 96
++++.99 -342
9999CR -8976
Write short answer
- Explain 4 format of PERFORM VERB? Give syntax
- Explain in BRIEF ABOUT DATA DIVISION
- Explain EVALUATE statement? Give examples.
- What are Class Sign and Relational Conditions.
Explain the OUTPUT of the following program
Working-storage section
01 ws-all-vars.
05 A PIC 9(6) VALUE 9
05 B PIC 9(3) VALUE 0
05 C PIC 9(6) VALUE 0
05 WS-num PIC 9 value 8
PROCEDURE DIVISION
First-Para.
Perform X-Para until WS-num =1
Perform O-Para
Stop
Stop run
X-Para
Computer A=a * Ws-num
Subtract 1 from Wsa-num
Add 1 to C
O- Para
Display A
Display B
Display C
Display WS-num
PAGE-7
True or False
- if a file is described by an SD, it is not necessary to define in a SELECT clause.
- the division that specifies the computer devices to be used is the DATA DIVISION
- the INPUT-OUTPUT SECTION of the ENVIRONMENT DIVISION assigns the file-names.
- a maximum of three files may be defined in the INPUT-OUTPUT SECTION.
- a file is a collection of records each of which consists of a collection of fields.
- numeric literals may contain as many as 30’characters.
- in a non numeric move, high order nonfilled position are replaced with spaces.
- a VALUE clauses may be used in the file section to initialize fields.
- DIVIDE 0 INTO A GIVING B will result in an ON SIZE ERROR condition
10. The GIVING clause must be used when a REMAINDER is specified.
11. the RELEASE statement uses a file mane, as does the RETURN statement.
12. the SEARCH ALL can only test an equal condition.
13. a SET statement is not necessary with the SEARCH ALL statement.
14. the index is automatically set at the appropriate point when a binary search is performed.
15. an OCCURS clause may only be used to define entries in the FILE SECTION.
PART-B
FILL IN THE BLANKS
- two techniques for simplyfing the design of a COBOL program and facilitating debugging are called ________________ and ________________
- a perform ____ until instruction executes a series of steps repeatedly until ________________ condition is met.
- ________________ are the entries must be coded in area A.
- The first two entries of COBOL program must always be ________________ & ________________
- In place of a READ statement in an OUTPUT PROCEDURE, the verb is used to read the records from the sort or work file.
- With the ________________ statement you can include prewritten entries in your program
- The purpose of using library functions are to ________________
- The ________________ statement joins fields or portion of fields into one field.
- A ________________ statement is used for accessing a subprogram
10. A ________________ clause is used in the data division to ensure that a field consisting of all zeros will print as blank
11. A ________________ is assigned to a specific value or a range of values that an identifier can assume.
12. A ________________ statement with out a para name, which is followed by all instructions to be executed at that point.
13. If instructions are executed step-by-step without any change in control, we call this a ________________
14. The ________________ statement is used to replace erroneous characters in an input field with other characters.
15. ADD A,B,C TO D,E GIVING F, assume A=B=C=D=E=1, the result is an ________________
PART-C
Answer all the questions.
1.How many times will the paragraph named 400-PROCESS-RTN be executed by the following PERFORM statement?
A.PERFORM 400-PROCESS-RTN
VARYING X FROM 1 BY 1 UNTIL X=10
B.PERFORM 400-PROCESS-RTN
VARYING X FROM 1 BY 1 UNTIL X>10
C.PERFORM 400-PROCESS-RTN
VARYING X FROM 0 BY 1 UNTIL X=10
2.How many times PARA-B gets executed, if N is 5.
PERFORM PARA-B N TIMES
PARA-B
ACCEPT WS-A
COMPUTE WS-SUM=WS-SUM+WS-A
PARA-C
DISPLAY WS-SUM
STOP RUN
3. DATA DIVISION.
01 WS-A PIC X(10) JUSTIFIED RIGHT
PROCEDURE DIVISION.
ACCEPT WS-A
DISPLAY WS-A
STOP RUN.
If WS-A=’CBSI’, What is the output?
4. DATA DIVISION
01 WS-A PIC 999
PROCEUDRE DIVISION
ACCEPT WS-A
IF WS-A IS NEGATIVE
DISPLAY,”IT IS NEGATIVE”
ELSE
DISPLAY “IT IS POSITIVE”
END-IF
STOP RUN
If WS-A is –20, what is the output?
5.
MOVE O TO X
PERFORM PARA-B UNTIL X=10
PARA-B
ACCEPT WS-A
COMPUTE WS-SUM = WS-SUM + WS-A
ADD 1 TO X
PARA-C
DISPLAY WS-SUM
How many time PARA-B gets executed?
PAGE-8
Fill in the blanks.
1. ____________ number of characters are in COBOL CHARACTER SET.
2. DIVISION OF COBOL should be started in area ____________
3. To make a COBOL LINE as a comment ____________ should be coded in 77 column.
4. COBOL statements start from ____________ position.
5. ____________ words have specific meaning to a compiler
6. value of literals changes with each executions of a program. [T/F]
7. in compound IF statement, logical operator NOT evaluated before OR [T/F]
8. Decimal move should be from ____________ to ____________
9. Indicated the values that the receiving field will have in each of the following cases.
SENDING FIELD RECEIVING FIELD
Picture value picture value
(a) 999V99 678.94 99V99 ________
(b) 999V99 234.56 99V999 ________
(c) x(5) ABCDE XX ________
(d) S99V99 -34.50 99 ________
(e) 9999 0560 X(6) ________
10. The paragraph in the CONFIGURATION SECTION that provides for a variety of definitions for special features to be used in a COBOL PROGRAM is the ________
11. The max of ________ characters is allowed for non-numeric literals.
12. Specify the valid and invalid identifiers given below.
(i) BASIC-SCALE (ii) DAY/NIGHT-SHIFT (iii) CBSI.P.LTD
(iv) 2BB0AX-II-ITEMS (v) OVER TIME PAY
13. Specify the valid and invalid literals given below
(i) 0.2324 (ii) -44445.34 (iii) 42.23+0.23
(iv) ‘ITEM-NO-122/34-C’ (v) ‘STOP-RUN’
14. The literal ‘’ if printed would result in the printing of ________
15. ON SIZE ERROR clause in compute verb works only when overflows beyond the target data-name size.
16. The characters in the column 73 to 80, including a period in column 73 are ________
17. The sign test will produce correct results only if A has ________ in its picture clause.
18. The specific order in which characters are represented by a computer is called ________
19. ________ number of bytes are required to store a data-item with PICS9(7)V99
20.Write the COMPUTE statement for each of the following.
(a) x = a + b / 2 – c (b) x = ab + cd / ef (c) x = ( a - b ) / ( c + d )
PAGE-9
1.Write a program that will input a file of records consisting of an item number(2 digits), item description (20 characters), and an item cost (99V99) Print the item’s description and the sale price, assuming a 30% profit margin. Selling price = (1/ 1 – profit margin)* cost. 15 marks.
2. Write a COBOL program to convert decimal numbers in to the roman representation.
3. write a COBOL program to convert a sequential file into an indexed sequential file, opening the new file in the sequential mode.
4. write a program to sort a table, in descending order of ITEM-CODE The item code and its corresponding description are described in Excerpt-5
5.indicate the errors in the following.
5.2 See Excerpt-2
5.3 MULTIPLY A BY B BY C
5.4 See Excerpt-1
5.5 SUBTRACT AMT1 AMT2 FROM AMT3 AMT4
5.6 See Excerpt-3
5.7 COMPUTE X+ Y = A
5.8 COMPUTE TOTAL = AMT1 + AMT2 ROUNDED.
5.9 See Excerpt-4
6.State True or False
6.1 A SET statement need not be specified for a SEARCH ALL statement.
6.2 A COPY statement may not be used for copying PROCEDURE DIVISION entries
6.3 the identifier used for a SEARCH verb is the table entry specified on 01 level.
6.4 Programs without syntax errors will always run properly.
6.5 A binary search is preferable to a serial search.
6.6. The RELEASE statement uses a file-name and so does a RETURN statement.
6.7 To read the record with CUST-NO 125 from a relative file, move 125 to CUST-NO key field and execute a READ statement.
6.8 Relative key clause is optional when reading or writing to a relative file sequentially.
6.9 The identifiers specified in both the called and calling programs must be the same.
6.10. With an UNSTRING statement, the delimiter specified itself is transmitted.
6.11 If section names are used in the PROCEDURE DIVISION, they must be followed by paragraph names.
PROCEDURE DIVISION.
100-MAIN-MODULE.
OPEN SALES-FILE
PRINT-FILE
PERFORM 2000-PROCESS-RTN
UNTIL ARE-THERE-MORE-RECORDS=’NO’
CLOSE SALES-FILE
PRINT-FILE
STOP-RUN
200-PROCESS-RTN
READ SALES-FILE
AT END MOVE ‘NO’ TO ARE-THERE-MORE-RECORDS
END-READ
MOVE SALES-FILE TO PRINT-FILE
WRITE PRINT-FILE
PROGRAM EXCERPT-2
SEARCH STORED-ENTRIES
AT END DISPLAY ‘NO ENTRIES FOUND’
WHEN ITEM-NO(X1) = ITEM-NO-IN
NEXT SENTENCE.
COMPUTE PRICE = QTY * WS-UNIT-PR(X1)
PROGRAM EXCERPT-3
PROCEDURE DIVISION.
100-MAIN-MODULE
SORT SORT-FILE
ASCENDING KEY S-EMP-NO
USING MASTER-FILE
OUTPUT PROCEDURE 200-ADD-TAX
PERFORM 400-PRINT-RTN.
200-ADD-TAX SECTION
OPEN OUTPUT SORT-FILE. SORTED MASTER.
PERFORM UNTIL NO-MORE-RECORDS
RETURN SORT-REC
AT END MOVE ‘NO TO ARE-THERE-MORE-RECORDS
NOT AT END PERFORM 300-RTN-1
END-RETURN
CLOSE SORTED-MASTER.
300-RTN1
MOVE 10 TO TAX-OUT
WRITE SORTED-MASTER-REC FROM SORT-REC
RELEASE SORTED-MASTER-REC.
400-PRINT-RTN
MOVE ‘YES’ TO ARE-THERE-MORE-RECORDS
OPEN INPUT SORTED-MASTER PRINT-FILE
PERFORM UNTIL NO-MORE-INPUT
READ SORTED-MASTER.
AT END MOVE ‘NO’ TO ARE-THERE-MORE-RECORDS
NOT AT END PERFORM 500-PRINT-IT
END-READ
CLOSE SORTED-MASTER PRINT-FILE
500-PRINT-IT
WRITE PRINT0REC FROM SORTED-MASTER-REC.
PROGRAM EXCERPT-4
WORKING-STORAGE SECTION.
01 STORED-AREAS.
05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE ‘YES’.
88 ARE-THERE-MORE-RECORDS VALUE ‘NO’
05 SUB1 PIC 9.
01 TABLE-IN.
05 ENTRIES OCCURS 20 TIMES.
10 CUST-NO PIC 999
10 DISCT PIC V99.
PROCEDURE DIVISION
100-MAIN-MODULE.
PERFORM 400-INITIALIZATION-RTN
PERFORM 200 TABLE-ENTRY
VARYING SUB1 FROM 1 BY 1 UNTIL SUB1 > 20
PERFORM 300-CALC-RTN UNTIL THERE-ARE-NO-MORE-RECORDS
PERFORM 500-END-OF-JOB-RTN.
200-TABLE-ENTRY
READ TABLE-FILE
AT END MOVE ‘NO’ TO ARE-THERE-MORE-RECORDS
END-READ.
MOVE T-CUST-NO TO CUST-NO(SUB1)
MOVE T-DISCT TO DISCT(SUB1)
PROGRAM EXCERPT-5
01 ITEM-ARRAY
05 ITEM-CODE OCCURS 200 PIC S999.
05 ITEM-DESC OCCURS 200 PIC X(30).
PAGE-10
1. In control break processing, we typically MOVE the control field to ________ after reading the first record.
2. What processing is performed if an input control field is equal to the control field stored in the field area.
3. What processing is performed if an input control field is not equal to the control field stored in the hold area.
4. if each control group is to begin on a separate page we would perform a heading routine at the ________ module.
5.If a final total is required it is most efficient to accumulate the final total in the ________ module
6. A the control break module, we must print ________, initialize ________ at zero and move ________
7. When each individual record results in the printing of an output line, we call this ________
8. A first ________ procedure is the process of rekeying input to ensure that it was entered correctly the first time.
9. The ________ statement is used to replace erroneous characters in an input field with other characters.
10. A ________ is name assigned to the value of the field directly preceeding it the DATA DIVISION.
11. The sign test IF A IS NEGATIVE will produce correct results only if A has a (n) ________ in its picture clause.
12. A programmer should always stop a run if an input error is detected. (T/f)
13. Account of all records with in specific groups is referred to as a ________ total.
14. The ________ verb is used in COBOL 85 for the CASE structure.
15. Condition name can be used in an EVALUATE statement as a part of WHEN clause (T/F)
Consider the following for 16 through 19.
01 IN-REC
02 AMT1 PIC 9(5)
02 AMT2 PIC 9(5)
02 AMT3 PIC 9(5)
02 AMT4 PIC 9(5)
02 AMT5 PIC 9(5)
16. An OCCURS clause could be used in place of defining each AMT field separately because ______________
17. Suppose AMT3 and AMT4 had PCI(3) an OCCURS clause could not be used to define all the AMT fields.
18.Records in the fields with in IN-REC using an OCCURS clause.
19. To access any of the five items defined in the OCCURS clause, we must use a ______________ in procedure division.
PAGE-11
1. PERFORM DISP-PARA TEST AFTER VARYING FROM 1 BY 1 UNTIL 1 > 2 AFTER J FROM 1 BY 1 UNTIL J> 3
How many times DISP_PARA executes and after execution what are values of 1 and j respectively.
(a) 11:3 & 4 (b) 6:3 & 4 (c) 12:4 & 5 (d) none
2. 01.cnt PIC 9(4)
_______________
PERFORM COUNT-PARA VARYING CNT FROM 1 BY 1 UNTIL CNT > 9999
How many times the COUTN-PARA WILL BE PERFORMED.
(A)10000 (b) 9999 (c) Syntax error (d) none
3. 01 ITEM-A PIC 9(3)
01 ITEM-B REDENFINES ITEM-A PIC X(3)
MOVE ‘XYZ’ TO ITEM-A
What is wrong with the above statement?
(a) invalid Redefines (b) Invalid MOVE
(b) PIC clause not allowed in REDFINES clause (d) all are OK
4. Data names is defined in a COBOL program thus
05 TEST-FLD PIC X(5) VALUE ALL ‘*’
In the PROCEDURE DIVISION. The following statement is executed.
MOVE ‘$’ to TEST-FLD
The field then contains
(a) $**** (b) $bbbb (c) ****$ (d) bbbbb (e) *****
5. 01 ITEM-A PIC X(3) VALUE ‘XYZ’
77 ITEM-B PIC X(3) VALUE ‘ABC’
Which of the following statement is true?
(a) ITEM-A & ITEM-B are not of same size
(b) ITEM-A is a group level ITEM-B is at sub level.
(c) ITEM-A & ITEM-B are of same size
(d) 01 & 77 level items cannot be compared.
6. What is syntactically wrong in this?
FILE SECTION
FD TEST-FILE
01 TEST-REC 1
05 FLD-1 PIC X(40)
05 FLD-2 PIC X(20)
01 TEST-REC 2 REDEFINES TEST-REC 1
05 FILLER PIC X(60)
(a) redefines is not allowed in the FILE SECTION.
(b) redefines is allowed by not FILLER under redefines.
(c) Elementary item under redefines should not exceed 50 bytes.
(d) VALUE clause should be given along with redefines.
(e) nothing wrong with the syntax.
7. which of the following uses least of storage for storing numbers:
(a) X(5) (b) 9(5) (c) 9(5) COMP (d) 9(5) COMP-3
8. a field in DATA DIVISION is declared thus.
77 TEST-A PIC 9(5) COMP-3
if the following statements were executed.
MOVE 100 TO TEST-A
DISPLAY TEST-A UPON CONSOLE
The console will show
(a) 00100 (b) junk/Unreadable 5 Char (c) 100.00 (d) none
9. in a COBOL program fields are defined thus
77 TEST-A PIC S9(5) VALUE 100
77 TEST-B PIC X(4) VALUE ‘ZERO’
if a MOVE statement (see below) were to be executed
MOVE TEST-A TO TEST-B
TEST-B will contain
(a) 1000 (b) 0100 (c) 1000 (d) bb10 (e) none of these
10. 01 A
02 b PIC 9(4)
01 C PIC 9(4) VALUE 100.
MOVE C TO A ………(1)
MOVE C TO B………..(2)
Are the above two statements identical? Do they produce the same result.
(a) YES (b) NOT ALWAYS (c) NO (d) STATEMENT
(e) is wrong
11. MOVE O TO K
PERFORM
UNTIL I > 9
DISPLAY K UPON CONSOLE.
…………………..
…………………..
COMPUTE K = (I + 1)
PARA-EXIT
EXIT
(a) 10 (b) 9 (c) 0 (d) once (e) none of these
12. See the problem no. 11
value of K displayed on console will be
(a) 0 (b) 9 (c) 10 (d) 19 (e) 15
13. PERFORM PARA-A THRU
UNTIL I > 5 AFTER VARYING J FROM 1 BY 1 UNTIL J > 3
AFTER VARYING K FROM 5 BY 1 UNTIL K > 5
How many times is
(a) 15 (b) 150 (c) 5 (d) 30 (e) 75
14. 77 QTY PIC 9(3) VALUE 505
77 RATE PIC 9(3)V99 VALUE 10
77 VALUE TOTAL PIC PIC S9(5)V99 VALUE +1000
PROCEDURE DIVISION
MULTIPLY QTY * RATE GIVING VALUE-TOTAL
VALUE-TOTAL now will contain.
(a) 05050 (b) 00505 (c) 00050 (d) 00500 (e) none
15. Which of the following is true?
(a) Both COMP and COMP-3 occupy same storage but COMP is efficient in computation
(b) COMP occupies relatively less space that COMP-3 and both are equally efficient in computation.
(c) COMP-3 occupies less space than COMP by less efficient than COMP
(d) COMP occupies less space than COMP-3 but COMP-3 is efficient in computation
(e) Storage space depends on number of digits in PIC clause but COMP-3 is efficient.
16. 01 ITEM-A PIC 9(5) VALUE 12345
01 ITEM-B PIC 9(3) VALUE 120
………………
CALL ‘PROG1’ USING ITEM-A
CANCEL ‘PROG1’
DISPLAY ITEM-A ITEM-B
……………….
LINKAGE SECTIONS
01 LS-ITEM PIC X(5)
…………..
MOVE SPACES TO LS-ITEM
EXIT PROGRAM.
What is the result of DISPLAY statement.
(a) will display 1 2 3 4 5 & 420
(b) SPACES, SPACES will be displayed.
(c) SPACES, 420 will be displayed
(d) None of the above
17. WORKING STORAGE SECTION
05 TEST-ARRAY
10 FIRST-LEVEL OCCURS 5 VALUE ZERO
15 SECOND-LEVEL OCCURS 3 VALUE ZERO
20 TEST-FIELD PIC X(20)
Is this syntax OK?
(a) right syntax
(b) wrong, because VALUE clause should not be with OCCURS
(c) wrong, because VALUE clause contains ZEROS
(d) Wrong, because VALUE clause allowed only for FIRST-LEVEL
(e) Wrong, because OCCURS clause should not be used in WORKING-STORAGE SECTION
18. In a program sending/source field is defined as:
77 BASIC-IN PIC S9(5) VALUE 9475
In the receiving/destination field is defined as.
05 REP-BASIC-1 PIC $Z(5)
05 REP-BASIC-2 PIC $(6)
If the following instruction are executed.
MOVE BASIC-IN TO REP-BASIC-1 REP-BASIC-2
DISPLAY REP-BASIC-1
REP-BASIC-2
The value of REP-BASIC-1 and REP-BASIC-2 will be (indicate space by ‘b’)
(a) $SS947 and $ZZ9475 (b) $b9475 and b$9475
(c) b$9475 and bb$475 (d) 09475b and $$947
19. BASIC = 2500
HRA = 1500
(a) IF BASIC > 2000
IF HRA NOT <>
(b) IF (BASIC > 2000) AND (HRA NOT <>
PERFORM X-PARA
If the statement are coded like (a) or (b) PARA-x is anyway performed. [T/F]
20. CARDINALITY = 1/FILTER FACTOR
21. The index mechanism used in DB2 is
(a) Simple index (b) B-TREE index (c) Both (d) none
22. The SQL codes related to deadlock are
(a) RUNSTATS (b) LOAD (c) EXPLAIN (D) NONE
23. Following utility should be run to make the indexes added to a table effective in choosing access path
(a) RUNSTATS (b) LOAD (c) EXPLAIN (d) NONE
24. all views are updateable [T/F]
25. what is the SQL error code related to TIMESTAMP
(a) -180 (b) -511 (c) -203 (d) -818
26. The command used in DB2 to find out whether PLAN is using table space scan or index space for retrieving a row is
(a) SELECT (b) EXPLAIN (C) RUNSTATS (d) NONE
27. NUMLKTS and NUMLKUS are defined by DBA. To limit the number of locks over all table spaces and a particular table space respectively having a lock size of ANY [T/F]
28. what is the advantage of having the CURSOR with ‘WITH HOLD’ option.
(1) it will not close the cursor at time of COMMIT
(2) it will not close the cursor at time of ROLLBACK
(3) it will not close the cursor at the ‘END OF THE TASK’
(a) 1 only (b) 2 only (c) 3 only (d) 1 or 2 only (e) 2 or 3
Page-12
1. __________ IS THE ONLY DIVISION OF A COBOL PROGRAM THAT MAY VARY DEPENDING ON THE COMPUTER USED.
(A) IDENTIFICATION DIVISION. (B) ENVIRONMENT DIVISION
(C) DATA DIVISION (D) PROCEDURE DIVISION
2. THE TECHNIQUES FOR SIMPLIFYING THE DESIGN OF A COBOL PROGRAM AND FACILITATING DEBUGGING ARE _________ AND _______
(A) FLOW CHART & PSEUDO-CODE
(B) STRUCTURE PROGRAMMING & TOP-DOWN APPROACH
(C) DESK CHECKING & PROGRAM WALK THROUGH
(D) NONE
3. RERUN CLAUSE APPERS IN _________ PARAGRAPH OF _________ SECTION OF __________ DIVISION.
4. FOR PRINT FILES, LABEL RECORDS ARE ________
(A) STANDARD (B) OMITTED
(C) OPTIONAL (D) NONE
5. PERFORM PROCEDURE –NAME UNTIL CONDITION
THIS WILL PERFORM PROCEDURE UNDER PROCEDURE-NAME ONLY WHEN
SPECIFIED CONDITION IS __________ (MET/NOT MET)
6. IF THERE AREA 15 RECORDS TO BE READ THE __________ ATTEMPT TO READ A RECORD CAUSES AN ATEND CONDITION TO BE EXECUTED.
(A) 14 (B) 15 (C) 16 (D) NONE
7. WHICH OF THE FOLLOWING IS THE HIERARCHY ORDER IN COMPOUND
CONDITION (1) AND (2) OR (3) NOT
(A) 1,2,3 (B) 2,3,1 (C) 3,2,1 (D) 3,1,2
8. CHOOSE THE EQUIVALENT STATEMENT FOR THE FOLLOWING NEGATED CONDITION
IF NOT (A = B AND C = D )
(A) IF A NOT= B AND C NOT= D
(B) IF A NOT= B OR C NOT= D
(C) IF A = B OR C = D
(D) IF A NOT= B OR C = D
9. LITERALS IN A INSEPECT STATEMENT MUST BE SINGLE CHARACTERS OR FIQURATIVE CONSTANTS.[T/F]
10. A MAXIMUM OF _________ LEVELS OF OCCURS MAY BE USED WITH THE COBOL 85
(A) 5 (B) 6 (C) 7 (D) 8
11. THE LAST STATEMENT IN CALLED PROGRAM IS _________
12. WHAT ARE THE THREE PRIMARY PURPOSE OF COLUMN 7 IN A COBOL PROGRAM?
13. FIND OUT THE LOGICAL ERRORS IN THE FOLLOWING PROGRAM AND WRITE THE FOLLOWING PROGRAM AFTER MAKING APPROAPRICATE CORRECTIONS
1000-MAIN-MODULE
OPEN_________
PERFORM 2000-CALC-RTN
UNTIL ARE-THERE-MORE-RECORDS=’N’
2000-CALC-RTN
READ_________
AT END MOVE ‘NO’ TO ARE-THERE-MORE-RECORDS
END-READ
___________________
___________________
___________________
14. FIND OUT THE SYNTAX ERRORS IN THE FOLLOWING INSTRUCTIONS
(A) READ INFILE-1, INFILE-2
AT END MOVE ‘NO’ TO MORE RECORDS
(B) OPEN FILE-1 FILE-2 AND FILE-3
(C) WRITE REC-A AT END MOVE O TO WS-EOF
(D) READ FILE
AT END MOVE 1 TO WS-EOF WRITE FILE-LINE
(E) CLOSE INPUT IN-FILE OUTPUT OUT-FILE
15. MATCH THE FOLLOWING ACTIONS ON FILES WITH APPROPRIATE MATCH TO BE FOLLOWED IN THEIR SYNTAX
A. _____ FILE-NAME B. _____ RECORD-NAME
1. READ _____ (A/B) 2.WRITE _____ (A/B)
3. DELETE _____ (A/B) 4.START _____ (A/B)
5. RELEASE_____(A/B) 6.RETURN _____ (A/B)
16. WHICH OF THE FOLLOWING RULES ARE CORRECT FOR FORMING NUMERIC LITERAL.
(A) IT SHOULD CONTAIN 1 TO 20 DIGITS
(B) - OR – SIGN MAY APPEAR TO THE LEFT OR RIGHT OF THE NUMBER
(C) DECIMAL POINT SHOULD NOT APPEAR AS LEFT MOST CHARACTER OF THE LITERAL
(D) DECIMAL POINT SHOULD NOT APPEAR AS RIGHT MOST CHARACTER OF THE LITERAL
17. WHICH OF THE FOLLOWING DIVISIONS ARE OPTIONAL IN COBOL 85
(1) IDENTIFICATION DIVISION (2) ENVIRONMENT DIVISION
(3) DATA DIVISION (4) PROCEDURE DIVISION
(A) ALL 4 DIVISION (B) 2,3,4 ONLY
(C) 2,3 ONLY (D) 2 ONLY
18. “PROGRAM COLLATING SEQUENCE IS XXXX” IS THE STATEMENT THAT SHALL APPEAR IN
(A) SOURCE-COMPUTER PARAGRAPH OF CONFIQURATION SECTION
(B) OBJECT-COMPUTER PARAGRAPH OF CONFIQURATION SECTION
(C) SPECIAL-NAMES PARAGRAPH OF CONFIQURATION SECTION
(D) NONE
19. ‘MULTIPLY A BY B ‘ THE RESULT WILL BE STORED IN
(A) A (B) B (C) ‘GIVING’ OPTION IS MISSING (D) NONE
20. WHICH OF THE FOLLOWING ONE CANNOT BE CHECKED WITH CLASS TEST
(1) NUMERIC (2) ALPHABETIC (3) ALPHABETIC-UPPER
(4) ALPHABETIC-LOWER (5) ALPHANUMERIC
(A) 1 ONLY (B) 4 ONLY (C) 3ONLY (D) 5 ONLY
(E) 3 AND 4 ONLY
21. THE SEARCH STATEMENT IS USED TO PERFORM __________ (BINARY/SERIAL)
22.HOW MANY TIMES WILL THE PARAGRAPH 4000-PROCESS-RTN BE EXECUTED BY THE FOLLOWING PERFORM STATEMENT
(A) PERFORM 4000-PROCESS-RTN VARYING X FROM 1 BY 1 UNTIL X = 10
(B) PERFORM 4000-PROCESS-RTN VARYING X FROM 1 BY 1 UNTIL X > 10
(C) PERFORM 4000-PROCESS-RTN VARYING X FROM 0 BY 1 UNTIL X = 10
(D) PERFORM 4000-PROCESS-RTN WITH TEST AFTER VARYING X FROM 1 BY 1 UNTIL X = 10
(E) PERFORM 4000-PROCESS-RTN VARYING X FROM 1 BY 2 UNTIL X = 10
23. FIND WHETHER THE FOLLOWING STATEMENTS ONE TRUE/FLASE
(A) RELEASE MUST BE USER IN INPUT PROCEDURE.
(B) RETURN MUST BE USED IN OUTPUT PROCEDURE.
(C) THE ONLY METHOD FOR SORTING DISC FILES IN WITH THE USE OF THE SORT STATEMENT IN COBOL
(D) ONLY INPUT PROCEDURE CAN BE USED WITH MERGE STATEMENT
(E) ONLY OUTPUT PROCEDURE CAN BE USED WITH MERGE STATEMENT
(F) LABEL RECORDS ARE CHECKED FOR OUTPUT FILES AND CREATED FROM INPUT FILES.
24. CHECK WHETHER THE FOLLOWING ARTHIMETIC OPERATIONS ARE CORRECT/INCORRECT
(A) SUBTRACT AMT1 AMT2 FROM AMT3,AMT4
(B) DIVIDE AMT BY 5 REMAINDER REM-1
(C) COMPUTE TOTAL = AMT1 + AMT2 ROUNDED
(D) COMPUTE X+Y =A
25. MATCH THE FOLLOWING
(A) ITERATION (1) EVALUATE
(B) SELECTION (2) PEFORM _____UNTIL
(C) CASE-STRUCTURE (3) AND
(D) COMPOUND CONDITIONAL (4) IF-THEN-ELSE
26. LIST OUT THE ERRORS IN THE FOLLOWING SEARCH ALL STATEMENT IF ANY
SET X1 TO 1.
SEARCH ALL WEIGHT-TABLE
ALL END PERFORM 6000-ERR-RTN
WHEN WS-MAX-WEIGHT(X1) <>
MULTIPLY WEIGHT-IN BY WS-RATE(X1) GIVING WS-COST
END-SEARCH
PAGE-13
- IF YOU WISH TO ACCESS FOR RECORDS IN A ROW FROM INDEXED SEQUENTIAL FILE STARTING WITH KEY 78108 AND THEN FOUR RECORDS IN A ROW BEGINNING WITH 98411, YOU WOULD EXECUTE.
A. EIGHT START STATEMENTS AND EIGHT READ STATEMENTS.
B. TOW START STATEMENTS AND TWO READ STATEMENTS.
C. ONE START STATEMENT FOLLOWED BY READ STATEMENTS FOUR TILMES THEN ANOTHER START STATEMENT THAT IS FOLLOWED BY FOUR READ STATESMENT.
D. NONE OF THE ABOVE.
- CONSIDER THE FOLLOWING PROCEDURE DIVISION STATEMENT.
INSPECT ALPHA TALLYING COUNTER FOR LEADING “A”
LET THE PICTURE OF ALLPHA BE X (20) AND SUPPOSE WITH INITIAL CONTENT IS AS FOLLOWS; AHANBAbbnmahBMAITY (WHER b DENOTES SPACES ) IF COUNTER (WHOSE PICTURE ILS 99 ORGINALLY CONTAINS 08, THEN ATER EXECUTION OF THE INSPECT STATEMENT, COUNTER WILL HAVE
A. 13 B.09 C.23 D.5
- IDENTIFYILNG THE INCORRECT STATEMENT FROM THE FOLLOWING;
A. ELEMENTARY DATA ILTEMS WHICH ARE PART OF DIFFERENT STORGE FIELDS CAN BE ORGANZWD IN TO A NEXT FIELD BY THE USE OF THE REDEFINES CLAUSE.
B. THE REDEFINES CLAUSE CANNOT BE USED AT THE 01 LEVEL OF THE FILE SECTION
C. THE REDEFINES CLAUSES CANNOT BE USED WITH DATANAMES AT DIFFERENT LEVELS.
D. THE REDEFINES CLAUSSE TO BE REFERRED BY DIFFERENT DATANAMES.
- STUDY THE DATA DIVISION ENTRIES AND 3 PROCEDURE DIVISION ENTRIES GIVEN BELOW;
01 END-OF-FILE-SWITCH PIC XXX
88 NO-MORE-RECORDS VALUR “YES”
88 MORE-RECORDS VALUE “NO”
- READ SAMPLE-FILE
i. AT END MOVE “YES” TO NO-MORE-RECORDS
- IF NO-MORE-RECORDS IS EQUAL TO “YES”
GO TO LAST-PARA.
- IF NO-MORE-RECORDS GO TO LAST-PAGE
WHICH OF THE FOLLOWING STATEMENTS IS TRUE.
A. PROCEDURE DIVISION ENTRIES 1. AND2.ARE WRONG.
B. PROCEDURE DIVISION ENTRY 2 ALONE IS WRONG.
C. PROCEDURE DIBVISION ENTRY 1 ALONE IS WRONG
D. ALL THE ENTRIES ARE CORRECT.
- WHICH OF THE FOLLOWING STATEMENTS IS INCORRECT
PICTURE OF FIELD VALUE MOVED TO FIELD EDITED VALUE
A. ZZ99.99 245 b245.00
B. ZZ.Z99 2456 b2,456
C. –9999 382 b0382
D +9999 382 +0382
5.GIVE
01 EXAMPLE
02 A PIC 9(4)V99
02 B REDEFINES A.
04 C PIC 99V9
04 D PIC 9(3)
WHAT ARE THECONTENTS OF C AND D AFTER THE STATEMENT MOVE 12.34 TO A HAS BEEN EXECUTED;
A. C=001 D=234 B. C=123 D=400 C. C=123 D=004 D. C=012 D=340
7. THE USE OF A SUBPROGRAM IN A COBOL ENVIRONMENT IS MOST APPROPRIATE FOR WHICH OF THE FOLLOWING SILTUATIONS;
A. TO PRINT EDTAIL REPORT HEADINGS IN THE VASRIOUS APPLICATION PROGRAMS.
B. TO READ SEQUENTIAL FILES ILN THE VARIOUS APPLICATION PROGRAMS.
C. TO FIND THE NUMBER OF DAYS BETWEEN ANY TWO GIVEN DATES IN THE VARIOUS APPLICATION PROGRAMS.
D. NONE OF THE ABOVE SITUATIONS.
8. SEGMENTATION OF A COBOL PROGRAM IS RESORTED TO ESSENTIALLY WHEN;
A. THERE ARE MORE THEN SIX FILES IN A PROGRAM.
B. WHEN ALL THE FILES ARE INDEXED FILES.
C. WHEN THE PROGRAM IS TOO LARGE FOR THE MEMORUY AVAILABLE.
D. WHEN THE PROCEDUREDIVISION EXCEEDS 200 STATEMENTS.
9. WHICH ONE OF THE FOLLOWING IS CORRECT
A. THE ALTER VERB CAN BE US4D TO CHANGE THE CONTENTS OF A DAIENAME.
B. THE RETURN STATEMENTS RELEASE A FREED PERIPHERAL TO THE OPERATING SYSTEM.
C. THE CALL STATEMENT WHEN EXECUTED RINGS THE
10. CONSIDER THE FOLLOWING PROGRAM STATEMENTS;
MOVE 0 TO SW NO-OF-REC
PERFORM PRT-OUT UNTIL SW=1
DISPLAY
…………………
PRT-OUT
READ IN-FILE AT END 1TO SW.
WRITE OUT-FROM IN-REC
ADD 1 TO NO-OF-REC
IF THE IN-FILE CONTAIN 1000 RECORDSWHAT VALUE WILL BE DISPLAYED AFTER THE PERFORM IS OVER
A. 1000 B.1001 C 1 D.NONE OF THE ABOVE SINCE THERE IS A SYNTAX ERROR
11. STUDY THE FOLLOWING RECORD DEFINITION AND ANSWER THE QUESTION GIVEN BELOW;
(1) 01 ORDER-RECORD.
02 OUR-HEADER PIC X(50)
02 ITEM-COUNT PIC 99
02 OUT-ITEM PIC X(20) OCCURS 1TO 12
TIME DEPENDING ON ITEM-COUNT.
(2) 01 NAME-AMD-ADDRESS.
02 N-AND-A-LINE OCCURS 5 TIMES.
03 LLINE-LENGTH PIC 99
02 N-AND-A-CHARCTER PIC X OCCURS 1 TO 2
03 DESPENDING ON LINE – LENGTH
(3) 01 SALES-LIST
02 SALESMAN-COUNT PIC 99
02 SALES PIC (6)1 TO 10 DEPENDING ON SALESMAN-COUNT.
(4) 01 ORDER-RECORD
02 NO-OF-BRANDS PIC 99
02 BRAND-PURCHASED OCCURS 1 TO 14 TIMES DEPENDING ON NO-OF-BRANDS.
03 BRNAME PIC X(10)
03 BRQTY PIC 9(6)
WHICH OF THE FOLLOWING STATEMENTS IS TRUE;
A. (1) AND (2) ARE VALID B. (1) AND (4) ARE VALID
C. (1) (3) AND (4) ARE VALID D. ALL ARE VALID
12. CONSIDER THE FOLLOWING DATA DIVISION ENTRIES.
77 FIELDS-1 PIC X(5)
77 FIELDS-2 PIC X(5)
77 FIELDS-3 PIC X(5)
77 DATA-FIELD PIC X(12) VALUE IS ABCDEFGHIJKL” WHAT WILL BE THE CONTENTS OF FIELD-1 FIELD-2 AND FIELD-3 RESPECTIVELY AFTER EXECUTION OF THE FOLLOWING OF THE FOILLOWING STATEMENTS;
UNSTRING DATA-FIELD DELIMITED BY “C” INTO FIELD-1, FIELD-2, FIELD-3
(A) Abbbb, DEFGB, HIJKB (B)Abbbb, DEFGH, bbbbb
( C ) ABCDE, FGHIJ, KLbbb (D) UNPREDICTABLE BECAUSE OF ERROR IN STATEMENT.
13. GIVEN THE FOLLOWING SORT FILE DESCRIPTION
SD ANY-SORT-FILE
BLOCK CONTAINS 10 RECORDS
RECORDS CONTAINS 200 CHARACTERS
LABNEL RECORDS ARE STANDARD.
WHILCH OF THE STARTEMENT GIVEN BELOW IS TRUE;
(A) BLOCK CONTAINS CLAUSE IS INVALILD
(B) BLOCK CONTAINS AND RECORD CONTAINS CLAUSE ARE INALID
(C) BLOCK CONTAINS AND TABLE LABEL RECORDS CLAUSES ARE INVALID
(D) ALL CLAUSES ARE INVALID
14. C1, C2 AND C3 ARE THREE CONDITIONS WHOSE STATUS IS AS FOLLOWS;
C1-TRUE C2-FALSE C3-TRUE
THE FOLLOWING FOUR EXPRESSIONS INVOLVE A COMBINATION OF THESE CONDITIION AS FOLLOWS. STUDY THEM, AND CJHOOSE WHICH OF THE STATEMENTS FOLLOWING THEM IS TRUE
1. C1 AND ( NOT C2 ) OR C3
2. ( NOT C1 ) OR ( NOT C2 AND NOT C3)
3. (C 1 OR C2 ) AND C3
4. C1 AND C2 OR C3
A. A,B AND C ARE TRUE, B. A,C AND D ARE TRUE
C. ALL STATEMENTS ARE TRUE D. ONLY C AND D ARE TRUE
15. GIVEN BELOW ARE PORTIONS OF TWO PROGRAMS;
1ST PROGRAM;
PROGRAM-ID CHANGE
……………
……………
LINJKAGE SESCTION
01 OK-STRING PIC X(80)
PROCEDURE DIVISION USING OK-STRING
DO-THIS
INSPECT OK-STRING REPLACING ALL “WITH”
DISPLAY OK-STRING.
DO-THAT
EXIT
2ND PROGRAM;
PROGRAM-ID. UPD
……………
……………
WORKING-STORAGE SECTION
01 INPUT-STRING PIC X(80)
01 OUTPUT-STRING PIC X(80)
PROCEDURE DIVISION
BEGIN
DISPLAY “TYPE A STRING (MAX 30 CHARACTERS)”
ACCEPT INPUT-STRILNG
` MOVE INPUT-STRING TO OUTPUT –STRILNG
CALL “CHANGE” USING OUTPUT-STRING
DISPLAY “OLD STRING IS”INPUT-STRING
STOP RUN
WHICH OF THE FOLLOWING IS TRUE
A. THSE PARAMENTERS IN THE CALL VERB SHJOUOD BE OK-STRILNG.
B. THE PARAMETER IN THE CALL VERB MUST BE INPUT-STRING
C. MORE THAN ON PARAMETER MUST APPEAR IN THE CALL STATEMENT
D. THE CALL STATEMENT SYNTAX IS CORRECT
16. CONSIDER THE FOLLOWING
FD FILE-1 ………
01 REC-I PIC X(80)
WORKING-STORAGE SECTION
01 WS-REC PIC X(90)
……………
READ FILE-1 INTO WS-REC AT END MOVE 1 TOEOF-FLAG
WHICH OF THE FOLLOWING IS TRUE WITH RESPECT TO THE ABOVES
A. REC-1 WILL CONTAIN NOTHING AND WS-RES WILL CONTAIN THE CONTENTS OF THE RECORD READ
B. REC-1 AND WS-REC WILL CONTAIN THE SAME SEST OF DATA
C. SYNTAX IS INVALID AND EXECUTION ERROR WILL HAPLPEN
D. REC-1 AND DW-REC MUST HAVE THE SAME SIZE
17. SOME OF THE SELECTED PART OF A PROGRAM ARE SJHOWN BELOW;
SSELECT SORT-FILE ASSIGN TO
SELECT CARD-FILE ASSIGN TO
…………..
…………..
FILE SECTION.
01 CARD-REC
03 CARD-KEY PIC X(5)
03 CARD-INFO PIC X(75)
………..
……….
SD SORT-FILE
DATA RECORD IS SORT-REC
01 SORT-REC
03 SORT-KEY PIC X(5)
03 FILLER PIC X(75)
PROCEDURE DIVISION
SORT-PARA
SORT SORT-FILE DESCENDING KEY SORT-KEY USING CARD-FILE
OUTPUT PROCEDURE IS PROCESS-PARA
…………
…………
PROCESS-PARA
…………
THE ABOVE PROGRAM SEGMENT IS
A. CORRECT
B. INCORRECT BECAUSE THE FILE CARD-FILE AND SORT-FILE ARE NOT OPENED BEFORE THE SORT STATEMENT.
C. INCORRECT BNECAUSE THE LABEL RECORDS CLAUSE IS OMITTED FOR THE SORT-FILE DECRYTION IN FILE SECTION
D. INCORRECT BECAUSE WHEN USING PHRASE IS USED THE GIVILNG PHRASSE MUST ALSO BE USED.
18. THOUGH PERFORM AND CALL ACCOMPLISH FUNCTIONS WHICH ARE SIMILAR IN NATURE, THERE ARE DIFFERENCE BETWEEN THEM, WHICH ONE OF THE FOLLOWING STATEMENTSD IS NOT A CORRECT STATEMENT OF THE DIFFERENCE;
A. PERFORM DOES NOT ALLOW ANY PARAMETERS, WHEREAS CALL DOES,
B. PERFORM REFERS TO THE SAME PROGRAM WHEREAS CALL REFERS TO A SEPARATELY COMPILED SUB-PROGRAM.
C. PERFORM CAN REFER TO ANY ONE PARAGRAPHAT A TIME WHEREAS CALL REFERS TO A SUB-PROGRAM WITH ANY NUMBER OF PARAGYRAPHS.
D. PERFORM ALLOWS A PARAGRAPH TO BE REPEATED ANY NUMBER OF THE TIMES WHEREAS CALL INVOKES THE SUB-PROGRAM ANY ONCE
19. THE USE OF INVALID KEY CLAUSE HELPS THE PROGRAMMER IN;
A. CHECKING WHETHER THE KEY FIELD HAS THE CORRECT CONTENTS.
B. CHECKING FOR A DEVICE ERROR.
C. CHECKING WHETHER A SPECIFIC FILE EXISTS.
D. CHECKING WHETHER A SPECIFIEDRECORD EXISTS IN A FILE.
20. WHEN A SEARCH STATEMENT ISEXCUTED
A. THE ILNDEX IS AUTOMATICALLY SET TO 1
B. THE SEARCHBEING WITH THE ELEMENT WHOSE OCCURRENCE NUMBER CORRESPONDS TO THE INDEX VALUE.
C. THE INDEX IS SET TO MAXIMUM NUMBER OFOCCURRENCE IN THE TABLE REFERENCED.
D. THE ILNDEX NUMBER IS SSET TO ZERO
21. THE PROCEDUREDIVISION OF A PROGRAM CONTAINS THE STATEMENT;
START MASTER-FILE KEY IS > REC-KEY
THIS CLEARLY SUGGESTS THJAT THE SSELECT CLAUSE SPESCIFICATION FOR THE MASTER FILE MUST BE;
A. INDEXED SEQUENTIAL WITH ACCESS MODE RANDOM
B. INDEXED SSEQUENTIALWITH ACCESS MODE DYNAMIC
C. SEQUENTIALWITH ACCESS MODE SEQUENTIAL
D. SEQUENTIAL WITH ACCESS MODE RANDOM
22. AN OUTPUT FILEHAS THE FOLLOWING CLAUSE ILN THE FD PARAGRAPH;
BLOCK CONTAINS 20 RECORDS
THE TOTAL NUMBER OF OUTPUT RECORDS IS NOT AN EXACT MULTIPLE OF 20 WHICH ONE OF THE FOLLOWING STATYEMENTS DESCRILBES THESITUATIONCORRECTLY
A. THE LAST BLOCK WILL NEVER GEST WRITTEN OUT.
B. THE LAST BLOCK IS PLADDED WITH CONTENTS OF THE LAST RECORD TO FILLBLOCK BEFORE IT IS WRITTEN OUT
C. THE PROGRAM WILL GET ABORTED WITH ANEXECUTION ERROR
D. THE COBOL RUN-TIME SYSTEM FILLS UKP THE REMAINNINT PORTION OF THE BLOCKWITH A PADDINGCHARACTER AND NO SPECIAL ACTION NEED BE TAKEN BY THE PLROGRAMMER TOHANDLE THIS
23.CONSIDER THE FOLLOWING DATA DIVISIONENTRIES.
01 B
05 B1 PIC X(8)
05 B2 PIC A(4)
05 B3 PIC Z(3)9.99
05 B4 PIC S9(5)V99
INDICATE WHATWILL BE THE CONTENTS OF B1, B2,B3 AND B4 AFTER THE ECECURTED OF THE FOLLOWING STATEMENT;
INITIALIZE B
REPLACING NUMERIC DATA BY ZEROES
REPLACING NUMERIC-EDITED DATA BY 11.0
REPLACING A;PHANUMERIC DATA BY SPACES
A. B1 bbbbbbbb, B2 bbbb B3bb11.0 AND B4 00000^00
B B1 SPACE B2 SPACE B3 0011.0 AND B4 0.00
C B1 SPACE B2 SPACE B3 bb11.0 AND B4 0.0
24. IDENTIFY THE CORRECT DATA DIVISION ENTRY FROM THE FOLLOWING;
A. 01 X USAGE IS INDEX
B. 01 X PIC 9 USAGE IS INDEX
C. 01 X USAGE IS INDEX PIC 9
25. EVALUTE TRANS-CODE
WHEN 1
WHEN 2 PERFORM ADD-PARA
WHEN 3 THRU PERFORM UPDATE-PARA
WHEN OTHER DISPLAY “ INVALID SENTRY”
END-EVALUATE.
IDENTILFY THE ILNCCORRECT ONE FROM THJE FOLLOWING;
A. IF TRANS-CODE IS 1 OR 2 PERFORM AND-PARA WIL BE EXECUTED
B. IF TRANS-CODE IS 2 OR 4 PERFORM UPDATE-PARA WIL BE EXECUTED
C. IF TRANS-CODE IS ANY OTHER THEN DISPLAY “INVALID ENTRY” WILL BE EVALUATED
D. IF TRANS-CODE IS 1, NONE OF THE STATEMESNTS WILL BE EXECUTED
26. EVALUTE TRUE
WHEN TRANS-CODE =1OR2
PERFORM ADD-PARA
WHEN TRANS-CODE=3
PERFORM UPDATE-PARA
WHEN TRANS-CODE =4
PERFORM DELETE-PARA
WHEN OTHER
PERFORMERPARA
END –EVALULATE,
IDENTILFY THE ORRECT STATEMENT FROM THE FOLLOWING;
A. THE CONDITION TRANS-CODE =3 WILL BE TESTED ONLYIF THE JPREVIOUS CONDITION IS VALID.
B. THE CONDITION TRANS-CODE=4 WILL BE TESTESD NOLY IF THE PREVIOUS TWO CONDITION ARE VALID
C. THE CONDITION TRANS-CODE=4 WILL BE TESTED ONLY IF THE JPREVIOUSCONDITION ARE INVALID.
D. THEOTHER WILL BE EXECUTED ONLY IF ALLTHE PREVIOUS CONDITION ARE VALID.
30. 01 SAMPLE-TABLE
02 TABLE-CELL OCCURS 100 TIMES PIC 9(5) V99VALUE ZERO
INDENTIFY THE CORRECT STATEMENTS;
1. IN THE 1974 VERSION OF COBOL WE CANNOT USSE THE OCCURS AND VALUE CLAUSESS TO ENTER THE SAMECONSTANT IN TO ALL OF THE POSITIONS.
2. THE ABOVE DECLARATION ISVALIDONLY ILN 1985 VERSION OF COBOL.
3. ONES CANNOT ASSIGN GLOBALLY A SINGLE VALUE TO ALL THE ENTRIES ILN A TABLE ILN THE 1974 VERSION OF COBOL
A 1AND 2 ARE CORRECT
B ONLY 1 IS CORRECT
C ALL ARE CORRECT.
D ONLY 2 AND 3 ARE CORRECT
28. CALCULAARE THE RECORE LENGTH FOR A RECORD WJHOSEDESCRILPTION IS GIVEN BELOW;
NUMBER 5 DIGITS,COMP
MONTH 2 DIGITS,COMP
DAY 2 DIGITS,COMP
YEAR 2 DIGITS,COMP
GROSS 2 DIGITS,COMP
TOTAL 6 DIGITS,COMP(INCLUDES 2 DECIMAL PLACES & COMP-3)
THE RECORD LENGTH (IN BYTES)
(A) 19 (B) 14 (C) 16 (D) 17
29. IDENTIFY THE VALID ENTRIES FROM THE FOLLOWING
(A) 01 RECORD-B
05 FIELD-B2
10 FILLER PIC XX
10 FIELD-B2 PIC S99
05 FIELD-B22 FIELD-B21
10 FILLER PIC XX
(B) 01 RECORD-B
05 FIELD-C23 PIC S9999-COMP-3
05 FIELD-C24 REDEFINES FIELD-C23 PIC X(3)
(C) 01 RECORD-C
05 FIELD-C1 PIC XX
05 FIELD-C3 REDEFINES FIELD-C1 PIC XX
05 FIELD-C4 REDEFINES FIELD-C3
10 FILLER PIC XX
(D) 01 RECORD-C
05 FIELD-C1 PIC XX
05 FIELD-C2 REDEFINES FIELD-C1 PIC 9(2)
30. IDENTIFY THE VALID ARITHMATIC STATEMENTS FROM THE FOLLOWING
1) ADD A TO B GIVING C
2) SUBTRACT X Y FROM W.
3) MULTIPLY X BY Y
ON SIZE ERROR
PERFORM ERR-PARA
NOT ON SIZE ERROR
DISPLAY “MULTIPLICATION VALID”
END-MULTIPLY
4) DIVIDE A INTO B
(A) ALL ARE VALID (B) 1 AND 2 ARE VALID
(C) 2 AND 3 ARE VALID (D) 2 AND 4 ARE VALID
31. CONSIDER THE FOLLOWING STATEMENTS
PERFORM PARA-B
PARA-B
PERFORM PARA-C
PARA-C
PERFORM
PERFORM PARA-B
IDENTIFY THE CORRECT STATEMENT FROM THE FOLLOWING
(A) COBOL PERMITS CYCLICAL (RECURSIVE) NESTING.
(B) COBOL DOESN’T PERMIT CYCLICAL NESTING.
(C) ONLY ANSI 1985 VERSION COBOL ALLOWS CYCLICAL NESTING.
(D) BOTH ANSI 1974 AND 1985 VERSION ALLOW CYCLICAL NESTING.
35. 01 NEW-RECORD
05 TODAYS-DATE.
10 MONTH PIC 99
10 YEAR PIC 99
05 LAST-PERIODS-DATE
10 MONTH PIC 99
10 YEAR PIC 99
10 TOTAL PIC 99V99
IDENTIFY THE VALID STATEMENTS FROM THE FOLLOWING
(A) THE ABOVE DESCRIPTION IS VALID-ONLY IN ASNI 1974 VERSION OF COBOL
(B) THE ABOVE DESCRIPTION IS VALID-BOTH IN 1974 AND 1985 VERSION OF COBOL
(C) THE ABOVE DESCRIPTION NOT VALID IN BOTH VERSIONS.
33. THE I-O STATUS CODE FOR SUCCESSFUL EXECUTION IS ‘00’. CONSIDER THE FOLLOWING ENVIRONMENT DIVISION ENTRY.
SELECT IN-FILE ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
FILE-STATUS CODE IS F-CODE
IDENTIFY THE VALID STATEMENTS FROM THE FOLLOWING
(A) IF THE FILE OPENED SUCCESSFULLY, THEN THE VALUE ‘00’ WILL BE MOVED IN TO THE FIELD F-CODE
(B) IF FILE-READ IS SUCCESSFULLY, THEN ‘00’ WILL BE MOVE INTO F-CODE
(C) IF FILE-WRITE IS SUCCESSFULLY, THEN ‘00’ WILL BE MVOED INTO THE FIELD F-CODE
(D) ALL ABOVE STATEMENTS ARE VALID.
1) FD READ-FILE
BLOCK CONTAINS 800 CHARACTERS
RECORD CONTAINS 80 CHARACTERS
2) FD READ-FILE
BLOCK CONTAINS 10 RECORDS
RECORD CONTAINS 80 CHARACTERS.
CHOOSE THE VALID STATEMENT FROM BLEOW
(A) BOTH ARE VALID AND SAME
(B) BOTH ARE VALID AND NOT THE SAME
(C) ONLY 1 IS VALID
(D) ONLY 2 IS VALID.
35. IDENTIFY THE CORRECT FORMAT FROM THE FOLLOWING
1) SORT FILENAME ON ASCENDING KEY1, KEY3 DESCENDING KEY3, KEY4 , KEY5 INPUT PROCEDURE IS PROCESS-1 USING IN-FILE GIVING OUT-FILE
2) SORT FILEMANE ON ASCENDING KEY KEY1 KEY2 DESCENDING KEY3 USING INFILE OUTPUT PROCEDURE IS PORCESS-OUT
3) SORT FILEMANE ON ASCENDING KEY KEY1 INPUT PROCEDURE IS PROCESS OUTPUT PROCEDURE IS PROCESSOUT.
4) SORT FILENAME ON DESCENDING KEY KEY1 INPUT PROCEDURE IS PROCESS1 GIVING OUT-FILE
(A) 1 AND 2 ARE VALID
(B) ALL ARE VALID.
(C) ONLY 2 AND 4 ARE VALID.
(D) 2,3, AND 4 ARE VALID.
36. IDENTIFY THE VALID STATEMENT FROM THE FOLLOWING
(A) IN THE CASE OF AN INDEXED FILE DELETION OF A RECORD READ NOT BE PRECEDED BY A SUCCESSFUL READ.
(B) REWRITE VERB IS NOT APPLICABLE FOR SEQUENTIAL FILE ORGANIZATION.
(C) WHEN AN ALTERNATIVE KEY DEFINED FOR AN INDEXED FILE, IT IS MANDATORY TO GIVE THE ‘WITH DUPLICATES’ CLAUSE.
(D) INDEXE SEQUENTIAL FILE ORGANIZATION ALLOWS A FILE TO BE OPENED IN THE EXTEND MODE.
37. IDENTIFY THE VALID STATEMENT.
(A) WHEN AN ELEMENTARY DATA ITEM IS DESCRIBED WITH THE USAGE IS INDEX CLAUSE, THE PICTURE CLAUSE SHOULD BE GIVEN AS NUMERIC FOR SUCH AN ITEM
(B) THE OCCURS….DEPENDING ON OPTION CAN BE USED WHEN THE NUMBER OF ENTRIES TO BE INCLUDED IN A TABLE IS PREDETERMINED.
(C) THE INTEGER SUBSCRIPT USED IN CONJUNCTION ITH A SUBSCRIPTED VARIABLE MAY BE A CONSTANT OR A VARIABLE.
(D) AN INDEX USED IN A SEARCH STATEMENT MAY BE INTIALIZED BY A MOVE STATEMENT.
38. CONSIDER THE FOLLOWING DATA DIVISION ENTRY:
01 W
05 WS-X PIC S99 VALUE-11
05 WS-Y REDEFINES WS-X PIC XX
05 WS-Z PIC S99
IF THE FOLLOWING STATEMENT IS EXECUTED, WHAT WOULD BE THE VALUE STORED IN WS-Z
MOVE WS-Y TO WS-Z
(A) -11 (B) 1B (C) B1 (D) 11
39. CONSIDER THE FOLLOWING PROCEUDRE DIVISION ENTRY:
OPEN EXTEND IN-FILE
IDENTIFY THE CORRECT ONE
(A) ORGANIZATION OF IN-FILE IS SEQUENTIAL AND RECORDS CAN BE ADDED IN THE BEGINNING,
(B) ORGANIZATION OF IN-FILE IS SEQUENTIAL AND RECORDS CAN BE ONLY APPENDED AT END.
(C) ORGANIZATION OF IN-FILE IS INDEXED, AND RECORDS CAN BE ONLY APPENDED AT END
40. CONSIDER THE FOLLOWING STATEMENTS.
1) IN COBOL ANSI-74 ONLY CALL BY REFERENCE IS POSSIBLE
2) IN COBOL ANSI-74 BOTH CALL BY REFERENCE AND CALL BY CONTENT POSSIBLE.
3) IN ANSI-85 COBOL BOTH CALL BY REFERENCE AND CALL BY CONTENT POSSIBLE.
4) IN ANSI-85 COBOL ONLY CALL BY REFERENCE IS POSSIBLE.
IDENTIFY THE CORRECT ONE
(A) 1 & 4 ARE CORRECT
(B) 1 & 3 ARE CORRECT
(C) 2 & 3 ARE CORRECT
(D) ALL ARE CORRECT
PAGE-14
1) IDENTIFICATION DIVISION
PROGRAM-ID PROG-1
ENVIRONMENT DIVIISON
INPUT-OUTPUT SECTION
FILE-CONTROL
SELECT IN-FILE ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FS1
SELECT OUT-FILE ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FS2.
DATA DIVISION.
FD IN-FILE
RECORD CONTAINS 33 TO 1045 CHARACTERS
BLOCK CONTAINS 10 RECORDS
RECORDING MODE IS F.
01 FS-EMP-REC-IN
05 FS-EMP-NO-IN PIC-X(5)
05 FS-EMP-NAME-IN PIC-X(20)
05 FS-EMP-SAL-IN PIC 9(6) V 99
FD OUT-FILE
RECORD CONTAINS 33 TO 1056 CHARACTERS
RECORDING MODE IS F.
01 FS-EMP-REC-OUT
05 FS-EMP-NO-OUT PIC X(5)
05 FS-EMP-NAME-OUT PIC X(20)
05 FS-EMP-SAL-OUT PIC 9(6) V99
WORKING-STORAGE SECTION
01 WS-FS1 PIC X(2)
01 WS-FS2 PIC X(2)
01 WS-STATUS PIC 9 VALUE 0
88 WS-EOF VALUE 1
PROCEDURE DIVISION
0000-MAIN-PARA
PERFORM OPEN-PARA
PERFORM READ-PARA UNTIL WS-EOF
STOP RUN
OPEN-PARA
OPEN INPUT IN-FILE
OUTPUT OUT-FILE
READ IN-FILE AT END
MOVE 1 TO WS-STATUS
IF NOT-WS-EOF
PERFORM READ-PARA
READ-PARA
READ IN0FILE AT END
MOVE 1 TO WS-STATUS
IF NOT WS-EOF
PERFORM WRITE-PARA
WRITE-PARA
MOVE FS-EMP-REC-IN TO FS-EMP-REC-OUT
WRITE FS-EMP-REC-OUT
(A) WRITE THE SYNTAX AND COMPLIATION ERRORS IF ANY?
(B) IF THERE ARE 1,003 RECORDS IN INPUT FILE ()IN-FILE) HOW MANY RECORDS WILL BE WRITTEN IN OUTPUT FILE (OUT-FILE) ?
(C) WRITE THE LOGICAL ERRORS IF ANY?
2) WHAT IS THE OUTPUT OF THE FOLLOWING PROGRAM
IDENTIFICATION DIVISION
PROGRAM-ID PROG-2
ENVIRONMENT DIVISION
DATA DIVISION.
WORKING-STORAGE SECTION
01 WS-ARRAY1
05 WS-X OCCURS 4 TIMES
10 WS-Y OCCURS 5 TIMES
15 WS-SUB PIC 9(3)
01 WS-1 PIC 9
01 WS-J PIC 9
PROCEDURE DIVISION
PEFORM 1000-FIRST-PARA
DISPLAY WS-SUB(1,1)
DISPLAY WS-SUB(2,2)
DISPLAY WS-SUB(3,3)
DISPLAY WS-SUB(4,4)
DISPLAY WS-SUB(2,1)
DISPLAY WS-SUB(3,1)
DISPLAY WS-SUB(4,2)
1000-FIRST-PARA
PERFORM 1500-ENTRY-PARA
VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 4
AFTER WS-J FROM 1 BY 1 UNTIL WS-J > 5
1500-ENTRY-PARA
PAGE-15
IDENTIFICATION DIVISION
PROGRAM-ID PROG-ID
ENVIRONMENT DIVISION
INPUT-OUTPUT SECTION
FILE-CONTROL
SELECT IN-FILE ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FS1
SELECT OUT-FILE ASSIGN TO DISK
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FS2
DATA DIVISION
FD IN-FILE
RECORD CONTAINS 33 TO 1045 CHARACTERS
BLOCK CONTAINS 10 RECORDS
RECORDING MODE IS F
01 FS-EMP-REC-IN
05 FS-EMP-NO-IN PIC X(5)
05 FS-EMP-NAME-IN PIC X(20)
05 FS-EMP-SAL-IN PIC 9(6) V 99
FD OUT-FILE
RECORD CONTAINS 33 TO 1056 CHARACTERS
RECORDING MODE IS F
01 FS-EMP-REC-OUT
05 FS-EMP-NO-OUT PIC X(5)
05 FS-EMP-NAME-OUT PIC X(20)
05 FS-EMP-SAL-OUT PIC 9(6) V 99
WORKING STORAGE SECTION
01 WS-FS1 PIC X(2)
01 WS-FS2 PIC X(2)
01 WS-STATUS PIC 9 VALUE 0
88 WS-EOF VALUE 1
PROCEDURE DIVISION
0000-MAIN-PARA
PERFORM OPEN-PARA
PERFORM READ-PARA UNTIL WS-EOF
STOP RUN
OPEN-PARA
OPEN INPUT IN-FILE
OUTPUT OUT-FILE
READ IN-FILE AT END
MOVE 1 TO WS-STATUS
IF NOT WS-EOF
PERFORM READ-PARA
READ-PARA
READ IN-FILE AT END
MOVE 1 TO WS-STATUS
IF NOT WS-EOF
PERFORM WRITE-PARA
WRITE-PARA
MOVE FS-EMP-REC-IN TO FS-EMP-REC-OUT
WRITE FS-EMP-REC-OUT
------------------------------------------------------------------------------
(A) WRITE THE SYNTAX AND COMPLIATION ERRORS IF ANY?
(B) IF THERE ARE 1,003 RECORDS IN INPUT FILE(IN-FILE) HOW MANY RECORDS
WILL BE WRITTEN IN OUTPUT FILE(OUT-FILE)?
(C) WRITE THE LOGICAL ERRORS IF ANY?
2) WHAT IS THE OUTPUT OF THE FOLLOWING PROGRAM
IDENTIFICATION DIVISION
PROGRAM-ID PROG-2
ENVIRONMENT DIVISION
DATA DIVISION
WORKING-STORAGE SECTION
01 WS-ARRAY1
05 WS-X OCCURS 4 TIMES
10 WS-Y OCCURS 5 TIMES
15 WS-SUB PIC 9(3)
01 WS-I PIC9
01 WS-J PIC9
PROCEDURE DIVISION
PERFORM 1000-FIRST-PARA
PERFORM 2000-CAL-PARA
DISPLAY WS-SUB(1,1)
DISPLAY WS-SUB(2,2)
DISPLAY WS-SUB(3,3)
DISPLAY WS-SUB(4,4)
DISPLAY WS-SUB(2,1)
DISPLAY WS-SUB(3,1)
DISPLAY WS-SUB(4,2)
1000-FIRST-PARA
PERFORM 1500-ENTRY-PARA
VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 4
AFTER WS-J FROM 1 BY 1 UNTIL WS-J > 5
1500-ENTRY-PARA
IF WS-I = WS-J
MOVE 100 TO WS-SUB(I,J)
ELSE
MOVE 1 TO WS-SUB(I,J)
END-IF
2000-CAL-PARA
PERFORM 2500-CALSET-PARA
VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 4
AFTER WS-J FROM 1 BY 1 UNTIL WS-J > 5
2500-CALSET-PARA
IF WS-I = WS-J
MULTIPLY WS-SUB(I,J) BY 4
GIVING WS-SUB(I,J)
ELSE
MULTIPLY WS-SUB(I,J) BY 4
GIVING WS-SUB(I,J)
END-IF
---------------------------------------------------------------------------------
3) IDENTIFICATION DIVISION
PROGRAM-ID PROG-3
ENVIRONMENT DIVISION
INPUT-OUTPUT SECTION
FILE-CONTROL
SELECT IN-FILE ASSIGN TO DISK
ORGANIZATION IS INDEXED.
ACCESS MODE IS DYNAMIC
RECORD KEY IS FS-REC-KEY-IN
FILE STATUS IS WS-FS1
SELECT OUT-FILE ASSIGN TO DISK
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS FS-REC-KEY-OUT
FILE STATUS IS WS-FS2
DATA DIVISION
FD IN-FILE
RECORD CONTAINS 33 TO 1045 CHARACTERS
BLOCK CONTAINS 10 RECORDS
RECORDING MODE IS F
01 FS-EMP-REC-IN
05 FS-REC-KEY-IN PIC X
10 FS-KEY-IN PIC X
10 FS-EMP-NO-IN PIC X(4)
05 FS-EMP-NAME-IN PIC X(20)
05 FS-EMP-SAL-IN PIC 9(6) V 99
FD OUT-FILE
RECORD CONTAINS 33 TO 1056 CHARACTERS
RECORDING MODE IS F
01 FS-EMP-REC-OUT
05 FS-REC-KEY-OUT
10 FS-KEY-OUT PIC X
10 FS-EMP-NO-OUT PIC X(4)
05 FS-EMP-NAME-OUT PIC X(20)
05 FS-EMP-SAL-OUT PIC 9(6) V 99
WORKING STORAGE SECTION
01 WS-REC-KEY
05 WS-KEY1 PIC X
05 WS-KEY2 PIC X(4) VALUE 0000
01 WS-FS1 PIC X(2)
01 WS-FS2 PIC X(2)
01 WS-A PIC X
01 WS-STATUS PIC X VALUE 'Y'
88 MORE-RECORDS VALUE 'Y'
88 NO MORE-RECORDS VALUE 'N'
----------------------------------------------------------------------------------
PROCEDURE DIVISION
0000-MAIN-PARA
PERFORM 1000-OPEN-PARA
PERFORM 2000-INIT-PARA
STOP RUN
1000-OPEN-PARA
OPEN INPUT IN-FILE
OUTPUT OUT-FILE
2000-INIT-PARA
MOVE WS-A TO WS-KEY1
MOVE WS-REC-KEY TO FS-REC-KEY-IN
START IN-FILE KEY IS GREATER THAN OR EQUAL TO FS-REC-KEY-IN
INVALID KEY MOVE 'N' TP WS-STATUS
DISPLAY 'NO RECORD EXISTS'
STOP RUN
NOT INVALID KEY MOVE 'Y' TO WS-STATUS
END-START
PERFORM 2005-READ-PARA
PERFORM 2010-WRITE-PARA UNTIL NO-MORE-RECORDS
2005-READ-PARA
READ IN-FILE NEXT RECORD AT END
MOVE 'N' TO WS-STATUS
DISPLAY 'NO MORE RECORDS'
END-READ
2010-WRITE-PARA
MOVE FS-EMP-REC-IN TO FS-EMP-REC-OUT
WRITE FS-EMP-REC-OUT
PEFORM 2005-READ-
CONSIDERING THE FOLLOWING DATA ANSWER THE QUESTIONS FOLLOWED
THE IN-FILE CONTAINS FOLLOWING NO OF RECORDS WITH THE VARIOUS ALPHABETS
AS PERFIX (FS-KEY-IN) IN ITS
A............440
B............340
C............240
D............101
H............10
1)IF 'A' IS MOVED TO WS-A HOW MANY RECORDS WILL BE WRITTEN INTO OUT-FILE?
2)IF 'D' IS MOVED TO WS-A HOW MANY RECORDS WILL BE WRITTEN INTO OUT-FILE?
3)IF 'H' IS MOVED TO WS-A HOW MANY RECORDS WILL BE WRITTEN INTO OUT-FILE?
4)IF 'M' IS MOVED TO WS-A HOW MANY RECORDS WILL BE WRITTEN INTO OUT-FILE?
5)LIST OUT LOGICAL AND SYNTAX ERRORS IF ANY?
-----------------------------------------------------------------------------
4) HOW MANY TIMES DOES THE FOLLOWING
OF WS-SUM AFTER EXECUTION.
MOVE 0 TO WS-J
MOVE 5 TO WS-SUM
PERFORM
(WS-J + 10)
STOP RUN
SUBTRACT 1 FROM WS-J
ADD 5 TO WS-SUM
5) IDENTIFICATION DIVISION
PROGRAM-ID PROG-4
ENVIRONMENT DIVISION
INPUT-OUTPUT SECTION
FILE-CONTROL
SELECT CUST-FILE ASSIGN TO DISK
FILE STATUS IS WS-FS
DATA DIVISION
FILE SECTION
FD CUST-FILE
BLOCK CONTAINS 2 TO 10 RECORDS
RECORD CONTAINS 10 TO 100 CHARACTERS
RECORDING MODE IS F
01 FS-CUST-REC
05 FS-N PIC 99
05 FILE-ARRAY OCCURS 2 TO 20 TIMES DEPENDING ON FS-N
10 FS-CUST-NO PIC 9(3)
10 FS-DISCT PIC V99
WORKING-STORAGE SECTION
01 WS-CUST-REC
05 WS-N PIC 9
05 WS-ARRAY OCCURS 2 TO 20 TIMES DEPENDING ON WS-N
10 WS-CUST-NO PIC 9(3)
10 WS-DISCT PIC V99
01 WS-TMP-ARRAY
05 WS-ARRAY OCCURS 2 TO 20 TIMES DEPENDING ON WS-N
10 WS-PRICE PIC 9(3)
01 WS-N PIC 9
01 WS-I PIC 9
01 WS-STATUS PIC X VALUE 'Y'
88 MORE-RECORDS VALUE ‘Y’
88 NO-MORE-RECORDS VALUE ‘N’
PROCEDURE DIVISION
0000-MAIN-PARA
PERFORM 1000-INIT-PARA
READ CUST-FILE
AT END MOVE ‘N’ TO WS-STATUS
END READ
PERFORM 2000 TABLE-ENTRY UTNIL NO-MORE-RECORDS
PERFORM 3000 DISP-PARA UNTIL NO-MORE-RECORDS
STOP RUN
1000-INIT-PARA
OPEN INPUT CUST-FILE
INITIALIZE WS-ARRAY
2000-TABLE-ENTRY
MOVE FS-CUST-REC TO WS-CUST-REC
PERFORM 2005-CALC-PARA
VARYING WS-I FROM 1 BY 1 UNTIL WS-I > WS-N
IF NOT NOT-MORE-RECORDS
PERFORM 3000-DISP-PARA
VARYING WS-I FROM I BY I UNTIL WS-I > WS-N
END-IF
READ CUST-FILE
AT END MOVE ‘N’ TO WS-STATUS
2005-CLAC-PARA
COMPUTE WS-PRICE(WS-I) = 100 * WS-DISCT(WS-I)
3000-DISP-PARA
DISPLAY ‘CUSTOMER NO :’ WS-CUST-NO
DISPLAY ‘CUSTOMER DISCOUNT :’ WS-PRICE
(A) LIST OUT THE COMPILATION AND LOGICAL ERRORS
AND CORRECT IT.
(B) AFTER THE TABLE HAS BEEN LOADED, YOU FIND 3000-DISP-PARA IS NOT PERFORMED. THAT IS COMPLIATION AND LOGICAL ERRORS ARE FOUND. THE RUN IS TERMINATED AFTER THE TABLE IS LOADED. FIND THE ERROR AND CORRECT IT.
(C) AFTER RECEIVING AN OBSCURE INTERRUPT YOU DISPLAY 3000-DISP-PARA-ENTRIES AND FIND THAT THE FEW,RECORDS, HAVE BEEN LOADED FIND THE ERROR CORRECT IT.
(D) AFTER 2000-TABLE-ENTRY EXECUTION. WILL 3000-DISP-PARA EXECUTE ? IF YES WHAT VALUES WILL IT DISPLAY?
(E) IF MY INPUT FILE CONSISTS OF A RECORD STRUCTURE AS 0400120002100031000440’ AFTER CORRECTING ALL ERRORS WHAT IS OUTPUT?
6) HOW MANY BYTES DOES THE FOLLOWING RECORD STURCTURE OCCUPY?
01 WS-RECORD
05 WS-A PIC X(3)
05 WS-B PIC 9(4) COMP
05 WS-C PIC 9(5) COMP-5
05 WS-D PIC 9(4) V 99 COMP-3 SYNC
05 WS-E COMP-1
05 WS-F COMP-2 SYNC RIGHT
05 WS-G PIC S9(4)V99
05 WS-H PIC 9(4)
05 WS-I PIC X(6) RIGHT JUST
05 WS-J PIC 9(10) COMP
7) HOW MANY BYTES DOES THE FOLLOWING WHOLE RECORD STURCTURE OCCUPY?
01 WS-RECORD1
05 WS-A PIC 9(4)
05 WS-B PIC 9(4) COMP
05 WS-C PIC 9(5) COMP-5
05 WS-D PIC 9(4) V 99 COMP-3 SYNC
01 WS-RECORDS
05 WS-E PIC 9(2) COMP
05 WS-F PIC X(4)
05 WS-G PIC 9(3) COMP-3
01 WS-RECORDS REDEFINES WS-RECORD2
05 WS-H PIC X(5)
66 WS-RECORD4 RENAMES WS-C THRU WS-RECORD2
8) THE FOLLOWING IS RECORD STRUCTURE
01 WS-RECORD
02 WS-A
05 WS-B PIC X(3)
05 WS-C PIC S9(5) COMP SYNC
05 WS-D PIC 9(4)
05 WS-E REDEFINES WS-D PIC 9(4)
02 WS-F REDEFINES WS-A PIC 9(12)
02 WS-REC
05 WS-G PIC 9(4)
05 WS-H PIC 9(4)
66 WS-I RENAMES WS-C THRU WS-REC
(A) IF THE ABOVE RECORD STURCTURE VALID LIST OUT THE ERRORS AND CORRECT
(B) HOW MANY BYTES DOES WS-RECORD WS-A,WS-F,WS-I OCCUPY?
9) THE FACT THAT ONE OR MORE RECORDS TO BE WRITTEN IN A INDEXED FILE ARE NOT IN THE APPROPRIATE SEQUENCE IS DETECTED AND INDENTIFIED BY USING THE …………………… OPTION IN CONJUNCTION WITH THE WRITE STATEMENT.
10) WHEN THE ALTERNATE RECORD KEY IS USED TO ACCESS A RECORD IN A FILE. THE FILE HAS TO BE SORTED ON THE BASIS OF THE (PRIME/ALTERNATE) KEY
PAGE-21
1. What are the COBOL language option, which is used to specify the maximum no of entries in a table and name of index of index on which it is indexed
2. DECIMAL-PINT is COMMA in …………. Paragraph is used in interchange the roles of comma and period as edit character
3. P-based versions of COBOL should include the.clause with a SELECT statement.
4. …………,……….and…………… tests can be performed using IF statement.
5. Filename must be from one to …………..characters in length contain at least one ……….. and have no……
6. A PICTURE clause 9v9 indicates a ………….. position numeric data field
7. List atleast 4 or more different type of usages in COBOL
8. Statements are executed in the order ………unless……….
9. …………&………….level number must not be used for REDEFINES clause
10. Write the syntax of RENAMES clause.
11. ………..number of storage positions must be allotted for a report item with PIC $ **** .99
12. WRITE REC-1 AT END MOVE 1 TO EOF is a valid statement. ( T or F )
13. All the RENAMES entries must be written only after last record description entry. (T or F)
14. In non-numeric move higher-order non filled positions are replaced with spaces. (TorF)
15. The value of a condition name can be changed using SET verb.
(TorF)
16. READ ……INTO and WRITE……FROM statement cannot be used for variable length records. (TorF)
17. ………..number of storage position are required for PIC
18. Which of the following usage will occupy main-storage position for PIC s9(1)
COBOL PRACTICE TEST
(A) COMP (B) COMP-3 (C) DISPLAY (D) ALL are equal.
19. The INPUT PROCEDURE is optional in METGE statement of COBOL (Turf)
20. What is the COBOL verb is used to perform binary search in a table
21. It is mandatory to specify the RELATIVER KEY IS for ALL access mode of relative files. (TorF)
22. In a SEARCH ALL statement WHEN condition can contain and of the compound operators (AND OR ) (Tor F)
23. ………….. option is used in SEARCH verb to search paralled tables.
24. A COBOL array can contains max ………. Nos. of subscripts
25. Condition names can be used in EVALUATE statement (TorF)
26. In which access mode START verb can be used
27. ………….Statement in main program enables to restore the initial stage of a subroutine or called program.
28. PERFORM
ADD 1TO WS-A
How many times the
29. MOVE 7TO WS-A
………………
………………
ADD 1 TO WS-A
How many times the PARA_A will execute
30. Before performing search using SEARCH ALL verb the dex must set using SET verb. (TorF)
PAGE-22
1. ---------------- clause used in the DATA DIVISION to ensure that a field consisting of all zeros will print as blanks.
2. The minimum number of statements required for successfully compilation and execution of COBOL program are --------- & --------------
3. The process of testing a program to eliminate errors is called ----------
4. The COBOL 85 statement that sets the numeric fields to zero numeric fields to spaces is ---------------
5. ------------ statement is used to transmit data to an index are to increase or decrease the value of index
6. A -------------- test performed to determine if a numeric field is positive or negative
7. A----------- statement is used to condense input into more compact form.
8. The level number used to declare constant fields is ------------
9. It is possible to process records before they are sorted by using the -------- option in place of the -------option
10. a ------------ statement is used to join several fields together to form one field.
11. Write the syntax for INSPECT STATEMENTS
12. what is DE-EDITING.
13. What are the editing symbols used in COBOL
14. RETURN statement is used to write sorted record to an output file after they have been processed(Tor F)
15. DIVIDE WS-A BY WS-B is valid statement (TorF)
16. A SESARCH ALL statement is not used to perform serial search in a table (TorF)
17. A file must be in sequence by key field to performs sequential update (TorF)
18. If the section names are used in the PROCEDURE DIVISION they should be followed by paragraph name (T orF)
19. records can be added to the end of a disk file if we code OPEN OUTPUT
20. Fill up the blanks.
SENDING FIELD RECEVING FIELD
PICTURE CONTENTS PICTURE DEITED RESULT
1. S99V99 12^34 $ZZ.99CR _______________
2.S99 05 $zz.99DB _______________
3. 9(4)V99 0012^34 $****.99 _______________
4. 9(6) 000092 Z (6)00 _______________
5. X(6) 123456 XXXBBXXX _______________
PAGE-23
1. FIND OUT MINIMUM OF THREE ERRORS AND WRITECORRECTED STATEMENTS/PARAS PROCEDURE DIVISION
1000-MAIN-FILE
OPEN SALES-FILE
PRINT-FILE
PERFORM 2000-CALN-PARA UNTILARE-THERE-MORE-RECORDS=NO
CLOSE SALES-FILE
PRINT-FILE
2000-CALL-PARA
READ SALES-FILE
AT END MOVE ‘NO’TO ARE-THERE –MORE-RECORDS
MOVE SALES-FILE TO RPINT-FILE
WRITE PRINT-FILE
2. FIND OUT PICTURECLAUSESS FOR U & V
01 WS-A
05 WS-A1 PIC99
05 WS-A2 PIC 99
05 WS-A3 PIC 99
01 WS-B
05 WS-A4 PIC X
05 WS-A5 PIC 99
05 WS-A6 PIC XX
66 U RENAMES WS-A1 THRU WS-A2
66 V RENAMES WS-A3 THRU WS-A6
3. WRIRTE THE RESULT ( ASSUME COBOL 74)
01 GEN-ARRAY
05 VERTIVALOCCURS 3 TIMES
15 CHAR PIC X
01 ACTUAL-ARRAY REDEFINES GEN-ARAY PIC X(9) VALUE HAYOROWEU
PROCEDUREDIVISION
MAIN-PARA
PERFORM
PERFORM PARA-B VARYING WS-J FROM 1 BY 1 UNTIL WS-A>3
PARA-B
DISPLAY CHAR (WS-J;WS-I)
4. PRODUCE OUTPUT FOR THE BELOW PROGRAM
WORKING-STORASGE SECTION
01 WS-I PIC 9
01WS-J PIC9
01 WS-K PIC 9
PROCEDURE DIVISION
MAIN-PARA
PERFORM
PERFORM PARA-B VARUYING WS-J FROM 1 BY 1 UNTIL WS-J>3
PARA-B
MULTIPLY WS-I BY WS-J GIVING WS-K
5. CONCATENATE THE IN-NAME AS LAST-NAME FIRST NAME MIDDLE NAME INTO NAME OUT AND EXTRA SPACES LEAVE AT END
01 IN-NAME
05 LAST-NAME PIC X (15)
05 FIRST-NAME PIC X (15)
05 MIDDLE-NAME PIC X (15)
01 NAME-OUT PIC X (48)
6. FINDOUT ERRORS
SD SORT-FILE
FLOCK CONTAINS 10 RECORDS
RECORD CONTAINS 200 CHARACTERS
LABEL RECORDS ARE STANDARD
7. GROUP ITEM CAN BE A RECORD KEY TorF
8. FIND THE SEQUENCEFOR THE PARAGRAPHS TO BE EXECURTED FOR THE FOLLOWING PROGRAM
PROCEDUREDIVISION
MAIN-PARA
PERFORM
STOP RUN
PARA-B
PERFORM PARA-E THRU PARA-F
PARA-C
………..
PARA-E
……..
PARA-F
………
9. 01 PRICE-LIST
05 BRAND OCCURS 25 TIMES
15 PRICE PIC 999
15 DISCOUNT PIC 99
IF THE ISt CHARACTER OF PRICE-LIST INPOSITION 1 WHAT CHARACTER POSITIONS DO THE
FOLLOWING OCCUPY DISCOUNT (1,4) BRAND (20)
A) 19 TO 20 381 TO 400 B) 21 TO 22 , 381 TO 400
C) 21 TO 22 , 101 TO 120 D) 19 TO 20 , 101 TO 120
10. 77 FIELD-1 PIC X(5)
77 FIELD-2 PIC X(5)
77 FIELD-3 PIC X (5)
77 DATA-FIELD PIC X(15) VALUE ‘ABCDEFGHIJKL’
WHAT ARE THECONTENTS OF FIELD-1 FIELD-2 FIELD-3 AFTER UNSTRING DATA-FIELD DELIMITED BY ‘C’INTOFIELD-1 FIELD-2 FIELD-3
A)ABbbbb , DEFGH, IJKbb B) ABbbbb, DEFGH, bbbbb C)ABCDE, FGHIJ, KLbbb D) ANCDE,FGHIJ,bbbbb
11. WHICH IS CORRECT
A)01 WS-K USAGE IS INDEX
B) 01 WS-K PIC 9 USAGE IS INDEX
C)01 WS-K USAGE IS INDEX PIC 9
D)01WS-K IS INDEX
12. SEARCH ALL STATEMENT REQUIRES THAT A _________OR________CLAUSE BE SPECIFIEDALONGWITH THE OICCURS AND INDEXED BY CLAUSSES OF A TABLE.
13. FINDOUTERRORS IF ANY
A) 01 RECORD-B
05 FIELD-B2
10 FILER PIC XX
10 FIELD-B21 PIC S99
05 FIELD-B22 REDEFINES FIELD-B21
10 FILLER PIC XX
B) 01 RECORD-C
05 FIELD-C1 PIC XX
05 FIELD-C3 REDEFINES FIELD-C1 PIC 99
05 FIELD-C4 REDEFINES FIELD-C3
10 FILLER PIC XX
14. 01 WS-A VALUE ‘123’
05 WS-A1 PIC 99
05 WS-A2 PIC 9 COMP
THE ABOVE DESCRIPTIONGIVES ANERROR, EXPLAIN YOUR ANSWER (BRIEFLY)
15. 01 WS-X
05 WS-A PIC 9(4)V99
05 WS-B REDEFINES WS-A
10 WS-C PIC 99V9
10 WS-D PIC 999
MOVE 12, 34 TO WS-A
WHICH IS CORRECT
A) C=001.D=234 B)C=123,D=400 C)C=012,D=340 D)C=002,D=340
16. INORDER FOR A ‘DB’ OR ‘CR’ TO BE INCLUDING JIN A EDITING THE VALUE ENTERED IN THAT FIELD MUST BE
A) GREATER OR EQUAL TO ZERO B) NEGATIVE C) NON-ZERO D) POSITIVE FOR DbNEGATIVE FOR CR
17. 77 WS-A PIC 99 VALUE 24
77 WS-B PIC 9
COMPUTE WS-B WS-A/6
GO TO A1 B1, C1 DEPENDING ON WS-B
STOP RUN
RHE RESULT OF THE ABOVE EXPERTISE IS_______?
18. THE PICTURE CLAUSE OF A COMP ITEM SHJOULOD NOT CONTAIN ANY CHARACTER OTHER THAN ______1M
19. 01WS-A1
05 WS-A PIC S99V99 VALUE+50.34
05 WS-B PIC S99V99 VALUE +50.23
05 WS-C PIC S99V9 VALUE –12.3
WHAT WILL BE THE CONTENTS OF WS-C AFTER EXECUTING THE FOLLOWING ADD WS-A WS-B GIVING WS-C
ADD WS-C TO WS-A
ADD WS-A WS-B GIVING WS-C SIZE ERROR DISPLAY “SIZE ERROR”
A)00.5 B)01.0 C)10.0 D) NONE
20. 01 SAMPLE ITEM
05 A PIC X(8) VALUE ‘ABCDEFGH’
05 B REDEFINES A
10 C PIC X(3)
10 D PIC X(2)
10 E PIC X(3)
MOVE C TO E
,MOVE D TO E
MOVE E TO C
WHAT WILL BE THE CONTENTS OF A?
21. AFTER EXECUTING THE FOLLOWING STATEMENT WHAT WILL BE THE VALUE OF THE COUNTER
01 WS-X PIC X(20) VALUE’AVBGFTYUHAAAWESDAWES’
01 COUNTER PIC 99 VALUE 08
UBWSOESCT X TALLYING COUNTER FOR LEASING ‘A’
A) 13 B)10 C)21 D) 5 E)NONE
22. THE POROCESS OF ESTABLISHING CVONNECTI9ONS BETWEEN ACTUALAND FORMAL PARAMERTERS IS CALLED___________
23. PROCEDURE DIVISION
0000-MAIN-PARA
PERFORM
ADD 1 TO WS-1
HOW MANY TIMES
24.PERFORM
AFTER WS-J FROM 0 BY –1 UNTIL WS-J<2
AFTER WS-K FROM 1BY2 UNTIL WS-K >8
HOW MANY TIME
25.SUBROUTINE SUBA
CALL ‘SUBB’USING A1,A2
SUBROUTINE SUBB
CALL’SUBC’USING B1,B2,B3
SUBROUTINE SUBC
CALL ‘SUBA’USING A1,A2
INDICATE THE ERROR
PAGE-25
1. List out the difference between Inspect and examine.
2. Where does the START verb is used and why its used
3. Rewrite should be used in the ________-mode
4. Write down the difference between perform and goto statement
5. Delete used to delete the records from file T/F
6.A sequential file can be accessed in a random fashion.
7. In the case of Rewrite …..Invalid key statement, Invalid key holds true when the record specified buy the Record key does not exist in the file T/F
8. Write the pi8c clause of file status is_______
9. If a record can be accessed by more than one key the option to be used in indexed files is _________
10. where does the linkage-section is used in the COBOL programs
Give an appropriate representation instate
Description num val result
11.amt pic $9,999.99 2,350,22 __________
12.amt pic $$,$$$,99 25,40 ___________
13.amt pic $$,$$$.$$99 0.002 ___________
14.amt3 pic z99 25 ____________
15.amt4 pic zzz.9 25 ____________
16amt5 pic$$,$$z.zzz 0.001 ____________
17 amt6 pic$,$$9,99cr -10.50
18 amt pic 99.99 -10.25 _____________
19bal pic+++9.99 -.05 _____________
20bal pic 999.9+ 35.2 _____________
21. Which of the following specification are correct
a. $$$$9(3).99cr b. $zzz9.99 c.9(5).9z d. zzzzzvzz
e.all the above.
22. In the absence of ELSE option when the conditions specfied in the IF clause is not met then program execution continues with
a. The statement that directly follows the IF
b. The next sentences
c. The next paragraph
23. The physical location of paragraphs in a program can be made explicit by assigning a numerical____________ to each paragraph name
24.As an alternative to the arithmetic verbs, arithmetic operators can be use in conjunction with the -------verb
25. The PERFORM…..THRU format permits the execution of _______procedures
a one
b. two
c.two or more
PAGE 16
1. ………….and…………are the only two compiler- directing statements in COBOL
2. What will be the content OLD-FIELD if the following statement is executed
01 DATA-FIELD PIC X (11) VALUE ‘MATHEMATICS’
01 OLD-FILED PIC X(02)
MOVE DATA- FIELD (4;2) TO OLD-FIELD
3. What will the content of DATA-FIELD after execution of the following statement if it was having “ABBREVIATE”initially
INSPECT DATA-FIELD CONVERTING “ABCDE”BY “EBCBA”
4.In COBOL 85 CASE is implemented by…………verb
5. The ……………..phrase is to use with DISPLAY Statement such that the subsequent ACCEPT statement will read data from the next character position on the same line
6. Consider the following statement
PERFORM THE
VARYFING KOUNT FROM 1BY1 UNTIL KOUNT>30
The perform is executed…………….times
7. 02 a PIC PPP999
MOVE 500 TO A
What will be the value of A after execution of above statement?
8. Attempting to add a field that contains blanks to another field will cause a to occur
9. ………………,……………are the figurative constants other than ZERO SPACE HIGH-VALUES
10. When LABEL RECORDS ARE STANDARD is specified header labels will be ……… on input files and trailer labets will be …………….on output files
11.The dollar sign can be changed to the appropriate symbol for another monetary system by the use of an entry in the ………..paragraph……………..section
12. The same storage location can be used in conjunction with 2 different data-names by use of ……….clause
13. Consider the following DATA DIVISION entry
77 A PIC X(5) VALUE IS “ARRIE”
A. Examine A TALLYING LEADING “R” will set to …………in Tally
B. Examine A REPLLACING UNTILFIRST “1”by “P” will change the content of A to
14. The SEARCH ALL statement requires that a ……………..clause be specified along with the OCCURS AND INDEXED by clauses of a table entry
15. How many levels of OCCURS are permitted with COBOL 85?
16. Which RESSERVED WORD IN COBOL IS USED to define areas within a record that will not be referenced individually during processing?
17. Is the following valid or invalid? Specify reason.
05 ITEM
10ITEMNO PIC X(4)
PIC X(20)
05 TOTAL PIC 9(5)
18.. ……………statement isussed to execute a sub-routine with the initial state rather than last used states
19. In a nested PERFORM..VARYING……….executed first
20. When two different RECORD KEYS result in the same relative location address it is said that a hashing has been produced
21. Communication section is used when calling sub-programs to pass data to and from a subprogram T/F
22. A changed program can change another program including the one that changed it
T/F
23. The operands of the using phrase in the ROCEDURE DIVISION header of the calling program must be either 01 or77 level data items T/F
24. MOVE TAX TO TOTAL
TAX TOTAL
PICTURE CONTENTS PICTURE
S9(4) .2345 X(5)
(Sing leading sesperate)
What will be the value of TOTAL after MOVE
25. How many times
01 COUNTER PIC 9
PERFORM
COUNTER FROM 1 BY 1 UNTIL COUNTER>2
MOVE A TO B
MOVE 13 TO COUNTER
26. How many times prar-x performed?
01 J PIC 9 VALUE 5
PERFORM PARA-X J TIMES
PARA-X
MOVE 18 IT J
27. 02 SAMPLE-1 PIC X(3) JUSTIFIED RIGHT
02 SAMPLE-2 PIC X(8)
02 SAMPLE-3 PIC XX/XX
What will be the content of SAMPLE-3 after execution of the following
MOVE “PQRST” TO SAMPLE-1
MOVE SAMPLE-1 TO SAMPLE-2
MOVE SAMPLE-2 TO SAMPLE-3
28. Re- grouping of elementary items in a record can be done by……..clause
29. Special reserved word DAY returns day in……….Format
30. 01 O D-RECORD
02 A PIC X(9)
02 B PIC 9(6) COMP SYNC
02 C COMP-2
02 D PIC 9(4) V99 COMP-3
How many number of bytes will OLD-RECORD occupies
31.01 VALUE-X
02 VALUE-1 PIV 9(5) VALUE 24008
02 VALUE-2 PIC 999 VALUE 987
01 VALUE-Y
02 VALUE-3 PIC 9(3)9
02 VALUE-4 PIC9(5)
MOVE VALUE-X TO VALUE-Y
After the execution of the above statement what is the values of value 8 and value 4
32. …………… clause specifies the number of buffers to be used for the sequential file
33. Blocking cannot be used for variable length records T/F
34. In SORT statement all keys must be specified as ascending or descending but not as combinations of Two T/F
35. The same file names can be specified in the USILNG and GIVING phrases of s SORT statement T/F
36. What are the paragraphs in INPUT-OUTPUT SECTION?
37. The program-planning tool specifically designed for depicting the logic in a structured program is…………….
38. 01 A PIC SSS999 99
MOVE 123456 TO A
What is the value of A
39. 01 A PIC……..9
MOVE 12345 TO A
What is the value of A
40. If the table entries are not in any sequence search is preferred
41. An input field has PICTURE Clause S999 which value you have to keyed in input held to enter a value-329
42. If multiple control breaks are used in a program the routine for producing the major level control break would always begin by performing
43. High- values refers t the largest value in the computers collating sequence this is a character consisting of ………….in a single storages position
44. …………. Is a verb used to find the erroneous characters
45. In addition to write statement a …………..verb may be used to produce output
46. With………… statement you can include prewritten entries in your program
47. The CONTROL clause is defined in the ………..entry
48. 01 price-list
03 BRANDOCCURS 25 TIMES
05 NRAND-SIZE OCCURS 4
07 PRICE PIC 999
07 DISCOUNT PIC 99
Pick out the valid identifier form the following
A. DISCOUNT (4.15)
B. PRICE (4,3) OF PRICE-LIST
C. PRICE OF PRICE-LIST (4,3)
D. BRAND-SIZE (DISCOUNT (2,3) )
49. 77 A PIC 99 VALUE 0
GO TO A1 B1 C1 DEPENDING ON A
STOP RUN
Which of the following will happen after the execution of the above statement
A. GO TO A1 B. GO TO B1 C. GO TO C1 D. CONTROL GOES TO STOP RUN
50. Segmentation of a COBOL program is resorted to essentially when
a. There are more than Six files in a program
b. When all the files are indexed files
c. When the program is too large for the memory available
d. When the procedure division exceeds 1000 statements
51. PERFORM PARA-1
VARYING A FRO 2 BY 3 UNTIL A GRATER THAN 9
AFTER B FROM 4 BY –1 UNTIL B LESS THAN 2
AFTER C FROM 2 BY 1 UNTIL C GRATER THAN 4
Execution of perform statements ends with the following values for A BAND c
A. A=10 B=4 C=5
B. A=10 B=1 C=5
C. A=10 B=4 C=2
D None of the above
52. Given the following SORT file description
SD ANY-SORT-FILE
BLOCK CONTAINS 10 RECORDS
RECORD CONTAINS 200 CGARACTERS
LABEL RECORDS ARE STANDARD
Which of the following statements given below are true
a. BLOCK CONTAINS clause is invalid
b. CLOCK CONTAINS and RECORD CONTAINS Clause are invalid
c. BLOCK CONTAINS AND LABLE RECORDS clauses are invalid
d. All clauses are invalid
53. Indicate which one of the following is not true about the SET Verb
a. The verb can be used to set one or more indexes to a particular value
b. The verb can be used to move the current value of an index to line or more identifiers
c. The verb can be used to increment one or more identifiers by a positive integral value
d. The verb can be used to decrement one or more indexes by a positive integral value
54. A COBOL program when compiled gives an error at the PROCEDURE DIVISION statement ADD 10 TO COUNTER
Which of the following situati9ns could have caused the error?
a. COUNTER HAS A PICTURE ZZZ9
b. COUNTER is not initialized to zero in the Data Division
c. COUNTER IS DECLARED IN FILE section and not in WORKING – STORAGE
d. COUNTER has a PICTURE 999V9
55. Which of the following is not a valid paragraph name
a. ZZ-99 b. ALPHA-O c.2222 d.NONE
56.The term RELATIVE SUBSCRIPT
a. Refers to the variables we use to track the next record position in a relative file
b. Refers to a data name used as a mnemonic subscript instead of a variable like
c. Refers to INDEX variables when they are used as subscripts
d. Refers to an expression such as K-12 when used as a subscript
57.Which of the following cannot help us to get the memory requirement reduced sequential files
a. REDEFINES clause b. SAME AREA clause
c. RESERVE clause d. None
58. Relative or indexed files can be referenced in the USING and GIVING phrases of the SORT statement T/F
59. When a library text is copied it should not have another COPY statement T/F
PAGE-17
1. THE REDEFINES CLAUSE CANNOT BE USED FOR LEVELS_________AND___________(1MARK)
2. THEVARIOUS TYPES OF USAGES DEFINED ILN COBOL ARE ___________,____________-AND____________ (3MARK)
3. A START VERB READS A SPECIFIC RECORD INTO STORAGE T/F
4. IF A FIELD IS NOT POSITIVE MUST BE NEGATIVE T/F
5. THE DATA DIVISION STATEMENT IN WHICH RENAMES IS USED IS ALWAYS ASSIGNED THE LEVEL NUMBER
_______________
6. WHEN ALPHANUMERIC DATA IS MOVED FROM A SENDING FIELD TO A RECILEVING FIELD ALIGNMENT
7. AN ORDERING WHICH DEFINES THE RELATIVE RANK OF ALL CHARACTERS IN A COMPUTER SYSTEM IS CALLED__________
8. DELETE IS USED TO DELETE RECORDS FROM A SEQUENTIAL FILE T/F
9. REWRITE SHOULD BE USED IN THE _____MODE
10. WHICH OF THE FOLLOWING ARE ELEMENTARY ITEMS
A. 01 B.77 C.88 D66
11. WHICH OF THESES IS A LEGITIMATE COBOOL DATANAME
A. CONMPUTRE
B. END-OF-FILE
C. DATA OF BNIRTH
D ALL
12. WHICH OF THE FOLLOWING SPECIFICATIONS ARE
A. $$$$9(3) 99CR B. $ZZZ9.99 C. 9(5).9Z D. ZZZZZVZZ
E. ALL THE ABOVE CHOICES.
13. 01 A PIC S9(9)V99 VALUE 3425.10
WHICH OF THE FOLLOWING WILL DISPLAY $ 3425.10
A. PIC$(9).99 B. PIC$Z(9).99 C. PIC $Z(8).99 D PIC $(9).99
14. 01 A PIC X(2)
WHICH OF THE FOLLOWING ARE TRUE?
A. 66 B REDEFINES A PIC X(2)
B. 01 B REDEFINES A PIC X (1)
C. 01 B REDEFINES A PIC X(2)
D. 01 B REDEFINES A PIC X (3)
15. 01 STATE-CODES PIC X (20) VALUE “NYALHALHSF;DLF LASDFG”
01 ST-CD REDFINES STATE-CODES
05 STATE-CD PIC X (20) OCCURS 10 TIMES
WHAT IS THE VALUE JOF JSTATES-CD (05)
A.H B.; C. SF D. HS
16. PICTURE CLAUSE OF FILE STATUS IS ____________
17. WHICH OF THE FOLLOFWING CORRECT?
A.VARIABLE LENGTH ARRAY CANNOT BE INITALEZED
B. ARITHMENTIC OPERATIONS CANNOT BE PERFORMED AT GROUP LEVEL
C. VARIABNLE LENGTH ARRAY SHOULD BE DECLARED AT THE ENE OF THE WORKING STORAGE SECTION
D. USIGNED VARIABLES CANNOT BE COMPARED WITH SIGNED VARIABLES.
18. WHICH OF THE FOLLOWING ARE CORRECT?
A. MOVE CORR OLE-REC TO NEW-REC
B. ADD CORR OLD-REC TO NEW-REC
C.SUBTRACT CORR OLD-REC TO NEW-REC
D. MULTILPLY CORR OLD-REC TO NEW –REC
19. __________ STATEMENT OF COBOL MOVE AS WELL AS WRITES THE CONTENTS OF THE RECORD
20. THE CHARACTERS $ AND* SHOULD NOT APPEAR IN THE SAME PIC CLAUSES T/F
21. DELETE STATEMENT PHYSICALLY REMOVES A RECORD FROM THE FILE
22. THE COMMAND TO CHAGE THE DECIMAL POINT TO COMMA IN COBOL IS________
GIVE AN APPRORIATE REPRESENTATION INSTORAGE
VALUE MOVED PIC VALUE STORED
23 –12.34 $(4).99 ___________
24. O +++++ ____________
25. +5 $ZZZ.99CR ______________
26. 0 $$$$.99 _____________
27. CRDR XXBBXX _____________
28. 16398 900909 ___________
29. HOW MANY BYTES OF STORAGE ARE REQUIRED
TO HJOLD THE FOLLOWING RECORD ___________
01 IN-REC
05 IN –GROUP OCCURS 12 TIMES
10 IN-BRANCH PIC 9(5) OCCUR 5 TIMES
10 FILLER PIC X (5)
10 O-BRANCH PIC 9(5) OCCURS 5 TIMES
30. A COMPOUND CONDITION CAN BE USED WITH
SEARCH ALL PROVIDED IT HAS A -__________
CONNECTIVES ONLY
31. RECORDS IN A FILE SHOULD NOT HAVE FIELDS OR GROPU ITEMS WITH OCCURSCLAUSES T/F
32. THE VALUES OF THE PARAMENTERS PASSED BY A CALLING PROGRAM CAN BE CHANGED BY THE CALLED JPROGRAM IFTHE JPARAMENTERS ARE
PASSED GY__________
33. THE MAXIMUM NO OF DIMENSION A TABLE CAN HAVE IN COBOL IS ___________
34. THE PICTURE CLAUSSE IS USED AT THE HIGHEST/LOWEST ________LEVEL A TABLE.
35. PERFORM LISTING WITH TEST AFTER VARYING
1 FROM 1 BY 1 UNTIL 1>2AFTER J FROM
1 BY 1 UNTIL J>3
LISTING
DISPLAY J
HOW MANY TIMES DOES LISTING GOT EXECUTED?
36. IF A R4CORD CAN BE ACCESSED BY MORE THAN ONE KEY THEOIPOTION TO BE USED IN INDEXED IS _________
37. THE START VERB CAN BE USEED WITH SEQUENTIAL
FILES T/F
38. THE ANSIVERSION OF COBOL SUPPORTED BY THE
Visual Age COMPILER IS _______
39. START AND READ NEXT VERBS NEED THE DATA FILE TO BE OPENED INTO THE RENDOM MODE T/F
40. CONDITIONAL NAMES CANNOT BE USSED ILN AN EVALUATE ATEMENT T/F
42. WHAT IS THE STATEMENT USED TO PUT A RECORD INTO A FILE FROM THE PROGRAM?
43. WHAT IS THE LENGTH OF THE FIELD 9 (8)V99
44. MATCH THE FOLLOWING
A. CONDITION 1)
B. PROGRAMMER DEFINED WORD 2) PERFORM …UNTIL
C. REDEFINES 3) TERMINATION
D. LOOPING 4) WS-END-FLAG=Y
E. END OF A SENTENCE 5) PPLIES TO STORAGE INVOLVED ANDNOT TO THE DATA THAT’S STORED IN THAT AREA
45. _________AND_____________CLAUSE CAN BE USED TO INITIALISE TABLES
46. WHICH OF THE FOLLOWING ISCORRECT
i) WORKING-STORAGE SECTION
01 WS-SALARY PIC 9(3) V99 VALUE IS ABC.ZA
LILNKAGE SECTION
ii) LINKAGE SESCTION PIC 9(3) V99 VALUE IS 536.98
A.i B.ii C.NONE D.BOTH
47. IN THE FOLLOWING SYNTAX
01 WS-GRADE PIC 99
88 FIRST-CLASS PIC 99 VALUE IS 60 TJRI 70
_____________CANNOT BE SPECIFIED
48. 78. LLEVEL ITEM ISONLY USED FOR _________
No comments:
Post a Comment