[Free] 2018(Jan) EnsurePass Examcollection IBM C9050-041 Dumps with VCE and PDF 31-40

Ensurepass.com : Ensure you pass the IT Exams
2018 Jan IBM Official New Released C9050-041
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/C9050-041.html

Programming with IBM Enterprise PL/I

Question No: 31 – (Topic 1)

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?

  1. SUB1: PROC( X );DCL X FIXED UNSIGNED;IF X = 0 THENPUT SKIP LIST ( #39;A#39;);ELSEIF X = 1 THENPUT SKIP LIST ( #39;B#39;);ELSEIF X = 2 THENPUT SKIP LIST ( #39;C#39;);ELSEIF X = 3 THENPUT SKIP LIST ( #39;D#39;);ELSEPUT SKIP LIST ( #39;E#39;);END;

  2. SUB2: PROC ( X );DCL X FIXED UNSIGNED;IF X lt; 2 THENIF X = 0 THENPUT SKIP LIST ( #39;A#39;);ELSEPUT SKIP LIST ( #39;B#39;);ELSEIF X = 2 THENPUT SKIP LIST ( #39;C#39;);ELSEIF X

    = 3 THENPUT SKIP LIST ( #39;D#39;);ELSEPUT SKIP LIST ( #39;E#39;);END;

  3. SUB3: PROC( X ); DCL X FIXED UNSIGNED;SELECT;WHEN ( X = 0 )PUT SKIP LIST ( #39;A#39;);WHEN( X = 1 )PUT SKIP LIST ( #39;B#39;);WHEN( X = 2 )PUT SKIP LIST ( #39;C#39;);WHEN( X = 3 )PUT SKIP LIST ( #39;D#39;);OTHERWISEPUT SKIP LIST ( #39;E#39;);END;END;

  4. SUB4: PROC( X ); DCL X FIXED UNSIGNED;SELECT ( X );WHEN ( 0 )PUT SKIP LIST ( #39;A#39;);WHEN ( 1 )PUT SKIP LIST ( #39;B#39;);WHEN ( 2 )PUT SKIP LIST ( #39;C#39;);WHEN ( 3 )PUT SKIP LIST ( #39;D#39;);OTHERWISEPUT SKIP LIST ( #39;E#39;);END;END;

Answer: D

Question No: 32 – (Topic 1)

To validate the assignment in the following code, which condition should be enabled?

TEST: PROC(A, B);

DCL (A, B) CHAR (*); A = B;

END;

  1. SIZE

  2. STRINGRANGE

  3. STRINGSIZE

  4. SUBSCRIPTRANGE

Answer: C

Question No: 33 – (Topic 1)

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

Question No: 34 – (Topic 1)

The following code calls an external function procedure. Which program matches the entry declaration?

DCL F FLOAT; DCL X CHAR(1);

DCL FUN ENTRY (FIXED BIN (15), FLOAT) RETURNS (CHAR(1)); X = FUN(1, F);

  1. FUN: PROCEDURE (K, F) RETURNS (CHAR(1));DCL K FIXED BIN (15);DCL F FLOAT;END;

  2. FUN: PROCEDURE (K, F) RETURNS (CHAR(1));DCL K FIXED BIN (31);DCL F FLOAT;END;

  3. FUN: PROCEDURE (K, F) RETURNS (CHAR(1));DCL K FIXED DEC (15);DCL F FLOAT;END;

  4. FUN: PROCEDURE (K, F) RETURNS (FIXED BIN (15));DCL K FIXED BIN (15);DCL F FLOAT;END;

Answer: A

Question No: 35 – (Topic 1)

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(#39;Hello World#39;); WRITE FILE(DDOUT) FROM(OUT_CHAR);

  1. One record with a length of 11 will be written to the output file.

  2. One record with a length of 200 will be written to the output file.

  3. Compiler error because there is no OPEN statement.

  4. Runtime error because there is no OPEN statement.

Answer: B

Question No: 36 – (Topic 1)

Given the following code, what construct is equivalent?

SELECT;

WHEN (A lt; 1) B = 1; WHEN (A lt; 2) B = 2; WHEN (A lt; 3) B = 3; OTHERWISE B = 0; END;

  1. IF A lt; 1 THENB = 1;ELSEIF A lt; 2 THENB = 2;ELSEIF A lt; 3 THENB = 3;ELSEB = 0;

  2. IF A lt; 1 THEN B = 1;IF A lt; 2 THEN B = 2;IF A lt; 3 THEN B = 3;ELSE B = 0;

  3. SELECT;WHEN (A lt; 3) B = 3;WHEN (A lt; 2) B = 2;WHEN (A lt; 1) B = 1;OTHERWISE B = 0;END;

  4. SELECT;WHEN (A lt; 1) B = 1;WHEN (A lt; 2) B = 2;WHEN (A lt; 3) B = 3;END;

Answer: A

Question No: 37 – (Topic 1)

Given the following program, the compiler will produce the warning message quot;The structure member A2 is declared without any data attributes. A level number may be incorrect.quot;.

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;

  1. Add the attribute CHAR(8) to the declare for A2

  2. Change the level number on the declare for A2 to 2

  3. Change the level number on the declare for A3 to 4

  4. Change the level numbers on the declares for A3 and A4 to 4

Answer: D

Question No: 38 – (Topic 1)

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);

  1. READ FILE(DDIN) SET(A);

  2. READ FILE(DDIN) INTO(P);

  3. READ FILE(DDIN) SET(P);

  4. No changes necessary because the code is correct.

Answer: C

Question No: 39 – (Topic 1)

Which of the following pieces of code will result in a compiler error message?

  1. ON ENDFILE (SYSIN)DO;PUT LIST(#39;End of file reached.#39;);EOF = #39;1#39;B;END;

  2. ON ENDFILE (SYSIN)BEGIN;PUT LIST(#39;End of file reached.#39;);EOF = #39;1#39;B;END;

  3. IF EOF THENDO;K = 0;L = 1;END;

  4. IF EOF THENBEGIN;K = 0;L = 1;END;

Answer: A

Question No: 40 – (Topic 1)

What is the most appropriate declaration for the variable A?

A = #39;ABCDEF#39;;

  1. DCL A BIN FIXED(15);

  2. DCL A CHAR(6);

  3. DCL A DEC FIXED (15,3);

  4. DCL A PIC #39;999999#39;;

Answer: B

100% Ensurepass Free Download!
Download Free Demo:C9050-041 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2018 EnsurePass C9050-041 Full Exam PDF and VCE

EnsurePass ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No