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

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...

IBM 000-041 Free Braindumps - Part 1

Cheat-test > IBM Exams

View All Cheat-Test IBM Certification Exams

Cheat-test.com 000-041 Exam Questions:

Q: 1 What is the result, if any, of executing the following code?
DCL A BIT(1) INIT('0'B);
DCL B BIT(1) INIT('0'B);
DCL C BIT(1) INIT('1'B);
A = B ! C;
A. The value of A is '0'B
B. The value of A is '1'B.
C. The value of A is unpredictable.
D. There is no result, because the syntax is wrong.
Answer: B

Q: 2 What does BX.WOK.LOAD refer to in the following job control statement?
//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
Q: 3 What will be printed when the following subroutine is called for the third
time?
A : PROC;
DCL X PIC '9' INIT(0);
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
Q: 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)
Answer: B
Q: 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 = '11111111'B;
C. A = 11111111B;
D. A = -1;
Answer: B
Q: 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
Q: 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. 10
B. 7
C. 5
D. 4
Answer: C
Q: 8 Which of the following is a BIN FIXED constant?
A. '1000'
B. 1E+03
C. 1000
D. 1000B
Answer: D
Q: 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
Q: 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. PIC
Answer: B
Q: 11 Given the following code, what SELECT code is NOT equivalent?
DCL (C, W, V) CHAR (1);
...
SELECT (C);
WHEN ('A', 'B') PUT ('1');
WHEN ('C') PUT ('2');
WHEN (W) PUT ('3');
WHEN (V) PUT ('4');
OTHER PUT ('0ther');
END;
A. SELECT (C);
WHEN ('C') PUT ('2');
WHEN ('A', 'B') PUT ('1');
WHEN (W) PUT ('3');
WHEN (V) PUT ('4');
OTHER PUT ('0ther');
END;
B. SELECT (C);
WHEN ('A', 'B') PUT ('1');
WHEN ('C') PUT ('2');
WHEN (V) PUT ('4');
WHEN (W) PUT ('3');
OTHER PUT ('0ther');
END;
C. SELECT (C);
WHEN ('B', 'A') PUT ('1');
WHEN ('C') PUT ('2');
WHEN (W) PUT ('3');
WHEN (V) PUT ('4');
OTHER PUT ('0ther');
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 ('0ther');
END;
Answer: B
Q: 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
Q: 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
Q: 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. BIN FIXED
B. DEC FIXED
C. CHAR
D. PICTURE
Answer: D
Q: 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 (15,3);
D. DCL A PIC '999999';
Answer: B
Q: 16 Which of the following would NOT access the third element of A?
DCL 1 XY(5),
2 A(4) CHAR(4);
A. XY(1,3).A
B. XY.A(1,3)
C. XY(1).A(3)
D. XY(3).A(1)
Answer: D
Q: 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
Q: 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 );
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
Q: 19 What is the value of A after executing the following code?
DCL A CHAR(6) INIT ('ABCDEF');
DCL B CHAR(10) INIT ('0123456789');
A = SUBSTR(B,5,3);
A. '456 '
B. ' 456'
C. '456DEF'
D. 'ABC456'
Answer: A
Q: 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
Q: 21 Which of the following is a BIT string constant?
A. 1000
B. '1000'
C. '1000'B
D. 1000B
Answer: C
Q: 22 What is the most appropriate way to assign a value to variable A?
DCL A BIN FIXED(15);
A. A = '17';
B. A = 17.29;
C. A = '1729'X;
D. A = 17;
Answer: D
Q: 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
Q: 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
Q: 25 What should be done, if anything, when the following compiler message
appears? 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

To be continued...