C Collection of code snippets by Arne Vajhøj 
C (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
      program dvi
      include '($dvidef)'
      include '($dcdef)'
      integer*4 devclz
      call lib$getdvi(DVI$_DEVCLASS, %VAL(0), 'SYS$INPUT', devclz)
      if (devclz.eq.DC$_TERM) then
        write(*,*) 'You can write to unit 5'
      else
        write(*,*) 'Do not try to write to unit 5'
      end if
      end
