Saturday, July 11, 2009

IBM 000-041 Free Braindumps - Part 3

Cheat-test > IBM Exams

View All Cheat-Test IBM Certification Exams

Cheat-test.com 000-041 Exam Questions:


Q: 51 What is the result, if any, of executing the following code?
DCL B DEC FIXED(15,3) INIT(12345.12);
DCL C PIC '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 PIC.
C. The result in C is 12345 with 5 leading zeroes.
D. The result in C is 1234512 with 3 leading zeroes.
Answer: C
Q: 52 Given the following piece of code, which loop construct using WHILE or
UNTIL will give identical output?
DCL I 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. I = 10;
DO WHILE (I >= 1);
I = I - 1;
PUT (I);
END;
C. I = 10;
DO UNTIL (I < 1);
PUT (I);
I = I - 1;
END;
D. I = 10;
DO UNTIL (I > 1);
PUT (I);
I = I - 1;
END;
Answer: C
Q: 53 What code will print the value of A to SYSPRINT?
DCL A 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 LIST A;
Answer: A
Q: 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;
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 );
DCL X FIXED UNSIGNED;
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
Q: 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 Y's 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
Q: 56 Given the following code, how many elements of A will contain a value of 0
after execution of the loops?
DCL 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) = I*K;
END;
END;
A. 0
B. 1
C. 8
D. 10
Answer: D
Q: 57 What happens after executing the following code?
DCL A 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
Q: 58 Given the following code in a program, which code will NOT change the
program's behavior when the ENDFILE(SYSIN) condition is raised?
ON ENDFILE (SYSIN) GOTO START;
A. ON ENDFILE (SYSIN);
B. ON ENDFILE (SYSIN) EOF = '1'B;
C. REVERT ENDFILE (SYSIN);
D. SIGNAL ENDFILE (SYSIN);
Answer: D
Q: 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
Q: 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);
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
Q: 61 What value is output by the following program?
TEST: PACKAGE;
DCL N EXT FIXED BIN(31) INIT(10);
DCL C(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
Q: 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
1 A,
3 A1 FIXED BIN(31),
3 A2,
3 A3 FIXED BIN(31),
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
Q: 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. IF A < 1 THEN
B += 1;
ELSE
IF A < 2 THEN
B += 2;
ELSE
IF A < 3 THEN
B += 3;
ELSE
B = 0;
B. IF A < 1 THEN 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
Q: 64 What happens to the STATIC variables in the program U, if anything,
after executing the following code?
FETCH U;
CALL U;
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
Q: 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 = '1'B;
END;
B. ON ENDFILE (SYSIN)
BEGIN;
PUT LIST('End of file reached.');
EOF = '1'B;
END;
C. IF EOF THEN
DO;
K = 0;
L = 1;
END;
D. IF EOF THEN
BEGIN;
K = 0;
L = 1;
END;
Answer: A
Q: 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('0'B);
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 = '1'B;
END;
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
Q: 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
Q: 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
Q: 69 What is the result of executing the following code?
DCL A CHARACTER (4) INIT('10.5');
DCL B DEC FIXED(7,1) 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
Q: 70 Under default condition enablement, what is the result of executing the
following code?
DCL X CHAR(5) INIT('A1234');
DCL Y PIC '9999' INIT(0);
Y = X;
A. The value of Y is A123.
B. The value of Y is 1234.
C. CONVERSION would be raised.
D. STRINGSIZE would be raised.
Answer: C
Q: 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: PROC( 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,'0111'B) THEN
Answer: B
Q: 72 What is the most appropriate declaration for the variable X?
X = 1.123E+4;
A. DCL X CHAR(4);
B. DCL X PIC '9999';
C. DCL X DEC FLOAT(16);
D. DCL X DEC FIXED(15,3);
Answer: C
Q: 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 INPUT;
DCL 1 INSTR,
2 A CHAR(150),
2 B CHAR(150);
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


Sponsored by cheat-test.com

The End