Beruflich Dokumente
Kultur Dokumente
com
000-041
IBM
Programming with IBM Enterprise PL/I
http://www.twpass.com/twpass.com/exam.aspx?eCode= 000-041
The 000-041 practice exam is written and formatted by Certified Senior IT Professionals working in
today's prospering companies and data centers all over the world! The 000-041 Practice Test covers all
the exam topics and objectives and will prepare you for success quickly and efficiently.
The 000-041 exam is very challenging, but with our 000-041 questions and answers practice exam,
you can feel confident in obtaining your success on the 000-041 exam on your FIRST TRY!
IBM 000-041 Exam Features
- Detailed questions and answers for 000-041 exam
- Try a demo before buying any IBM exam
- 000-041 questions and answers, updated regularly
- Verified 000-041 answers by Experts and bear almost 100% accuracy
- 000-041 tested and verified before publishing
- 000-041 exam questions with exhibits
- 000-041 same questions as real exam with multiple choice options
Acquiring IBM certifications are becoming a huge task in the field of I.T. More over these
exams like 000-041 exam are now continuously updating and accepting this challenge is itself a task.
This 000-041 test is an important part of IBM certifications. We have the resources to
prepare you for this. The 000-041 exam is essential and core part of IBM certifications and
once you clear the exam you will be able to solve the real life problems yourself.Want to take
advantage of the Real 000-041 Test and save time and money while developing your skills to pass
your IBM 000-041 Exam? Let us help you climb that ladder of success and pass your 000-041 now!
000-041
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 is1
B.
C. The value of A is unpredictable.
D. There is no result, because the syntax is wrong.
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=1
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 2
What does BX.WOK.LOAD refer to in the following job control statement? I/ACCOUNT DD
DSN=BX.WOK.LOAD,DISP=SHR
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=3
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 4
Given the following code, with what attribute should the variable EOF be declared? DO
WHILE(^EOF);
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=5
-------------------------------------------------------------------------------------------------------------------------------------
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);
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. 10
B. 7
C. 5
D. 4
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=7
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 8
Which of the following is a BIN FIXED constant?
A. 1000
B. 1E+03
C. 1000
D. 1000B
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=8
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 9
Which of the following is NOT a valid method to activate a BEGIN block?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=10
-------------------------------------------------------------------------------------------------------------------------------------
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) 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=11
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=12
-------------------------------------------------------------------------------------------------------------------------------------
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;
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. BIN FIXED
B. DEC FIXED
C. CHAR
D. PICTURE
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=14
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 15
What is the most appropriate declaration for the variable A? A = ABCDEF;
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=15
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 16
Which of the following would NOT access the third element of A? DCL 1XY(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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=16
-------------------------------------------------------------------------------------------------------------------------------------
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;
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); 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=18
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 19
What is the value of A after executing the following code? DCL A CHAR(6) INIT
QUESTION: 20
What does the following code do, if anything? RELEASE U;
QUESTION: 21
Which of the following is a BIT string constant?
A. 1000
B. 1000
C. 1000B
D. 1000B
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=21
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 22
What is the most appropriate way to assign a value to variable A? DCLA BIN FIXED(15);
A. A = 17;
B. A = 17.29;
C. A =1729X;
D. A = 17;
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=22
-------------------------------------------------------------------------------------------------------------------------------------
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
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=23
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=24
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 25
What should be done, if anything, when the following compiler message appears? Multiple
closure of blocks, one extra END statement assumed.
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);
QUESTION: 27
In which of the following situations can a subroutine be replaced by a function without any
major changes to the code?
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;
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=28
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 29
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);
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;
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=31
-------------------------------------------------------------------------------------------------------------------------------------
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);
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),
2X1
PIC(76)X
2 X 2 PIC9999 X = ; 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; A- SUB1 B- SUB2 C- SUB3 D- SUB4
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=33
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 34
Given the following code, what declaration of I will cause an infinite loop under default
condition enablement? DO I = 1 TO 99;
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));
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=36
-------------------------------------------------------------------------------------------------------------------------------------
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?
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.
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=38
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=39
-------------------------------------------------------------------------------------------------------------------------------------
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;
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);
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=41
-------------------------------------------------------------------------------------------------------------------------------------
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 = ;
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;
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 44
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.
D. An error will occur because of mismatch of record length.
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=44
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 45
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=45
-------------------------------------------------------------------------------------------------------------------------------------
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;
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;
ALLOC A; PUT SKIP LIST( STG(A)); END;
A. 22
B. 24
C. 62
D. 72
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=47
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=48
-------------------------------------------------------------------------------------------------------------------------------------
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?
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);
D. X = NULL();
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=50
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 51
What is the result, if any, of executing the following code? DCL B DEC FIXED(15,3)
INIT(12345.12); DCL C PlC 9999999999 INIT (0); C = B;
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;
B. 1= 10;
C. 1= 10;
D. 1= 10;
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=52
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=53
-------------------------------------------------------------------------------------------------------------------------------------
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?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=55
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=56
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 57
What happens after executing the following code? DCLA BIN FIXED(15); A = 1_000
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=58
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 59
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=59
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 60
Which of the following loops will run infinitely?
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=60
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=61
-------------------------------------------------------------------------------------------------------------------------------------
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), 3 A4 FIXED BIN(31); END;
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;
QUESTION: 64
What happens to the STATIC variables in the program U, if anything, alter executing the
following code? FETCH U; CALL U; RELEASE U; FETCH U;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=65
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=67
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=68
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=69
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=71
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=72
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 73
happens after executing the following code? DCL DDIN FILE RECORD lNPUT DCL 1
INSTR, 2 A CHAR(150), 2 B CHAR(150); OPEN FILE(DDIN); READ FILE(DDIN)
INTO(INSTR);
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=74
-------------------------------------------------------------------------------------------------------------------------------------
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
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=75
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=76
-------------------------------------------------------------------------------------------------------------------------------------
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;
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.
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=78
-------------------------------------------------------------------------------------------------------------------------------------
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;
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=81
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 82
Given the following code, how many times is the loop executed? 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=82
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=83
-------------------------------------------------------------------------------------------------------------------------------------
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; 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=84
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=85
-------------------------------------------------------------------------------------------------------------------------------------
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
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=86
-------------------------------------------------------------------------------------------------------------------------------------
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));
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=88
-------------------------------------------------------------------------------------------------------------------------------------
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;
D. X=D;
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=89
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=90
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 91
Which of the following is NOT mandatory for an external function procedure and its usage?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=92
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 93
Which of the following builtins is the only one that returns a value?
A. PLICKPT
B. PLISRTC
C. PURETV
D. PLIRETC
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=93
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 94
When different data types are used in an expression, which other following conversions is NOT
done by subroutine call?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=95
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 96
What is the result of executing the following code? DCL B PlC 999 99 B = 4500;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=97
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=98
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=99
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 100
Under default condition enablement, what is the result of executing the following code? DCL
A CHAR(5); A = 123ABC;
QUESTION: 101
Which of the following will print a line containing 1 and then a line containing DONE?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=102
-------------------------------------------------------------------------------------------------------------------------------------
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; 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=103
-------------------------------------------------------------------------------------------------------------------------------------
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
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=104
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 105
How should the file ACCOUNT be declared if the program first writes records to ACCOUNT
and afterwards reads them back from ACCOUNT?
QUESTION: 106
What happens after the following code is executed? DCL A CHAR(5) lNlT(ABCDE); DCL
B CHAR(4) DEF A POS(2);
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=107
-------------------------------------------------------------------------------------------------------------------------------------
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))
B. INIT((10) )
C. INIT( (10)( ))
D. INIT(LOW(10))
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=108
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=109
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=110
-------------------------------------------------------------------------------------------------------------------------------------
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);
QUESTION: 112
RECFM=V, what happens alter executing the following code? DCL DDOUT FILE RECORD
OUTPUT; DCLI BIN FIXED(15) INIT(0); DCL 1 OUTSTR, 2 A CF-IAR(150), 2 B CIIAR(46); OPEN FILE(DDOUT); DO It 1 TO 10; WRITE FILE(DDOUT)
FROM(OUTSTR); END;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=113
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=114
-------------------------------------------------------------------------------------------------------------------------------------
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); B = A + B; PUT SKIP
LIST(THE VALUE OF B IS: !! 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=116
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=117
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=118
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 119
What has to be done, if anything, when the compiler warns that a variable may be uninitialized
when used?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=120
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 121
Given the following program, what will be output? TEST: PROC OPTIONS(MAIN); DCL 1
A. 24
B. 36
C. 40
D. 52
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=121
-------------------------------------------------------------------------------------------------------------------------------------
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);
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);
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=124
-------------------------------------------------------------------------------------------------------------------------------------
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
A. 123 followed by DE
B. 123 followed by low values
C. 123 followed by blanks
D. ABCDE
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=125
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=127
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=129
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 130
Which of the following must be used to load and unload a program to and from main memory?
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=131
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 132
What will be the output of the following program? MAIN: PROC OPTIONS(MAIN); DCL A
CONTROLLED FIXED BIN(31); 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=132
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=133
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=134
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 135
Given the following code: 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=135
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=136
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 137
If the following syntax is incorrect, how should the syntax be changed? READ FILE(DDIN)
IN STRUC1;
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? 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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=138
-------------------------------------------------------------------------------------------------------------------------------------
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);
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=141
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=142
-------------------------------------------------------------------------------------------------------------------------------------
QUESTION: 143
Which of the following is a DEC FIXED constant?
A. 1000.10
B. 100010B
C. 1E+03
D. 100010B
Answer: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=143
-------------------------------------------------------------------------------------------------------------------------------------
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;
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=144
-------------------------------------------------------------------------------------------------------------------------------------
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: http://www.twpass.com/twpass.com/exam.aspx?ecode=000-041&qno=145
-------------------------------------------------------------------------------------------------------------------------------------
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.