1.
Given the following code:
DCL (K, L) FIXED BIN (31) INIT (0);
DCL SUB ENTRY( FIXED BIN(31) BYADDR, FIXED BIN(31) )
OPTIONS(BYVALUE);
CALL SUB(K, L);
PUT(K, L);
and the following external procedure:
SUB: PROCEDURE(K, L) OPTIONS( BYVALUE );
DCL (K BYADDR, L) FIXED BIN(31);
K = 10;
L = 10;
END;
Which numbers are output by the PUT statement?
2.
Given the following declarations, which code is INVALID?
DCL (P,Q) POINTER;
DCL X CHAR(16) BASED(P);
3.
If the following syntax is incorrect, how should the syntax be changed?
READ FILE(DDIN) IN STRUC1;
4.
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 (SYSNULL()) PUT LIST (P IS SYSNULL);
OTHERWISE PUT LIST (P is something else);
END;
5.
What will be printed to SYSPRINT, if anything, after executing the following code?
DCL A PIC 9999;
A =  123;
PUT SKIP LIST('VALUE OF A IS : !! A);
6.
What happens, if anything, after end of file 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('0'B);
ON ENDFILE(INF) BEGIN;
EOF = '1'B;
ALLOC INFIELD;

INFIELD = 'EOF REACHED';
END;
OPEN FILE(INF);
READ FILE(INF) SET(P);
DO WHILE(^EOF);
READ FILE(INF) SET(P);
END;
7.
For which of the following data representations is a variable declared with the attribute WIDECHAR meant to be used?
8.
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;
9.
Which of the following is a DEC FIXED constant?
10.
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);
DCL X 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;