Você está na página 1de 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Question: 1 What is the result, if any, of executing the following code? DCL A BIT(1) INIT(0B); DCL B BIT(1) INIT(0B); DCL C BIT(1) lNlT(1B); A = B ! C; A. The value of A is 0B B. The value of A is1B. C. The value of A is unpredictable. D. There is no result, because the syntax is wrong. Answer: B Question: 2 What does BX.WOK.LOAD refer to in the following job control statement? I/ACCOUNT DD DSN=BX.WOK.LOAD,DISP=SHR A. It is the connection between program and dataset. B. It is the physical dataset name. C. It is the logical dataset name. D. It is the name which must be referred to in the program. Answer: B Question: 3 What will be printed when the following subroutine is called for the third time? A: PROC; DCLX PlC 9 INIT(O); X = X+ 1; PUT SKIP LIST (THE VALUE OF X IS :!!X); X = X+ 1; END A; A. THE VALUE OF X IS : 1 B. THE VALUE OF X IS : 2 C. THE VALUE OF X IS : 3 D. THE VALUE OF X IS : 5 Answer: A Question: 4 Given the following code, with what attribute should the variable EOF be declared? DO WHILE(^EOF); A. FIXED BIN (7) B. BIT (1) C. CHAR (1) D. FIXED DEC (3)
Page 1 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: B Question: 5 Which is the most appropriate code to turn all of the bits in A ON? DCL A BIT(8); A. A = 255; B. A = 11111111B; C. A = 11111111B; D. A = -1; Answer: B Question: 6 What changes should be made, if any, to the following code? DCL A CHAR(100) BASED(P); DCL P PTR; READ FILE(DDIN) INTO(A); A. READ FILE(DDIN) SET(A); B. READ FILE(DDIN) INTO(P); C. READ FILE(DDIN) SET(P); D. No changes necessary because the code is correct. Answer: C Question: 7 What is the value of B after executing the following code? DCL A CHAR(10) VAR; DCL B BIN FIXED(31) INIT(0); DCL C CHAR(5) INIT(ABCD); A = C; B = LENGTH(A); A. B. C. D. 10 7 5 4

Answer: C Question: 8 Which of the following is a BIN FIXED constant? A. 1000 B. 1E+03 C. 1000 D. 1000B
Page 2 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: D Question: 9 Which of the following is NOT a valid method to activate a BEGIN block? A. A condition is signaled and the BEGIN block is a component of the corresponding ON unit. B. Sequential program flow approaches the BEGIN block. C. The BEGIN block is labeled and a GOTO addresses this label. D. The BEGIN block is labeled and a CALL addresses this label. Answer: D Question: 10 Which is the most appropriate data type declaration for the variable A in the following expression, if A is used as a counter? A = A + 1; A. CHAR B. BIN FIXED C. FLOAT D. PlC Answer: B Question: 11 Given the following code, what SELECT code is NOT equivalent? DCL(C,W,V) CHAR (1); SELECT (C); WHEN (AB) PUT (1) WHEN (C) PUT (2) WHEN (W) PUT (3) WHEN (V) PUT (4); OTHER PUT (Other); END; A. SELECT (C); WHEN (C) PUT (2) WHEN (AB) PUT (1) WHEN (W) PUT (3) WHEN (V) PUT (4); OTHER PUT (Other); END; B. SELECT (C); WHEN (AB) PUT (1) WHEN (C) PUT (2) WHEN (V) PUT (4) WHEN (W) PUT (3); OTHER PUT (Other); END; C. SELECT (C); WHEN (BA) PUT (1)
Page 3 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

WHEN (C) PUT (2) WHEN (W) PUT (3) WHEN (V) PUT (4); OTHER PUT (Other); END; D. SELECT (C); WHEN (A) PUT (1) WHEN (B) PUT (1) WHEN (C) PUT (2) WHEN (W) PUT (3) WHEN (V) PUT (4); OTHER PUT (Other); END; Answer: B Question: 12 Which of the following describes when a program is NOT FETCHABLE? A. When the main program need not be recompiled to reflect the changes made in the called program B. When the called program will be loaded from the library at execution time C. When the called program is part of the main program in the load module D. When two main programs referring to the called program at the same time cannot have different versions of the called program Answer: C Question: 13 Which is the impact, if any, of LIKE in the following code? DCL 1 XY 2 A CHAR(4), 2 B BIN FIXED(31); DCL 1 YZ LIKE XY; A. XY.A is always the same as YZ.A. B. YZ is exactly the same structure as XY but with its own storage. C. YZ is based on the structure XY. D. There is no impact, because LIKE is a syntax error. Answer: B Question: 14 What is the most appropriate data type for a variable that is being used to represent numeric data in a printable form and at the same time can be used to perform arithmetic? A. B. C. D. BIN FIXED DEC FIXED CHAR PICTURE

Answer: D
Page 4 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Question: 15 What is the most appropriate declaration for the variable A? A = ABCDEF; A. DCL A BIN FIXED(15); B. DCL A CHAR(6); C. DCL A DEC FIXED (153); D. DCL A PlC 999999; Answer: B Question: 16 Which of the following would NOT access the third element of A? DCL 1XY(5), 2 A(4) CHAR(4); A. B. C. D. XY(1,3).A XY.A(1,3) XY(1).A(3) XY(3).A(1)

