You are on page 1of 7

COBOL QUESTIONS

1. What is the length of the variable s9(05).9(02)? (a) (b) (c) (d) 7 9 8 6

(A)

2. Calculate the length of $9(05).9(03)? (a) (b) (c) (d) 10 7 9 8 (A)

3. How many bytes are allocated to WS-G-EMP-DET2 in the following code? 01 WS-G-EMP-DET1. 05 WS-ENO 05 WS-ENAME 05 WS-EADDR. 10 WS-STREET 10 WS-CITY 05 WS-SALARY 05 WS-PHONE PIC 9(04). PIC X(20). PIC PIC PIC PIC X(09). X(07). S9(05)V9(02). 9(10).

66 WS-G-EMP-DET2 RENAMES WS-ENO THRU WS-SALARY. (a) (b) (c) (d) 48 47 57 46 (A)

4. What must be the picture clause if you want to display salary as a five digit number with comma(s) in the appropriate places? (a) (b) (c) (d) PIC PIC PIC PIC 9(02),9(03) 9(03),9(01) 99.999 9(02)V9(03) (A)

5. The 'P' symbol in 'P99V99' occupies one byte. (a) True (b) False 6. How many bytes does the table in the following example occupy?

01 WS-PRICE-DET. 05 PROD-CODE 05 PRICE-REC 10 QUANTITY 10 DESC 05 PROD-PRICE (a) (b) (c) (d) 38 40 155 144

PIC X(06). OCCURS 36 TIMES PIC X(02). PIC X(02). PIC S9(09)V99.

(A)

7. 'CR' and 'DB' occupy (a) (b) (c) (d) One byte each Two bytes each Do not occupy any number of bytes None of the above

8. STRING WS-STR1' ', WS-STR2' ',WS-STR3 DELIMITED BY SIZE INTO WS-STR4 How many bytes must be allocated to WS-STR4 if WS-STR1,WS_STR2 and WS-STR3 oc cupy 4 bytes each? (a) (b) (c) (d) 15 14 16 12 (A)

9. 'Z' compresses the values in a variable to zeroes. (a) True (b) False (A)

10. How may bytes does $(05)v$(03) occupy? (a) (b) (c) (d) 10 9 8 11 (A)

11 .What is the length of the variable 9(05).9(02) a)7 b)10 c)5 d)4 (A) 12)____________ does not use any actual storage space separates the integer port ion of a numeric a)S b)V c)P d)none 13)01 W04-G-VAR (B)

03 W04-X-RUN-TIME PIC X(02) SPACES. 03 W04-X-PGM-NAME PIC X(08) VALUE 'PXXBB290'. 01 W04-TEMP-J PIC 9(09) VALUE ZEROES. a) b) c) d)

14)05 W02-num PIC 9(03) VALUE 10. occupies how many bytes? a)2 b)3 c)4 d)none 15) 05 W01-st (B)

PIC 9(05)v9(03) occupies how many bytes

a)8 b)9 c)10 d)none (A) 16. which pic clause sign is used to supress the leading zeroes of numerals ? Z - Zero supression 17. what is the output of this program ? identification division. program-id. Redef. environment division. data division. working-storage section. 01 a pic 9(3) value 125. 01 r pic 9(2) redefines a. procedure division. p-1. display(1 1) erase. display(5 5) "Value of r = " r. stop run. The output of the program will be Value of r = 12 18. Explicit SYNC Clause pic 9(1) COMP SYNC takes how many bytes? 2 - bytes 19. how many bytes are occupied by the value 100 given to the pic clause $(6) ? 4 - bytes 20. The value -2569 is stored in A of pic s9(4) SIGN TRAILING clause then how wi ll a be displayed in spool ? 256R 21. COBOL performs faster with signed fields than unsigned fields > true (A) > false

