Previous Topic: Example 3Next Topic: INFILE


Example 4

If STATE-CODE contains AZ, the entire record is written to AZFILE. If those same positions have the characters IL, the entire record is written to the ILFILE. The WRITE(AZFILE) terminates the first IFs subordinate actions.

READ,
  LAYOUTFILE(LAYOUT),
  MOVE(CLEAR),
  MOVE(1,0,1),
  IF(STATE-CODE,EQ,C'AZ'),
	WRITE(AZFILE),
  IF(STATE-CODE,EQ,C'IL'),
	WRITE(ILFILE)