最新的IBM Programming with IBM Enterprise PL/I - 000-041免費考試真題
CORRECT TEXT
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;
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
CORRECT TEXT
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;
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;
正確答案: B
CORRECT TEXT
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( '');
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( '');
正確答案: D
CORRECT TEXT
What is the value of A after executing the following code?
DCL A CHAR(6) INIT ('ABCDEF);
DCL B CHAR(10) NIT ('0123456789');
A = SUBSTR(B,5,3);
What is the value of A after executing the following code?
DCL A CHAR(6) INIT ('ABCDEF);
DCL B CHAR(10) NIT ('0123456789');
A = SUBSTR(B,5,3);
正確答案: A
CORRECT TEXT
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);
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);
正確答案: C
CORRECT TEXT
Given the following program, what will be output?
TEST: PROC OPTIONS(MAIN);
DCL
1 B,
2 B1 FIXED BIN(31) INIT(1),
2 B2 FIXED BIN(31) INIT(2),
2 B3 FIXED BIN(31) INIT(4),
2 B4( 4 ) FIXED BIN(31),
2 B5 FIXED BIN(31) INIT(5),
2 B6( 5 ) FIXED BIN(31);
CALL SUB( ADDR(B) );
SUB: PROC( P);
DCL
P POINTER,
N1 FIXED BIN(31),
N2 FIXED BIN(31),
1 A BASED(P),
2 A1 FIXEDBIN(31),
2 A2 FIXEDBIN(31),
2 A3 FIXED BIN(31),
2 A4( N1 REFER(A3) ) CHAR(4),
2 A5 FIXED BIN(31),
2 A6( N2 REFER(A5) ) CHAR(4);
PUT SKIP LIST ( STG(A));
END; END;
Given the following program, what will be output?
TEST: PROC OPTIONS(MAIN);
DCL
1 B,
2 B1 FIXED BIN(31) INIT(1),
2 B2 FIXED BIN(31) INIT(2),
2 B3 FIXED BIN(31) INIT(4),
2 B4( 4 ) FIXED BIN(31),
2 B5 FIXED BIN(31) INIT(5),
2 B6( 5 ) FIXED BIN(31);
CALL SUB( ADDR(B) );
SUB: PROC( P);
DCL
P POINTER,
N1 FIXED BIN(31),
N2 FIXED BIN(31),
1 A BASED(P),
2 A1 FIXEDBIN(31),
2 A2 FIXEDBIN(31),
2 A3 FIXED BIN(31),
2 A4( N1 REFER(A3) ) CHAR(4),
2 A5 FIXED BIN(31),
2 A6( N2 REFER(A5) ) CHAR(4);
PUT SKIP LIST ( STG(A));
END; END;
正確答案: D
CORRECT TEXT
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;
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;
正確答案: C