Saturday, July 11, 2009

IBM 000-041 Free Braindumps - Part 2

Cheat-test > IBM Exams

View All Cheat-Test IBM Certification Exams

Cheat-test.com 000-041 Exam Questions:


Q: 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
Q: 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;
Answer: D
Q: 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('Hello 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
Q: 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;
DCL Y 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
Q: 31 What is the result, if any, of executing the following code?
DCL A CHAR(2) INIT(' ');
DCL B BIT(2) INIT('11'B);
A = ^B;
A. The value of A is '00'.
B. The value of A is '11'.
C. The value of A is unpredictable.
D. There is no result, because the syntax is wrong.
Answer: A
Q: 32 What would be printed to SYSPRINT after executing the following code?
DCL A DEC FIXED(15,3) INIT(1000.123);
DCL B PIC '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
Q: 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 PIC'9999';
DCL Y CHAR(20);
CALL SUB1( ADDR(X) );
CALL SUB2( ADDR(X) );
CALL SUB3( ADDR(X) );
CALL SUB4( ADDR(X) );
SUB1: PROC( P );
DCL P POINTER;
DCL
1 X BASED(P),
2 X1 CHAR(76),
2 X2 PIC'9999';
X = '';
END;
SUB2: PROC( P );
DCL P POINTER;
DCL
1 X BASED(P),
2 X1 PIC'(76)X',
2 X2 PIC'9999';
X = '';
END;
SUB3: PROC( P );
DCL P POINTER;
DCL X CHAR(80) BASED(P);
X = '';
END;
SUB4: PROC( P );
DCL P POINTER;
DCL X CHAR(100) BASED(P);
X = '';
END;
END;
A. SUB1
B. SUB2
C. SUB3
D. SUB4
Answer: D
Q: 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 DEC (3,0);
C. DCL I PIC'99';
D. DCL I FLOAT;
Answer: C
Q: 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
Q: 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) INIT ('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
Q: 37 Which of the following techniques will NOT cause a referenced external
subprocedure 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 subprocedure
C. Having a FETCH statement for the subprocedure
D. Having a RELEASE statement for the subprocedure
Answer: B
Q: 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.
Answer: C
Q: 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
Q: 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('1111111'x);
C. DCL B BIT(64) INIT('1'B);
D. DCL B BIT(64) INIT(HIGH(1));
Answer: A
Q: 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;
Answer: A
Q: 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 B BIN FIXED(31),
2 C DEC FIXED(7),
2 D PIC '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 D are zeros.
Answer: A
Q: 43 Given the following piece of code, how many times is the loop executed?
DCL I 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
Q: 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
Q: 45 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(1) INIT('0'B);
ON ENDFILE(INF) BEGIN;
EOF = '1'B;
PUT SKIP LIST(INFIELD);
END;
OPEN FILE(INF);
READ FILE(INF) SET(P);
DO WHILE(^EOF);
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
Q: 46 What is the result of executing the following code?
DCL A 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
Q: 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(31),
2 A2 FIXED BIN(31),
2 A3 FIXED BIN(31),
2 A4( N1 REFER(A3) ) CHAR(10) VAR;
N1 = 5;
ALLOC A;
PUT SKIP LIST( STG(A) );
END;
A. 22
B. 24
C. 62
D. 72
Answer: D
Q: 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
Q: 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 CHAR(10) VAR, and the corresponding parameter is declared as CHAR(10).
Answer: C
Q: 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


To be continued...