      INTEGER*4 PID,STAT,I
      INTEGER*4 UNIT(1200),DEVL(1200),NDEV,L
      INTEGER*2 FID(3,1200)
      CHARACTER*16 DEV(1200)
      CHARACTER*128 S
      INTEGER*4 CHNLST
      WRITE(6,'(1X,4HPID>,$)')
      READ(5,'(Z)') PID
      STAT=CHNLST(PID,DEV,DEVL,UNIT,FID,NDEV)
      WRITE(*,*) STAT
      DO 100 I=1,NDEV
        WRITE(6,'(1X,A,I,1X,I,1X,I,1X,I)') DEV(I)(1:DEVL(I)),UNIT(I),
     +                                     FID(1,I),FID(2,I),FID(3,I)
        DEV(I)(DEVL(I)+1:DEVL(I)+1)=CHAR(48+UNIT(I))
        DEVL(I)=DEVL(I)+1
        IF(FID(1,I).GT.0) THEN
          CALL LIB$FID_TO_NAME(DEV(I)(1:DEVL(I)),FID(1,I),S,L)
          WRITE(6,'(1X,A)') S(1:L)
        ENDIF
100   CONTINUE
      END