Answer: D Question: 17 Given the following code, what can be said about the scope of the variables in procedure P? P: PROCEDURE; B: BEGIN; DCL K FIXED BIN (15); END B; D: DO; DCL S CHAR (10); END D; END P; A. Variable S is known in the entire procedure. B. Variable K is known in the entire procedure. C. Variable S is not known in block B. D. Variable K is known in group D. Answer: A Question: 18 What will be output by the following program? TEST: PROC OPTIONS(MAIN); DCL A CONTROLLED FIXED BIN(31); ALLOC A; ALLOC A; CALL SUB(A); PUT SKIP LIST( ALLOCN(A)); SUB: PROC( B);
Page 5 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL B CONTROLLED FIXED BIN(31); FREE B; ALLOC B; ALLOC B; FREE B; ALLOC B; END; END; A. 2 B. 3 C. 4 D. 5 Answer: B Question: 19 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 Answer: A Question: 20 What does the following code do, if anything? RELEASE U; A. Release the memory used by the program U B. Reloads the program U into the memory C. Closes the file U D. Nothing because there is a syntax error. Answer: A Question: 21 Which of the following is a BIT string constant? A. 1000 B. 1000 C. 1000B D. 1000B Answer: C Question: 22 What is the most appropriate way to assign a value to variable A?
Page 6 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCLA BIN FIXED(15); A. A = 17; B. A = 17.29; C. A =1729X; D. A = 17; Answer: D Question: 23 Given the following declaration, the compiler will issue the message The variable RX is declared without any data attributes. What possible problem is this message reporting? DCL RX, RY FIXED BIN; A. That the code is in error because a variable declared without attributes is not allocated storage B. That the code is in error because only one variable may be declared in any one statement C. That the code is in error because the FIXED BIN attribute would not apply to both RX and RY D. That the code is in error because the FIXED BIN precision was not specified Answer: C Question: 24 Given the following code, what will be output? MP: PROC OPTIONS(MAIN); DCL A CHAR(1) INIT(A); DCL B CHAR(1) INIT(B); DCL C CHAR(1) STATIC INIT(C); CALL SR1(A); PUT SKIP LIST(A!!B!!C); SR1: PROC(A); DCL A CHAR(1); DCL B CHAR(1); DCL C CHAR(1); A = 1 B = 2 C = 3; END SR1; END; A. 1B3 B. 1BC C. 123 D. 12C Answer: B Question: 25 What should be done, if anything, when the following compiler message appears?
Page 7 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Multiple closure of blocks, one extra END statement assumed. A. Take out the extra END statement. B. Find the missing END statement and add it at the right place. C. PUT an extra END statement at the end of the program. D. Nothing needs to be done. Answer: B Question: 26 The following code calls an external function procedure. Which program matches the entry declaration? DCL F FLOAT; DCLX CHAR(1); DCL FUN ENTRY (FIXED BIN (15), FLOAT) RETURNS (CHAR(1)); X=FUN(1, F); A. FUN: PROCEDURE (K, F) RETURNS (CHAR(1)); DCL K FIXED BIN (15); DCL F FLOAT; END; B. FUN: PROCEDURE (K, F) RETURNS (CHAR(1)); DCL K FIXED BIN (31); DCL F FLOAT; END; C. FUN: PROCEDURE (K, F) RETURNS (CHAR(1)); DCL K FIXED DEC (15); DCL F FLOAT; END; D. FUN: PROCEDURE (K, F) RETURNS (FIXED BIN (15)); DCL K FIXED BIN (15); DCL F FLOAT; END; Answer: A Question: 27 In which of the following situations can a subroutine be replaced by a function without any major changes to the code? A. When the subroutine changes an array parameter B. When the subroutine changes a structure parameter C. When the subroutine changes more than one parameter D. When the subroutine changes only one scalar parameter Answer: D Question: 28 Which of the following is NOT a valid way to set a pointer P to zero? A. UNSPEC(P) = B; B. P = PTRVALUE(0); C. P = SYSNULL(); D. P = 0;
Page 8 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: D Question: 29 If the physical dataset referred to by DDOUT has a record length of 200 and RECFM=F, what happens after executing the following code? DCL DDOUT FILE RECORD OUTPUT; DCL OUT_CHAR CHAR(200) INIT(HeIlo World); WRITE FILE(DDOUT) FROM(OUT_CHAR); A. One record with a length of 11 will be written to the output file. B. One record with a length of 200 will be written to the output file. C. Compiler error because there is no OPEN statement. D. Runtime error because there is no OPEN statement. Answer: B Question: 30 Given the following program, what is shown by the dump? A: PROC; DCL X FIXED BIN(31) INIT(17); DCL F FILE RECORD OUTPUT; ON ERROR BEGIN; CALL PLIDUMP(TFB); END; CALL B; B: PROC; DCLY FIXED BIN(31) INIT(29); X = Y; OPEN FILE(F); SIGNAL ERROR; END; END; A. F is open and the storage for Y is still on the stack B. F is closed and the storage for Y is still on the stack C. F is open and the storage for Y is no longer on the stack D. F is closed and the storage for Y is no longer on the stack Answer: A Question: 31 What is the result, if any, of executing the following code? DCL A CHAR(2) INIT( ); DCL B BIT(2) INIT(11B); A = ^B;
Page 9 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. The value of A is 00. B. The value of A is11. C. The value of A is unpredictable. D. There is no result, because the syntax is wrong. Answer: A Question: 32 What would be printed to SYSPRINT after executing the following code? DCL A DEC FIXED(15,3) INIT(1000.123); DCL B PlC ZZZZ9V.999 INIT(0); B = A + 2000.123; UT SKIP LIST(THE VALUE OF B IS:!! B); A. THE VALUE OF B IS: 3000.246 B. THE VALUE OF B IS :03000.246 C. THE VALUE OF B IS :3000.246 D. THE VALUE OF B IS :3000246 Answer: A Question: 33 Given the following program, which subroutine improperly uses pointers to address memory and could lead to data corruption or an exception? A: PROC OPTIONS(MAIN); DCL 1 X, 2 X1 CHAR(76), 2 X2 PIC9999; DCL Y CHAR(20); CALL SUB1( ADDR(X)); CALL SUB2( ADDR(X)); CALL SUB3( ADDR(X)); CALL SUB4( ADDR(X)); SUB 1: PROC( P); DCL P POINTER; DCL 1 XBASED(P), 2 X1 CHAR(76), 2 X2 PIC9999 X = ; END; SUB2: PROC( P); DCL P POINTER; DCL 1 X BASED(P), 2 X 1 PIC(76)X 2 X 2 PIC9999 X = ;
Page 10 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

END; SUB3: PROC( P); DCL P POINTER; DCL X CHAR(60) BASED(P); X = ; END; SUB4: PROC( P ); DCL P POINTER; DCLX CHAR(100) BASED(P); X = ; END; END; ABCDSUB1 SUB2 SUB3 SUB4

Answer: D Question: 34 Given the following code, what declaration of I will cause an infinite loop under default condition enablement? DO I = 1 TO 99; A. DCL I FIXED BIN (7); B. DCL I FIXED BIN (3,0); C. DCL I PIC99; D. DCL I FLOAT; Answer: C Question: 35 Given the following piece of code, what will be the output of the preprocessor? %F: PROC(S) RETURNS(CHAR); DCL S CHAR; RETURN(SUBSTR(S, 1, 1)); %END; PUT (F(ABC)); %ACTIVATE F; PUT (F(ABC)); A. PUT (F(ABC)); PUT (A); B. PUT (A); PUT (F(ABC)); C. PUT (A); PUT (A); D. PUT (F(ABC)); PUT (F(ABC)); Answer: A
Page 11 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Question: 36 Given the following piece of code, what will be output? A: PROCEDURE OPTIONS (MAIN); DCL K CHAR (1) INIT (A); CALL B; B: PROCEDURE; DCL K CHAR (1) NIT (B); CALL C; C: PROCEDURE; DCL K CHAR (1) INIT (C); PUT (K); CALL D; END C; D: PROCEDURE; PUT (K); END D; END B; PUT (K); END A; A. C A A B. C C A C. C B A D. C A B Answer: C Question: 37 Which of the following techniques will NOT cause a referenced external sub procedure to be handled as FETCHABLE when the referencing program is compiled? A. OPTIONS(FETCHABLE) as an attribute of the ENTRY declare statement in the referencing program B. OPTIONS(FETCHABLE) as an option of the PROC statement in the sub procedure C. Having a FETCH statement for the sub procedure D. Having a RELEASE statement for the sub procedure Answer: B Question: 38 What is the value of B, if any, after executing the following code? DCL A CHAR(5) INIT(ABCDE); DCL B CHAR(5) DEF A; A. NULL B. Blank C. ABCDE D. It cannot be defined.
Page 12 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: C Question: 39 What is the value of B after executing the following code? DCL A CHAR(10) INIT(12A4BABCAB); DCL B BIN FIXED(31) INIT(0); B = INDEX(A,AB); A. 2 B. 3 C. 6 D. 9 Answer: C Question: 40 What code would result in the BIT string B having all ones? DCL A CHAR(8) INIT(HIGH(8)); DCL (HIGH ,ADDR) BUILTIN; A. DCL B BIT(64) BASED(ADDR(A)); B. DCL B BIT(64) INIT(1111111x); C. DCL B BIT(64) INIT(1B); D. DCL B BIT(64) INIT(HIGH(1)); Answer: A Question: 41 Given the following code, what procedure will be accepted by the compiler? DCL A DIM (10) CHAR (100) VAR BASED (P); DCL P PTR; ALLOCATE A; CALL SUB(P); A. SUB: PROCEDURE (P); DCL P PTR; DCL A DIM (10) CHAR (100) VAR BASED (P); END SUB; B. SUB: PROCEDURE (P); DCL P PTR; DCL A DIM (*) CHAR (100) VAR BASED (P); END SUB; C. SUB: PROCEDURE (P); DCL P PTR; DCL A DIM (10) CHAR (*) VAR BASED (P); END SUB; D. SUB: PROCEDURE (P); DCL P PTR; DCL A DIM (*) CHAR (*) VAR BASED (P); END SUB;
Page 13 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: A Question: 42 What will be the values of the variables A, B, C and D after executing the following code? DCL 1 XYZ, 2 A CHAR(4), 2 6 BIN FIXED(31), 2 C DEC FIXED(7), 2 D PlC 999 XYZ = ; A. A is blank, B is zero, C is zero D is zero B. syntax error in XYZ = ; C. CONVERSION will be raised in XYZ = ; D. A,B,C and Dare zeros. Answer: A Question: 43 Given the following piece of code, how many times is the loop executed? DCLI FIXED BIN (31); I = 20; DO UNTIL (I = 0); PUT (I); I = I - 3; END; A. less than 6 times B. 6 C. 7 D. more than 7 times Answer: D Question: 44 If the physical dataset referred to by DDOUT has a maximum record length of 196 and a RECFM=V, what happens after executing the following code? DCL DDOUT FILE RECORD OUTPUT; DCL OUT_CHAR CHAR(500) VARYING INIT((220) ); OPEN FILE(DDOUT); WRITE FILE(DDOUT) FROM(OUT_CHAR); A. One record with a length of 220 will be written to the output file. B. One record with a length of 500 will be written to the output file. C. One record with a length of 196 will be written to the output file. D. An error will occur because of mismatch of record length. Answer: D Question: 45
Page 14 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

