PROGRAM nonincl
  IMPLICIT NONE
  INTEGER :: a(1200), b(1600), i, j
  
  OPEN(12, file="fileA.txt", action="read", status="old")
  DO i=1,SIZE(a)
     READ (12,*) a(i)
  END DO
  CLOSE(12)
  
  OPEN(12, file="fileB.txt", action="read", status="old")
  DO i=1,SIZE(b)
     READ (12,*) b(i)
  END DO
  CLOSE(12)

  OPEN(12, file="fileC.txt", action="write", status="replace")
  
  DO i=1,SIZE(a)
     IF (ALL(b /= a(i))) WRITE(12, *) a(i)
  END DO

  CLOSE(12)
  
END PROGRAM nonincl