22. performance is better when using > dynam > nodynam 23. calculate the number of bytes for the following 05 TEMP PIC S9(09)V999CR > 15 > 14 (A) > 12 24. calculate the no of bytes for the following 01 WS-TEMP-TABLE. 05 WS-STU OCCURS 15 TIMES. 10 WS-SUB OCCURS 5 TIMES. 15 WS-MARK PIC 9(05). > 425 > 375 (A) > 275 25. It is possible to redefine x(200) variable field with a field of x(100) > true (A) > false 26. calculate the no of bytes 01 TEMP > 19 > 17 > 18 (A) PIC s9(15).99 SIGN LEADING SEPARATE

27. variable length tables are defined using DEPENDING ON clause > true (A) > false 28. subscripts should be declared as characters in working storage > true > false (A) 29. we cannot do arithmetic operations for index variables > true (A) > false 30. AND clause is used in linear search > true > false (A) 31.determine the size of the data item -9(4).99 (a) (b) (c) (d) 6 7 8 4

ans:

(C)

32.calculate the total number of bytes in the following 01 WS-GROUP-ONE 05 A1 PIC X(4). 05 A2 PIC 99. 01 WWS-GROUP-TWO REDEFINES WS-GROUP-ONE. 05 A3 PIC 999. 05 A4 PIC 999. 01 WS-GROUP-THREE. 05 A5 OCCURS 5 TIMES PIC 99. (a) (b) (c) (d) 22 16 12 14

ans:(b)

33.In 99v99 , 'v' does not occupy any number of bytes (a)true (b)false ans:(a) 34.comp-1 usage clause is used for (a) (b) (c) (d) single precision floating point occupying 4 bytes double precision floating point occupying 8 bytes integer values none of the above ans:(a)

35. what is the default usage clause (a) (b) (c) (d) comp comp-1 comp-3 display

ans:(d)

36. PIC s9(03).9(02) SIGN LEADING SEPARATE occupies (a) (b) (c) (d) 5 6 7 8 bytes bytes bytes bytes

ans:(c)

37.which of the following occupy 8 bytes (a) (b) (c) (d) PIC PIC PIC PIC S9(04)V9(03) S9(04).9(03) 9(05)V9(03) S9(05)V9(02)

ans:(b,c)

38. The smallest amount which can be entered through picture clause -$$$$ is (a) (b) (c) (d) -1000 -999 -9999 -100 ans:(b)

39.how many bytes does the following variable occupy? 01 WS-SALARY PIC S9(05)V9(03) CR (A) (b) (c) (d) 9 8 11 10 ans:(d)

40.which usage clause does not require a picture clause? (a) comp-1 (b) comp (c) comp-2 (d) none of the above ans:(a,c) 41.02 ROW OCCURS 2 TIMES. 03 COL OCCURS 2 TIMES. 05 AD PIC 9(5) 03 MUM OCCURS 2 TIMES. 05 RF PIC 9(2). a.16 b.28 c.64 d.9

(b)

42.how many bytes it occupies +1000 a.4 b.5 (b) c.6 43.comp-3 contains four bytes a.true b.false (b) 44.01 ws-num pic s9(04) sign trailing separate.

move '+1234' to ws-num.then it display as a.+1234 b.1234 c.1234+ d.5

(c)

45.what is the other way to display this 05 INVOICE-TOTAL PIC 9(3).9(2). a.9(3)9(2) b.999.99 c.9(3)v9(20

(b)

46.If AMOUNT is defined in WORKING STORAGE as: 01 AMOUNT PIC S9(9)V99 SIGN TRAILING SEPARATE VALUE -1000000.

then the actual memory should contain the following ASCII string 1. X'30303130303030303030302D' 2.x'3030303130303030303030302b 3.x'3030303130303030303030302c' 47.* denotes in ***9.99 1. Replaces leading zeros 2.replace all values 3.replacing all zero (1)

(1)

48.S999V9 ranges from 1.-99.99 thru +999.9 2.-999.9 through +999.9 (2) 3.-9999 thru +9999 49. Does Implied Decimal consume extra memory for the decimal 1.true 2.false 50.Do sign? consume extra memory for declaration PIC S9(02)? 1.true 2.false (1)

You might also like