What code must be added after EOF = 1B, 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(0B); ON ENDFILE(INF) BEGIN; EOF = ls; PUT SKIP LIST(INFIELD); END; OPEN FILE(INF); READ FILE(INF) SET(P); DO WHILE(AEOF); READ FILE(INF) SET(P); END; A. ALLOC INFIELD; INFIELD = EOF REACHED; B. INFIELD EOF REACHED; C. It cannot be printed, as it is not sure if INFIELD contains the last record D. There is a syntax error. Answer: A Question: 46 What is the result of executing the following code? DCLA BIN FIXED(31) INIT(10000); DCL B BIN FIXED(15) INIT(8000); B = B/A; A. The value of B is 0.8. B. The value of B is 0. C. The value of B is 1. D. CONVERSION would be raised. Answer: B Question: 47 Given the following code, what value will be output? TEST: PROC OPTIONS(MAIN); DCL P POINTER, N1 FIXED BIN(31), 1 A BASED(P), 2 A1 FIXED BIN(3i), 2 A2 FIXED BIN(3i), 2 A3 FIXED BIN(3i), 2 A4( N1 REFER(A3)) CHAR(10) VAR; N1 = 5;
Page 15 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

ALLOC A; PUT SKIP LIST( STG(A)); END; A. 22 B. 24 C. 62 D. 72 Answer: D Question: 48 Which of the following is a restriction using the BYVALUE attribute? A. It can be specified only for scalar arguments and parameters that can be passed in registers. B. It can be specified only for scalar arguments and parameters with a size of four bytes. C. It can be specified only for aggregate arguments and parameters. D. It can be specified only for scalar arguments and parameters whose lengths and sizes are known at compile time. Answer: D Question: 49 In which of the following cases is it possible to change the value of a variable in a routine when it is passed to the routine as an argument? A. The argument is declared as FIXED BIN(15), and the corresponding parameter is declared as FIXED BIN(15) BYVALUE. B. The argument is declared as FIXED BIN(15), and the corresponding parameter is declared as FIXED DEC(7) BYADDR. C. The argument is declared as FIXED DEC(7), and the corresponding parameter is declared as FIXED DEC(7) BYADDR. D. The argument is declared as CHAP(10) VAR, and the corresponding parameter is declared as CHAR(10). Answer: C Question: 50 What code needs to be executed, if any, before the variable A can be successfully accessed? DCL X PTR; DCL B CHAR(100) INIT(); DCL A CHAR(100) BASED(X); A. A can be accessed without any further action. B. X = ADDR(B); C. A = B; D. X = NULL(); Answer: B Question: 51 What is the result, if any, of executing the following code?
Page 16 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL B DEC FIXED(15,3) INIT(12345.12); DCL C PlC 9999999999 INIT (0); C = B; A. There is no result, because B contains a decimal point. B. There is no result, because DEC FIXED cannot be assigned to PlC. C. The result in C is 12345 with 5 leading zeroes. D. The result in C is 1234512 with 3 leading zeroes. Answer: C Question: 52 Given the following piece of code, which loop construct using WHILE or UNTIL will give identical output? DCLI FIXED BIN (31); DO I = 10 TO 1 BY - 1; PUT (I); END; A. I = 10; DO WHILE (I> 1); PUT (I); I = I - 1; END; B. 1= 10; DO WHILE (I >= 1); I = I - 1; PUT (I); END; C. 1= 10; DO UNTIL (I < 1); PUT (I); I = I - 1; END; D. 1= 10; DO UNTIL (I> 1); PUT (I); I = I - 1; END; Answer: C Question: 53 What code will print the value of A to SYSPRINT? DCLA DEC FIXED(5,3) INIT(12.0); A. PUT SKIP LIST(Value of A is: !! A); B PUT SKIP LIST(Value of A is:), (A); C. PUT SKIP LIST(Value of A is:)(A); D. PUT SKIP LISTA; Answer: A
Page 17 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Question: 54 A programmer has been asked to write a program that tests a variable, X, and writes out A, B, C or D if X is 0, 1, 2 or 3 respectively and writes out E when X has none of those values. Which of the following programs represents the best practice using IF or SELECT statements? A. SUB1:PROC(X); DCL X FIXED UNSIGNED; IF X = 0 THEN PUT SKIP LIST (A); ELSE IF X = 1 THEN PUT SKIP LIST (B); ELSE IF X = 2 THEN PUT SKIP LIST (C); ELSE IF X = 3 THEN PUT SKIP LIST ( D); ELSE PUT SKIP LIST ( E); END; B. SUB2: PROC (X); DCL X FIXED UNSIGNED; IF X < 2 THEN IF X = 0 THEN PUT SKIP LIST (A); ELSE PUT SKIP LIST (B); ELSE IF X = 2 THEN PUT SKIP LIST (C); ELSE IF X = 3 THEN PUT SKIP LIST ( D); ELSE PUT SKIP LIST ( E); END; END; C. SUB3: PROC( X); DCL X FIXED UNSIGNED; SELECT; WHEN (X = 0) PUT SKIP LIST ( A); WHEN(X = 1) PUT SKIP LIST ( B); WHEN( X = 2) PUT SKIP LIST ( C); WHEN( X = 3) PUT SKIP LIST ( D); OTHERWISE PUT SKIP LIST ( E); END; END; D. SUB4: PROC( X); DCLX FIXED UNSIGNED;
Page 18 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

