C  
C  Testing existence of global variable DFerror.
C
C  Note: "textfile" should not exist;  otherwise no error is reported.
C        The error code reported should be -1.
C
C


      program errexample

      integer  dsgdims, dferrno, DFerror
      integer ret, rank, sizes(3)

      ret = dsgdims('textfile', rank, sizes, 3)
      DFerror =  dferrno()

      print *
      print *,'  return value = ', ret
      print *,'  DFerror      = ', DFerror
      print *

      if (ret .lt. 0 .and. DFerror .eq. -1) then
	  print *,'Test of error reporting successful !'
      else
	  print *,'Test of error reporting failed !'
          print *, 'Return value should be < 0; DFerror should be -1.'
      end if
      print *

      stop
      end

