New Jersey Institute of Technology - College of Computing Sciences

CIS365: File Structures and Management

Professors Bieber and Egan

Lecture 3 Exercise 1

01 detail-line.

05 PIC X VALUE SPACES.

05 dl-last-name PIC X(15).

05 PIC X(2) VALUE SPACES.

05 dl-initials PIC X(2).

05 PIC X(5) VALUE SPACES.

05 dl-credits PIC 9(2).

05 PIC X(6) VALUE SPACES.

05 dl-tuition PIC 9(6).

05 PIC X(7) VALUE SPACES.

05 dl-union-fee PIC 9(3).

05 PIC X(6) VALUE SPACES.

05 dl-activity-fee PIC 9(3).

05 PIC X(8) VALUE SPACES.

05 dl-scholarship PIC 9(5).

05 PIC X(6) VALUE SPACES.

05 dl-union-fee PIC 9(3).

05 PIC X(6) VALUE SPACES.

05 dl-bill PIC 9(6).

05 PIC X(49) VALUE SPACES.

01 total-line.

05 PIC X(8) VALUE SPACES.

05 PIC X(17)

VALUE 'UNIVERSITY TOTALS'.

05 PIC X(8) VALUE SPACES.

05 tl-total-tuition PIC 9(6).

05 PIC X(6) VALUE SPACES.

05 tl-total-union-fee PIC 9(4).

05 PIC X(5) VALUE SPACES.

05 tl-total-activity-fee PIC 9(4).

05 PIC X(7) VALUE SPACES.

05 tl-total-scholarship PIC 9(6).

05 PIC X(6) VALUE SPACES.

05 tl-total-bill PIC 9(6).

05 PIC X(49) VALUE SPACES.


New Jersey Institute of Technology - College of Computing Sciences

CIS365: File Structures and Management

Professors Bieber and Egan

Lecture 3 Exercise 2

MOVE

Note, that the move command copies one location in memory to the other location. The PIC for the destination location will dictate what will be stored in the destination memory location.

For each of the following PIC pairs, state exactly what will be in memory for the variable [field2] after performing the command:

MOVE field1 TO field2

field1 PIC / field1 value / field2 PIC / field2 length / field2 value
PIC X(4) / “abcd” / PIC X(2)
PIC X(4) / “abcd” / PIC X(6)
PIC 9999.99 / 1234.56 / PIC 999999.999
PIC 9999.99 / 1234.56 / PIC 99.9
PIC 9(4) / 0678 / PIC ZZZZ
PIC 9(4) / 0678 / PIC $9999
PIC 9(4) / 0678 / PIC $ZZZZ
PIC 9(4)V99 / 123456 / PIC 9999.99
PIC 9(4)V99 / 123456 / PIC $9999.99
PIC 9(4)V99 / 123456 / PIC $9,999.99
PIC 9(4) / 0008 / PIC $$,$$$99
PIC 9(9) / 123456789 / PIC 999B99B9999
PIC 9(4) / 1234 / PIC $$,$$9.00
PIC 9(6) / 020503 / PIC 99/99/99
PIC 9(6) / 020503 / PIC Z9/99/99
PIC S9(4) / +1234 / PIC ++,++9
PIC S9(4) / +0123 / PIC ++,++9
PIC S9(4) / -0123 / PIC ++,++9
PIC S9(4) / +0123 / PIC --,--9
PIC S9(4) / -0123 / PIC --,--9