SELECT(X); WHEN ( 0 ) PUT SKIP LIST ( A); WHEN (1) PUT SKIP LIST ( B); WHEN ( 2) PUT SKIP LIST ( C); WHEN (3) PUT SKIP LIST ( D); OTHERWISE PUT SKIP LIST ( E); END; END; Answer: D Question: 55 Given the following piece of code, what will happen when the code is executed if STRINGSIZE is not enabled? DCL X CHAR (5) INIT (ABCDE); DCL Y CHAR (3) INIT (); Y = X; A. Y receives the value ABC and the next two bytes following Ys storage are overridden by DE. B. Y receives the value ABC and DE is not assigned to any storage area. C. The assignment is not executed and program execution continues after the assignment. D. The assignment is not executed and program execution abends. Answer: B Question: 56 Given the following code, how many elements of A will contain a value of 0 after execution of the loops? DOL A DIM (8, 10) FIXED BIN (31); DCL(I, K) FIXED BIN (31) INIT (0); A = 0; DO I = 2 TO 8; DO K = 1 TO 10; A(I, K) = l*K; END; END; A. 0 B. 1 C. 6 D. 10 Answer: D Question: 57 What happens after executing the following code?
Page 19 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCLA BIN FIXED(15); A = 1_000 A. The value of A is 1000. B. The value of A is 8. C. The value of A is 1. D. There is a syntax error. Answer: A Question: 58 Given the following code in a program, which code will NOT change the programs behavior when the ENDFILE(SYSIN) condition is raised? ON ENDFILE (SYSIN) GOTO START; A. ON ENDFILE (SYSIN); B. ON ENDFILE (SYSIN) EOF = 1B; C. REVERT ENDFILE(SYSIN); D. SIGNAL ENDFILE (SYSIN); Answer: D Question: 59 If the physical dataset referred to by DDIN has a record length of 200 and a RECFM of F, what happens after executing the following code? DCL DDIN FILE RECORD INPUT; DCL P PTR; DCL 1 INSTR BASED(P), 2 A CHAR(100), 2 B CHAR(100); ALLOCATE INSTR; OPEN FILE(DDIN); READ FILE(DDIN) INTO(INSTR); A. One record will be read into the buffer and the pointer will be set accordingly. B. One record will be read into the structure INSTR. C. READ INTO cannot be used on a BASED structure. D. Program will abend because P has not been properly initialized. Answer: B Question: 60 Which of the following loops will run infinitely? A. DCL I FIXED BIN (31); DO I = 1 BY 2 UNTIL (I = 20); PUT (I); END; B. DCL I FIXED BIN (31);
Page 20 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DO I = 1 BY 2 UNTIL (I> 20); PUT (I); END; C. DCL I FIXED BIN (31); DO I = 1 BY 2 WHILE (I <20); PUT (I); END; D. DCL I FIXED BIN (31); DO I = 1 BY 2 WHILE (I = 20); PUT (I); END; Answer: A Question: 61 What value is output by the following program? TEST: PACKAGE; D CL N EXT FIXED BIN(31) INIT(10); DCLC(N) EXT CONTROLLED FIXED BIN(31); MAIN: PROC OPTIONS(MAIN); ALLOC C; ALLOC C(20); N = 30; CALL UPGM; END; UPGM: PROC; ALLOC C; N = 40; PUT SKIP LIST( DIM(C)); END; END; A. 10 B. 20 C. 30 D. 40 Answer: C Question: 62 Given the following program, the compiler will produce the warning message The structure member A2 is declared without any data attributes. A level number may be incorrect. What is the best way to correct the program? TEST: PROC OPTIONS(MAIN); DCL 1A, 3A1 FIXED BIN(31), 3 A2, 3 A3 FIXED BIN(31),
Page 21 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

3 A4 FIXED BIN(31); END; A. Add the attribute CHAR(8) to the declare for A2 B. Change the level number on the declare for A2 to 2 C. Change the level number on the declare for A3 to 4 D. Change the level numbers on the declares for A3 and A4 to 4 Answer: D Question: 63 Given the following code, what construct is equivalent? SELECT; WHEN(A< 1) B += 1; WHEN (A < 2) B += 2; WHEN (A< 3) B+= 3; OTHERWISE B = 0; END; A. IFA< 1 THEN B += 1; ELSE IF A < 2 THEN B += 2; ELSE IF A < 3 THEN B += 3; ELSE B = 0; B. IF A <1THEN B += 1; IF A < 2 THEN B += 2; IF A < 3 THEN B += 3; ELSE B = 0; C. SELECT; WHEN (A < 3) B += 3; WHEN (A < 2) B += 2; WHEN(A< 1) B += 1; OTHERWISE B = 0; END; D. SELECT; WHEN(A< 1) B += 1; WHEN (A < 2) B += 2; WHEN(A< 3) B +=3; END; Answer: A Question: 64 What happens to the STATIC variables in the program U, if anything, alter executing the following code? FETCH U; CALL U;
Page 22 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

