1.
How should the file ACCOUNT be declared if the program first writes records to ACCOUNT and afterwards reads them back from ACCOUNT?
2.
What happens after the following code is executed?
DCL A CHAR(5) INIT(ABCDE);
DCL B CHAR(4) DEF A POS(2);
3.
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 PIC'99' INIT(10);
XY = YZ;
4.
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(  );
5.
Which of the following options is proper for the PROC statement, but invalid for the ENTRY statement?
6.
What is the output of the following program?
MAIN: PROC OPTIONS(MAIN);
DCL
1 A UNION,
2 B CHAR(4) INIT(FADE),
2 C CHAR(2);
C = BA;
PUT SKIP LIST( B !! C );
END;
7.
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);
8.
If the physical dataset referred to by DDOUT has a maximum record length of 200 and RECFM=V, what happens after executing the following code?
DCL DDOUT FILE RECORD OUTPUT;
DCL I BIN FIXED(15) INIT(0);
DCL 1 OUTSTR,
2 A CHAR(150),
2 B CHAR(46);
OPEN FILE(DDOUT);
DO I = 1 TO 10;
WRITE FILE(DDOUT) FROM(OUTSTR);
END;
9.
Given the following code, which value is output on the last line?
DCL N FIXED BIN (31);
DCL X FIXED BIN (31) INIT (0);
DO N = 1 TO 7, 11 TO 15 WHILE (X < 20);
X = N*N;
PUT SKIP LIST (X);
END;
10.
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;