IBM Programming with IBM Enterprise PL/I Sample Questions:
1. CORRECT TEXT
What would be printed, if anything, to SYSPRINT after executing the following code?
DCL A BIN FIXED(15) INIT(1000);
DCL B PlC '99999' INIT(2000);
B = A + B;
PUT SKIP LIST('THE VALUE OF B IS:' !! B);
A) THE VALUE OF B IS:3000
B) THE VALUE OF B IS :3000
C) Nothing will be printed because CONVERSION would be raised.
D) THE VALUE OF B IS :03000
2. CORRECT TEXT
What is the value of A after executing the following code?
DCL A CHAR(6) INIT ('ABCDEF);
DCL B CHAR(10) NIT ('0123456789');
A = SUBSTR(B,5,3);
A) ' 456'
B) '456 '
C) '456DEF'
D) 'ABC456'
3. CORRECT TEXT
Given the following code:
DCL (K, L) FIXED BIN (31) INIT G(0);Certified @ TEST-KINGS.COM
DCL SUB ENTRY( FIXED BIN(31) BYADDR, FIXED BIN(31)) OPT IONS(BYVALUE);
CALL SUB(K, L);
PUT(K, L);
and the following external procedure:
SUB: PROCEDUPE(K, L) OPTIONS( BYVALUE); DCL (K BYADDR, L) FIXED BIN(31);
K = 10;
L = 10;
END;
Which numbers are output by the PUT statement?
A) 0,10
B) 0,0
C) 10,10
D) 10,0
4. CORRECT TEXT
What code must be added after EOF = '1'B, if any, to print 'EOF REACHED'?
DCL INF FILE RECORD INPUT;
DCL INFIELD CHAR(100) BASED(P);
DCL P PTR;
DCL EOF BIT(l) INIT('0'B);
ON ENDFILE(INF) BEGIN;
EOF = 'l's;
PUT SKIP LIST(INFIELD);
END;
OPEN FILE(INF);
READ FILE(INF) SET(P);
DO WHILE(AEOF);
READ FILE(INF) SET(P);
END;
A) INFIELD 'EOF REACHED';
B) There is a syntax error.
C) ALLOC INFIELD; INFIELD = 'EOF REACHED';
D) It cannot be printed, as it is not sure if INFIELD contains the last record
5. CORRECT TEXT
Under default condition enablement, what is the result of executing the following code?
DCLX CHAR(5) INIT('A1234');
DCL Y PlC '9999' INIT(0);
Y = X;
A) The value of Y is A 123.
B) The value of Y is 1234.
C) STRINGSIZE would be raised.
D) CONVERSION would be raised.
Solutions:
| Question # 1 Answer: D | Question # 2 Answer: B | Question # 3 Answer: D | Question # 4 Answer: C | Question # 5 Answer: D |
We're so confident of our products that we provide no hassle product exchange.


By Mandel