RELEASE U; FETCH U; A. STATIC variables cannot be used in program U. B. STATIC variables will have the values from the last time U was called. C. STATIC variables will have their INITIAL values. D. Nothing because there is a syntax error. Answer: C Question: 65 Which of the following pieces of code will result in a compiler error message? A. ON ENDFILE (SYSIN) DO; PUT LIST(End of file reached.); EOF = 1B; END; B. ON ENDFILE (SYSIN) BEGIN; PUT LIST(End of file reached.); EOF = 15; END; C. IF EOF THEN DO; K = 0; L = 1; END; D. IF EOF THEN BEGIN; K = 0; L = 1; END; Answer: A Question: 66 What happens after end of file has been reached in the following code, assuming the input file has more than 100 records? DCL INF FILE RECORD INPUT; DCL INFIELD CHAR(100) BASED(P); DCL P PTR; DCL EOF BIT(1) INIT(0B); ON ENDFILE(INF) BEGIN; ALLOC INFIELD; INFIELD = EOF REACHED; END; OPEN FILE(INF); READ FILE(INF) SET(P); DO WHILE(^EOF); READ FILE(INF) SET(P); EOF = 1B; END;
Page 23 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. End of file will never be reached B. INFIELD will have a value EOF REACHED and the program ends C. Infinite loop D. Runtime error because there is no CLOSE statement Answer: A Question: 67 Given the following DECLARE statement, how many bytes will be allocated to A? DCL 1 A UNION, 2 C8 CHAR(8), 2 XB FIXED BIN(31), 2 BX BIT(16); A. 2 B. 4 C. 8 D. 14 Answer: C Question: 68 To validate the assignment in the following code, which condition should be enabled? TEST: PROC(A, B); DCL (A, B) CHAR (*); A = B; END; A. SIZE B. STRINGRANGE C. STRINGSIZE D. SUBSCRIPTRANGE Answer: C Question: 69 What is the result of executing the following code? DCL A CHARACTER (4) INIT(10.5); DCL B DEC FIXED(71) INIT(10.5); B = A + B; A. CONVERSION is raised. B. ERROR is raised. C. No condition is raised and the value of B is 21. D. No condition is raised and the value of B is 20.5 Answer: D
Page 24 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Question: 70 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. CONVERSION would be raised. D. STRINGSIZE would be raised. Answer: C Question: 71 Given the following code, the compiler will issue the message RULES(NOLAXIF) requires BIT(1) expressions in IF, WHILE, etc. under the option RULES(NOLAXIF). In order to fix this problem, the IF statement should be changed to: A: PPOC( RC); DCL RC FIXED BIN(31); IF RC = 0 ! 4 THEN A. IF RC =(0 ! 4) THEN B. IF RC=(0 ! RC = 4 THEN C. IF BIT(RC = 0 ! 4) THEN D. IF BOOL(RC = 0,4,0111B) THEN Answer: B Question: 72 What is the most appropriate declaration for the variable X? X= 1,123E+4; A. DCL X CHAR(4); B. DCL X PlC 9999; C. DCL X DEC FLOAT(16); D. DCL X DEC FIXED(15,3); Answer: C Question: 73 If the physical dataset referred to by DDIN has a record length of 200 and a RECFM of F, what happens after executing the following code? DCL DDIN FILE RECORD lNPUT DCL 1 INSTR, 2 A CHAR(150), 2 B CHAR(150);
Page 25 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

OPEN FILE(DDIN); READ FILE(DDIN) INTO(INSTR); A. When executed, one record will be read into buffer. B. At runtime, an error will occur because of mismatch of record length. C. At compile time, an error will occur because of mismatch of record length. D. When executed, nothing will be read into the buffer. Answer: B Question: 74 Given the following code for a main program and an external subroutine, what will be output? *PROCESS INITAUTO; MP: PROC OPTIONS(MAIN); DCL SR1 EXT ENTRY; DCL I BIN FIXED(31) EXTERNAL INIT(0); DCL J BIN FIXED(31) EXTERNAL INIT(0); DCL K BIN FIXED(3i) EXTERNAL INIT(0); CALL SR1(I); CALL SR1(I); CALL SR1(I); PUT SKIP LIST(I+J+K); END; *PROCESS INITAUTO; SR1: PROC(I); DCL I BIN FIXED(31); DCL J BIN FIXED(31) EXTERNAL INIT(0); DCL K BIN FIXED(31); I = I + 1; J =J + 10; K = K+ 100; END SR1; A. 33 B. 303 C. 330 D. 333 Answer: A Question: 75 What is the value of A in PROC1 after calling PROC2? PROC1: PROC; DCLA BIN FIXED(15) INIT(0); CALL PROC2(A); END; PROC2: PROC(A); DCL A BIN FIXED(15); A = A + 1; END; A. 0
Page 26 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

B. 1 C. The value of A is undefined. D. The compiler will generate an error message because A is defined more than once. Answer: B Question: 76 What is the value of A after executing the following code? DCL A CHAR(7) INIT (ABCDEFG); DCLB CHAR(10) INIT (0123456789); SUBSTR(A,4) = SUBSTR(B,5,3); A. ABC4567 B. ABC4560 C. ABCD456 D. ABC456 Answer: D Question: 77 Given the following external subroutine, what ENTRY declaration must NOT be used in a program that calls the subroutine? SR1: PROC (STR); DCL SUBSTR BUILTIN; DCL 1 STR, 3 V1 DEC FIXED (3), 3 V2 BIN FIXED (31), 3 VS CHARACTER (3); STR.V1 =STR.V1 +1; STRV2 = STR.V2 + 1; STR.V3 = SUBSTR(STR.V3,1.1)!! ; END SR1; A. DCL SR1 EXT ENTRY (DEC FIXED(3), BIN FIXED(31), CHAR(3)); B. DCL SR1 EXT ENTRY; C. DCL SR1 EXT ENTRY(*); D. DCL SR1 EXT ENTRY (1,3 DEC FIXED(3),3 BIN FIXED(31),3 CHAR(3)); Answer: A Question: 78 Which of the following statements, if any, needs to be executed before the variable A can be used? DCL A CHAR(5) CONTROLLED; A. FETCH A; B. ALLOCATE A; C. FREE A; D. Nothing needs to be done.
Page 27 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: B Question: 79 What is the difference between the following two DECLARE statements, if any? XX: PROC; DCLA BIN FIXED(31) STATIC INIT(O); DCL B SIN FIXED(31) AUTOMATIC INIT(0); END; A. Variable B is initialized every time the subroutine XX is called, while A is initialized only once. B. Variable A is initialized every time the subroutine XX is called, while B is initialized only once. C. When the subroutine XX ends, the space for Variable A is freed, while B remains allocated. D. There is no difference. Answer: A Question: 80 Given the following code, how many times is the loop executed? DCL NEGATIVE BIT (1) INIT (0B); DCLI FIXED BIN (31) INIT (10); DO WHILE (^NEGATIVE) PUT (I); I += 1; IF I >= 0 THEN NEGATIVE = 0B; ELSE NEGATIVE = 1B; END; A. Less than 10 times B. 10 C. 11 D. More than 11 times Answer: D Question: 81 What is the value of X after executing the following code? DCLX SIT(1 6) INIT(l US); A. 0000000000000010B B. 1111111100000000B C. 1010101010101010B D. 1000000000000000B Answer: D Question: 82 Given the following code, how many times is the loop executed?
Page 28 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL A(11) FIXED DEC(15,3); DCL I FIXED BIN (31); DO I = 1 TO 11; A(I) = 0; I = 1+1; END; A. 1 B. 6 C. 11 D. Infinitely Answer: B Question: 83 Given the following code, which code is NOT equivalent? DCL A CHAR (1); SELECT (A); WHEN (A) PUT (1) WHEN (B) PUT (2) WHEN (C) PUT (3); OTHER; END; A. SELECT (A); WHEN (B) PUT (2) WHEN (A) PUT (1) WHEN (C) PUT (3); OTHER; END; B. SELECT (A); WHEN (A) PUT (1) WHEN (C) PUT (3) WHEN (B) PUT (2); END; C. IF A = A THEN PUT(1 IF A = B THEN PUT (2) IF A = C THEN PUT (3) D. IF A = C THEN PUT (3) IF A = B THEN PUT (2) IF A = A THEN PUT (1); Answer: B Question: 84 Given the following code, what will be output? PGM1: PROC OPTIONS(MAIN); DCL (K,L) BIN FIXED (15); I,J,K,L= 1; CALL SRI;
Page 29 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

CALL SRJ; CALL SRK; CALL SRL; PUT SKIP LIST(I*J*K*L); SRI: PROC; I = 2; END; SRJ: PROC; DCL J BIN FIXED(15); J = 3; END; SRK: PROC; K = 5; END; SRL: PROC; DCL L BIN FIXED(15); L = 7; END; END; A. 1 B. 10 C. 21 D. 210 Answer: B Question: 85 Which of the following is the best way to force end of file of file DDIN before the actual end of file is reached? DCL DDIN FILE RECORD INPUT; A. SIGNAL ENDFILE(DDIN); B. SIGNAL ENDPAGE(DDIN); C. End of file cannot be forced. D. CLOSE ENDFILE(DDIN); Answer: A Question: 86 What value will be displayed by the following program? TEST: PROC OPTIONS (MAIN); DCL A FIXED BIN INIT (2); DCL Z FIXED BIN INIT (1729); CALL SUB; SUB: PROC; DCLA FIXED BIN INIT (10); DCL 1 X, 2 Y FIXED BIN INIT (17), 2 Z FIXED BIN INIT (29); PUT SKIP LIST (A*Y); END; END; A. 34 B. 170 C. 3458 D. 17290
Page 30 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: B Question: 87 Given the following code, what is the best way to code the PROC statement and to declare the parameters for UPRO1? MPROG: PROC OPTIONS(MAIN); DCL F FLOAT BIN(53); CALL UPRO1 (ADDR(F)); A. UPRO1: PROC(P_PARM); DCL P_PARM PTR DCL PARM_F FLOAT BIN(53) BASED(ADDR(P_PARM)); B. UPRO1: PROC(P_PARM); DCL P_PARM PTR; DCL PARM_F FLOAT BIN(53) BASED(P_PARM) C. UPRO1: PROC(PARM_F); DCL PARM_F FLOAT BIN(53); D. UPRO1: PROC(PPARM); DCL P_PARM PTR; DCL PARM_PTR BASED (P_PARM); DCL PARM_F FLOAT BIN(53) BASED(PARM_PTR); Answer: B Question: 88 What is the value of B after executing the following code? DCLA CHAR(1) INIT( ); DCL B BIT(8) BASE D(ADDR(A)); DCL (HIGH, ADDR) BUILTIN; A = HIGH(1); A. 11111111B B. 00000000B C. F1X D. 40X Answer: A Question: 89 Which of the following methods of initializing the variable X is most efficient because it results in the fewest compiler instructions? DCL A PlC 999V.99; DCL A CHAR(6) INIT( 000.00); DCL B DEC FIXED(5,2) INIT( 0); DCL C BIT(8) INIT( 00000000B); DCL D FLOAT(6) INIT( 0E0); A. X=A; B. X=B; C. X=C;
Page 31 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

D. X=D; Answer: B Question: 90 What is the value of B after executing the following code? DCL A CHAR(10) INIT(123abCDEFG); DCLB BIN FIXED(31) INIT(5); B = INDLX(A,AB); A. 0 B. 1 C. 4 D. 11 Answer: A Question: 91 Which of the following is NOT mandatory for an external function procedure and its usage? A. RETURNS option on the PROCEDURE statement. B. ENTRY declaration with the RETURNS attribute. C. Using the RETURN statement to return control and a result value. D. Using SWALUE parameters exclusively. Answer: D Question: 92 Given the following code, which SIGNAL statement would cause a new page starting with the line header text to be written to file X? DCLX FILL STREAM PRINT OUTPUT; ON ENDPAGE(X) PUT SKIP FILE(X) LIST(header text); A. SIGNAL ENDPAGE(X); B. SIGNAL ENDFILE(X); C. SIGNAL NAME(X); D. SIGNAL OVERFLOW; Answer: A Question: 93 Which of the following builtins is the only one that returns a value? A. PLICKPT B. PLISRTC C. PURETV D. PLIRETC Answer: C Question: 94
Page 32 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

When different data types are used in an expression, which other following conversions is NOT done by subroutine call? A. CHAR to DEC FIXED B. CHAR to BIN FIXED C. BIN FIXED to FLOAT D. CHAR to BIT Answer: C Question: 95 Given the following declarations, which code would assign 1234561.23 to A? DCL A DEC FIXED (15,3) NIT (123456.123); DCL B BIN FIXED (15) INIT (10); A. A = A*B; B. A = BIN(A)*B; C. A = A*DEC(B); D. A = BIN(A) * DEC(B); Answer: C Question: 96 What is the result of executing the following code? DCL B PlC 999 99 B = 4500; A. CONVERSION would be raised. B. B would contain a blank followed by 4500. C. B would contain 04500. D. B would contain 4500 followed by a blank. Answer: C Question: 97 Which of the following should be the first statement in an ON ERROR block? A. CALL PLIDUMP(TFBC); B. STOP; C. ON ERROR SYSTEM; D. REVERT ERROR; Answer: C Question: 98 What is the result, if any, of executing the following code? DCL A BIT(1) INIT(0B); DCL B BIT(1) INIT(0B); DCL C BIT(1) INIT(1B); A = B = C;
Page 33 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. The value of A is DS. B. The value of A is1S. C. The value of A is unpredictable. D. There is no result because the syntax is wrong. Answer: A Question: 99 Given the following code, what will be the output of the preprocessor? %DCL FLAG CHAR; %FIag = TEST ,OPT; %DCL FUN ENTRY; FUN(FIag) %FUN: PROC (S); DCL S CHAR; IF INDEX(S, TEST) > 0 THEN ANSWER (put (Test modus entered);) SKIP; IF INDEX(S, OPT) > 0 THEN ANSWER (put (Optimize modus entered);) SKIP; %END FUN; A. put (Test modus entered); put (Optimize modus entered); B. put (Test modus entered); C. put (Optimize modus entered); D. put (Fun(Flag)); Answer: A Question: 100 Under default condition enablement, what is the result of executing the following code? DCL A CHAR(5); A = 123ABC; A. STRINOSIZE would be raised. B. CONVERSION would be raised. C. A will have a value 123AB. D. A will have a value 23ABC. Answer: C Question: 101 Which of the following will print a line containing 1 and then a line containing DONE? A. DOJX= 1 TO 4; IF JX = 2 THEN LEAVE A; PUT SKIP LIST( JX); END; PUT SKIP LIST( DONE); B. DOJX= 1 TO 4; IF JX = 2 THEN GOTO B; PUT SKIP LIST( JX); B: END; PUT SKIP LIST( DONE); C. DOJX= 1 TO 4;
Page 34 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

IF JX = 2 THEN EXIT; PUT SKIP LIST( JX); END; PUT SKIP LIST( DONE); D. DO JX= 1 TO 4; IF JX = 2 THEN STOP; PUT SKIP LIST( JX); END; PUT SKIP LIST( DONE); Answer: A Question: 102 What statement must be used to move data from SYSIN in STREAM oriented mode? A. READ B. GET C. FETCH D. LOCATE Answer: B Question: 103 Given the following code, what will happen if the variable MAX has a value larger than 32767? DCLI FIXED BIN (15); DCL MAX FIXED BIN (31); DO I = 1 TO MAX; A. The loop will stop executing when I reaches a value of 32767. B. The loop will stop executing when I reaches the value in MAX. C. The loop will stop executing when I reaches a value equivalent to MAX + 1. D. The loop will stop executing with an ABEND or run infinitely. Answer: D Question: 104 What value will be output when the following code is executed? TEST: PROC OPTIONS(MAIN); DCLA(*) CONTROLLED FIXED BIN(31); ALLOC A(10); CALL SUB(A); PUT SKIP LIST( HBOUND(A,1)); SUB: PROC( B); DCL B(*) CONTROLLED FIXED BIN(31); ALLOC B(2*HBOUND (B,1)); ALLOC B( 2*HBOUND(B,1)); END; END; A. 10 B. 20 C. 30 D. 40
Page 35 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: D Question: 105 How should the file ACCOUNT be declared if the program first writes records to ACCOUNT and afterwards reads them back from ACCOUNT? A. DCL ACCOUNT FILE RECORD INPUT; B. DCL ACCOUNT FILE RECORD OUTPUT; C. DCL ACCOUNT FILE RECORD (INPUT.OUTPUT); D. DCL ACCOUNT FILE RECORD; Answer: D Question: 106 What happens after the following code is executed? DCL A CHAR(5) lNlT(ABCDE); DCL B CHAR(4) DEF A POS(2); A. The value of B is ABCD B. The value of B is BCDE C. The value of B is NULL. D. There is a syntax error. Answer: B Question: 107 What is the value of XY.A, if any, after executing the following code? DCL 1 XY, 2 A CHAR(4), 2 B BIN FIXED(31); DCL 1 YZ, 2 C CHAR(2) INIT(CC), 2 D PIC99 INIT(10); XY = YZ; A. CC10 B. CC C. CC D. CONVERSION would be raised. Answer: B Question: 108 Given the following declaration, the compiler will issue a warning message that says INITIAL list for the array A contains only one item.. Which INIT statement would correctly eliminate this message? DCL A(10) CHAR(5) INIT( ); A. INIT( COPY( .10))
Page 36 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

B. INIT((10) ) C. INIT( (10)( )) D. INIT(LOW(10)) Answer: C Question: 109 Which of the following options is proper for the PROC statement, but invalid for the ENTRY statement? A. OPTIONS(BYADDR) B. OPTIONS(COBOL) C. RETURNS(<attribute-list>) D. RECURSIVE Answer: D Question: 110 What is the output of the following program? MAIN: PROC OPTIONS(MAIN); DCL 1 A UNION, 2 5 CHAR(4) INIT(FADE), 2 C CHAR(2); C = BA; PUT SKIP LIST( B !! C); END; A. BA00BA B. BABABA C. BADEBA D. FADEBA Answer: C Question: 111 If the following syntax is incorrect, how should the syntax be changed? DCL A CHAR(100) BASED(P); DCL P PTR; ALLOCATE A; READ FILE(DDIN) INTO(A); A. READ FILE(DDIN) INTO(P); B. READ FILE(DDIN) SET(A); C. READ FILE(DDIN) TO(P); D. No changes are needed because the syntax is correct. Answer: D Question: 112 If the physical dataset referred to by DDOUT has a maximum record length of 200 and RECFM=V, what happens alter executing the following code?
Page 37 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL DDOUT FILE RECORD OUTPUT; DCLI BIN FIXED(15) INIT(0); DCL 1 OUTSTR, 2 A CF-IAR(150), 2 B CI-IAR(46); OPEN FILE(DDOUT); DO It 1 TO 10; WRITE FILE(DDOUT) FROM(OUTSTR); END; A. 10 records will be written to the output file. B. At runtime, an error will occur because of mismatch of record length. C. At compile time, an error will occur because of mismatch of record length. D. Nothing will be written to the output file. Answer: A Question: 113 Given the following code, which value is output on the last line? DCL N FIXED BIN (31); DCL X FIXED BIN (31) INIT (0); DON = 1 TO 7, 11 TO 15 WHILE (X< 20); X = N*N; PUT SKIP LIST (X); END; A. 16 B. 25 C. 49 D. 121 Answer: C Question: 114 What is the result, if any, or executing the following code? DCL A BIT(1) INIT(0B); DCLB BIT(1) INIT(0B); DCLC BIT(1) INIT(1B); A = ^B & C; A. The value of A is OS. B. The value of A is1S. C. The value of A is unpredictable. D. There is no result because the syntax is wrong. Answer: B Question: 115 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);
Page 38 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

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 :03000 C. THE VALUE OF B IS:3000 D. Nothing will be printed because CONVERSION would be raised. Answer: B Question: 116 What is the most appropriate declaration for the variable X? X = 1234567890.123; A. DCLXCHAP(14); B. DCLX BIN FIXED(15); C. DCLX DEC FIXED(153); D. DCLX PlC 99999999V.999; Answer: C Question: 117 What is the most appropriate declaration for the variable A? A = 10010001B; A. OCL A CHAR(2); B. OCL A BIT(8); C. OCL A PlC 9999999; D. OCL A BIN FIXED(15); Answer: B Question: 118 Which of the following statements must NOT be used to exit a BEGIN block? A. END B. GOTO C. LEAVE D. RETURN Answer: C Question: 119 What has to be done, if anything, when the compiler warns that a variable may be uninitialized when used? A. Use the DFT(INITFILL) compiler option so the message will disappear. B. Make sure the variable has a valid content before using it. C. Initialize the variable to blank. D. Ignore the message.
Page 39 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: B Question: 120 Given the following declarations, which code is always a valid way to test if the value of B is 7? DCL P POINTER NIT (NULL()); DCL B FIXED BIN (31) BASED (P); A. IF ^ = NULL() THEN IF B = 7 THEN PUT (OK); B. IF B ^ = 7 THEN; ELSE PUT (OK); C. IF B = 7 THEN PUT (OK); D. IF P ^= NULL() ! B = 7 THEN PUT (OK); Answer: A Question: 121 Given the following program, what will be output? TEST: PROC OPTIONS(MAIN); DCL 1 B, 2 B1 FIXED BIN(31) INIT(1), 2 B2 FIXED BIN(31) INIT(2), 2 B3 FIXED BIN(31) INIT(4), 2 B4( 4 ) FIXED BIN(31), 2 B5 FIXED BIN(31) INIT(5), 2 B6( 5 ) FIXED BIN(31); CALL SUB( ADDR(B) ); SUB: PROC( P); DCL P POINTER, N1 FIXED BIN(31), N2 FIXED BIN(31), 1 A BASED(P), 2 A1 FIXEDBIN(31), 2 A2 FIXEDBIN(31), 2 A3 FIXED BIN(31), 2 A4( N1 REFER(A3) ) CHAR(4), 2 A5 FIXED BIN(31), 2 A6( N2 REFER(A5) ) CHAR(4); PUT SKIP LIST ( STG(A)); END; END; A. 24 B. 36 C. 40 D. 52
Page 40 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

Answer: D Question: 122 If the physical dataset referred to by DDOUT has a maximum record length of 4096 and a RECFM=V, what happens after executing the following code? DCL DDOUT FILE RECORD OUTPUT; DCL OUT_CHAR CHAR(500) VARYING INIT(This is a varchar test); OPEN FILE(DDOUT); WRITE FILE(DDOUT) FROM(OUT_CHAR); A. One record with a length of 22 will be written to the output file. B. One record with a length of 500 will be written to the output file. C. One record with a length of 4096 will be written to the output file. D. An error will occur because of mismatch of record length. Answer: A Question: 123 What would be printed, if anything, to SYSPRINT after executing the following code? DCLA CHAR(5) INIT(1000); DCL B PlC S99999 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 :+03000 C. THE VALUE OF B IS: D. Nothing will be printed because CONVERSION would be raised. Answer: B Question: 124 Which of the following will be achieved when making a program FETCHABLE? A. Improved performance B. Larger load size of the main program C. Easier maintenance D. Reduced memory requirements for the FETCHed program Answer: C Question: 125 Given the following code, what is the value of X after execution of the assignment? DCL X CHAR (5) lNlT (ABCDE); DCL Y CHAR (3) lNlT (123); X=Y
Page 41 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. 123 followed by DE B. 123 followed by low values C. 123 followed by blanks D. ABCDE Answer: C Question: 126 What is the result of executing the following code? DCLA CHAR(6) INIT(100.50); DCL B BIN FIXED(15) INIT(50); B = A + B; A. The value of B is 150. B. The value of B is 150.50. C. The value of B is 101. D. CONVERSION would be raised. Answer: A Question: 127 Given the following code, what condition prefixes should be placed before the statement to ensure that the reference is valid? PUT SKIP LIST( < !! SUBSTR(X,1 ,N) !!>); A. SIZE B. SUBSCRIPTRANGE C. STRINGSIZE D. STRINGRANGE Answer: D Question: 128 When the following program is executed, the compiler will produce this warning message: FIXED DEC(7,2) operand will be converted to FIXED OIN(25,7). Significant digits may be lost. The best way to fix this problem and have the output value be 29.20 is to change the last assignment statement to which of the following? TEST: PROC; DCL 1 REC_OUT, 03 AVAIL FIXED BIN(31), 03 TOTAL_SPARE FIXED DECIMAL(7,2), 03 WORK_TOTAL FIXED DECIMAL(7,2); AVAIL= 17; WORK_TOTAL = 12.2; TOTAL_SPARE = AVAIL + WORK_TOTAL PUT SKIP LIST( TOTAL_SPARE); END;
Page 42 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. TOTAL_SPARE = DEC( AVAIL + WORK_TOTAL); B. TOTAL_SPARE = DEC(AVAIL) + WORK_TOTAL; C. TOTAL_SPARE = AVAIL + BIN( WORK_TOTAL); D. TOTAL_SPARE = BIN( AVAIL + WORK_TOTAL); Answer: B Question: 129 What is the value of A after executing the following code? DCL A CHAR(8) NIT (EfGhIjKI); DCL TRANSLATE BUILTIN; A = TRANSLATE(A,ABCDEFGH,abcdefgh); A. efghijkl B. efghIjKI C. EFGHIJKL D. EFGHIjKI Answer: D Question: 130 Which of the following must be used to load and unload a program to and from main memory? A. FETCH and RELEASE B. LOAD and UNLOAD C. ALLOCATE and FREE D. GET and PUT Answer: A Question: 131 What are the values of the elements of the array A, if any, after executing the following code? DCLA(5) BIN FIXED(15) INIT((5)(0)); DCL I BIN FIXED(31); DO I =-1 TO 1; A(l) = 1; END; A. 1,1,1,0,0 B. 1,0,0,0,0 C. There is a syntax error. D. SUBSCRIPTRANGE would be raised if enabled. Answer: D Question: 132 What will be the output of the following program? MAIN: PROC OPTIONS(MAIN); DCL A CONTROLLED FIXED BIN(31);
Page 43 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL B CONTROLLED FIXED BIN(31); DCL JX FIXED BIN(31); DO JX= 1 TO 4; ALLOC A; A = JX; END; DO WHILE( ALLOCN(A)> 0); ALLOC B; B = A; FREE A; END; DO WHILE( ALLOCN(B) > 0); PUT SKIP LIST( B); FREE B; END; END; A. 1111 B. 1234 C. 4321 D. 4444 Answer: B Question: 133 If FUNC_CODE is a CHAR(4) variable, then for the following code, what is the best declaration for GHU, GU, etc SELECT( FUNC CODE); WHEN( GHU) WHEN( GU ) etc END; A. DCL (GHU INIT(GHU), GU INIT(GU), ) CHAR(4); B. DCL (GHU INIT(GHU), GU INIT(GU), ) CHAR(4) STATIC; C. DCL (GHU VALUE(GHU), GU VALUE(GU), ) CHAR(4); D. DCL (GHU INIT(GHU), GU INIT(GU), ) CHAR(4) AUTOMATIC; Answer: C Question: 134 What must be done, if anything, before calling the program U if it is declared as follows? DCL U ENTRY OPTIONS (FETCHASLE); A. FETCH U; B. ALLOCATE U; C. LOAD U; D. Nothing needs to be done. Answer: D Question: 135 Given the following code:
Page 44 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL (K, L) FIXED BIN (31) INIT (0); 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,0 B. 0,10 C. 10,0 D. 10,10 Answer: C Question: 136 Given the following declarations, which code is INVALID? DCL (P,Q) POINTER; DCLX CHAR(16) BASED(P); A. ALLOCXSET(P); FREE X; B. P = ALLOC(STG(X)); FREE X; C. P = AUTO(STG(X)); FREE X; D. ALLOCXSET(Q); P = Q; FREE X; Answer: C Question: 137 If the following syntax is incorrect, how should the syntax be changed? READ FILE(DDIN) IN STRUC1; A. READ FILE(DDIN) INTO STRUC1; B. READ FILE(DDIN) IN(STRUC1); C. READ FILE(DDIN) INTO(STRUC1); D. No changes are necessary. Answer: C Question: 138 Which message will be displayed, if any, when the following code is executed with the Enterprise PL/I compiler using default compiler options?
Page 45 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL 1 STRUCTURE, 2 A CHAR(4), 2 P PTR; STRUCTURE = ; SELECT (P); WHEN (NULL()) PUT LIST (P IS NULL); WHEN (SYSNULLO) PUT LIST (P IS SYSNULL); OTHERWISE PUT LIST (P is something else); END; A. P is SYSNULL B. P NULL C. P is something else D. The compiler will generate an error for the assignment statement. Forcing execution will produce unpredictable results. Answer: C Question: 139 What will be printed to SYSPRINT, if anything, after executing the following code? DCL A PlC 9999. A = 123; PUT SKIP LIST(VALUE OF A lS: !! A); A. VALUE OF A lS: 123 B. VALUE OF A lS :0123 C. VALUE OF A IS: 123 D. No value will be displayed because the assignment statement will cause a conversion error. Answer: A Question: 140 What happens, if anything, after end of rile has been reached in the following code? DCL INF FILE RECORD INPUT; DCL INFIELD CHAR(100) BASED(P); DCL P PTR; DCL EOF BIT(1) INIT(0B); ON ENDFILE(INF) BEGIN; EOF = 16; ALLOC INFIELD; INFIELD = EOF REACHED; END; OPEN FILE(INF); READ FILE(INF) SET(P); DO WHILE(^EOF); READ FILE(INF) SET(P); END;
Page 46 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

A. Runtime error because there is no CLOSE statement. B. INFIELD will have a value EOF REACHED and the program ends. C. There will be an infinite loop. D. Nothing because end of file will never be reached. Answer: B Question: 141 For which of the following data representations is a variable declared with the attribute WIDECHAR meant to be used? A. ASCII B. EBCDIC C. UTF-16 D. GRAPHIC Answer: C Question: 142 Given the following code, how many times is the PUT statement executed? DCL I FIXED BIN (31) INIT (0); L1: DO LOOP; I += 1; DO LOOP; I += 1; IF I >= 10 THEN LEAVE L1; PUT SKIP LIST (I); END; END; A. 7 B. 8 C. 9 D. 10 Answer: B Question: 143 Which of the following is a DEC FIXED constant? A. 1000.10 B. 100010B C. 1E+03 D. 100010B Answer: A Question: 144 In order to use a pointer to access the variable in the following program, with what storage class should Y be declared? A: PROC OPTIONS(MAIN); DCLX FIXED BIN(31) BASED;
Page 47 of 48

Exam Name: Exam Type: Exam Code:

Programming with IBM Enterprise PL/I IBM 000-041

Total Questions:

146

DCL P POINTER; P = FUNC(); PUT SKIP LIST( P->X); FUNC: PROC RETURNS( POINTER); DCL Y FIXED BIN(31) INIT(17); DCL P POINTER; P = ADDR(Y); RETURN( P); END; END; A. AUTOMATIC B. BASED C. CONTROLLED D. STATIC Answer: D Question: 145 What is the key difference between logical file name and physical dataset name? A. Logical file name is used in the program while physical dataset is not. B. Physical dataset name is used in the program while logical file name is not. C. Logical file name is used in the job control while physical dataset is not. D. Physical dataset name is used in the job control while logical file name is not. Answer: A Question: 146 Which of the following is NOT a possible cause of the following compiler message? The end of the source was reached before the logical end of the program. A. The program is missing a closing quote in some string. B. The program is missing an end of comment. C. The program is missing an END statement. D. The program is missing the name of the outermost PROCEDURE on the last END statement. Answer: D

End of Document

Page 48 of 48

Você também pode gostar