      PROGRAM UERFIL2T                                                          
C                                                                               
      LOGICAL      STATUS                                                       
      INTEGER*4    SINF(2),LUN                                                  
      DATA         SINF/0,0/                                                    
C                                                                               
      LUN=IGETLU()                                                              
      WRITE(6,100)LUN                                                           
C                                                                               
C     TEST (1):CALL UERFIL WITH NO FILE IN EXISTANCE                            
C     **********************************************                            
C                                                                               
      CALL RITE(1)                                                              
      STATUS=.TRUE.                                                             
      CALL UERFIL(LUN,'NOEXIST',STATUS,SINF)                                    
      WRITE(6,200)STATUS                                                        
C                                                                               
C                                                                               
C     TEST (2):CALL UERFIL WITH FILE ON USER ACC.                               
C     *******************************************                               
C                                                                               
      CALL RITE(2)                                                              
      STATUS=.FALSE.                                                            
      CALL UERFIL(LUN,'USR31FIL',STATUS,SINF)                                   
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,301)SINF(1)                                                   
          WRITE(6,302)SINF(2)                                                   
          PAUSE 'CHECK THAT FILE IS OPENED'                                     
          CLOSE(UNIT=LUN)                                                       
      ELSE                                                                      
          WRITE(6,'(3X,A)')'CHECK TEST (2)'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     TEST (3):CALL UERFIL WITH FILE ON GROUP ACC.                              
C     ********************************************                              
C                                                                               
      CALL RITE(3)                                                              
      STATUS=.FALSE.                                                            
      CALL UERFIL(LUN,'USRGFIL',STATUS,SINF)                                    
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,301)SINF(1)                                                   
          WRITE(6,302)SINF(2)                                                   
          PAUSE 'CHECK THAT FILE IS OPEN'                                       
          CLOSE(UNIT=LUN)                                                       
      ELSE                                                                      
          WRITE(6,'(3X,A)')'CHECK TEST (3)'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     TEST (4):CALL UERFIL WITH FILE ON 'FIXL'.                                 
C     *****************************************                                 
C                                                                               
      CALL RITE(4)                                                              
      STATUS=.FALSE.                                                            
      CALL UERFIL(LUN,'FIXLFIL',STATUS,SINF)                                    
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,301)SINF(1)                                                   
          WRITE(6,302)SINF(2)                                                   
          PAUSE 'CHECK THAT FILE IS OPEN'                                       
          CLOSE(UNIT=LUN)                                                       
      ELSE                                                                      
          WRITE(6,'(3X,A)')'CHECK TEST (4)'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     TEST (5):CALL UERFIL WITH LEN(PACKGE)<1                                   
C     ***************************************                                   
C                                                                               
      CALL RITE(5)                                                              
      STATUS=.TRUE.                                                             
      CALL UERFIL(LUN,' ',STATUS,SINF)                                          
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,'(3X,A)')'CHECK TEST (5)'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     TEST (6):CALL UERFIL WITH LEN(PACKGE)>8                                   
C     ***************************************                                   
C                                                                               
      CALL RITE(6)                                                              
      STATUS=.TRUE.                                                             
      CALL UERFIL(LUN,'AAAAAAAAA',STATUS,SINF)                                  
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,'(3X,A)')'CHECK TEST (6)'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     TEST (7):CALL UERFIL WITH ERROR IN 2ND RECORD.                            
C     **********************************************                            
C                                                                               
      CALL RITE(7)                                                              
      CALL UERFIL(LUN,'INCORR',STATUS,SINF)                                     
      WRITE(6,200)STATUS                                                        
      IF (STATUS) THEN                                                          
          WRITE(6,'(3X,A)')'CHECK TEST (7)'                                     
      ELSE                                                                      
          PAUSE 'CHECK THAT FILE IS CLOSED'                                     
      ENDIF                                                                     
C                                                                               
C                                                                               
C     FORMAT STATEMENTS                                                         
C     *****************                                                         
C                                                                               
100   FORMAT(3X,'LUN=',I3)                                                      
200   FORMAT(3X,'STATUS=',L)                                                    
301   FORMAT(3X,'SINF(1)=',I3)                                                  
302   FORMAT(3X,'SINF(2)=',I3)                                                  
C                                                                               
C                                                                               
      STOP                                                                      
      END                                                                       
C                                                                               
      SUBROUTINE RITE(I)                                                        
C                                                                               
      INTEGER*4  I                                                              
C                                                                               
      WRITE(6,100)                                                              
      WRITE(7,100)                                                              
      WRITE(6,101)I                                                             
      WRITE(7,101)I                                                             
      WRITE(6,200)                                                              
      WRITE(7,200)                                                              
C                                                                               
100   FORMAT(X,//)                                                              
101   FORMAT(3X,'TEST(',I,')')                                                  
200   FORMAT(X,/)                                                               
C                                                                               
      RETURN                                                                    
      END                                                                       
