      SUBROUTINE MAIN
      INTEGER DESC, FOUND, FUIC, D, I, J, LOCAL, GRP, MEM, JUNK, VERBOS,
     * WIDTH
      LOGICAL*1 FILE(36), DEV(10), BUF(36), BUIC(2), UIC(10), ARG(10), D
     *IRECT(36)
      INTEGER OPENDR, GDRPRM, INDEXS, F11UIC, EQUAL, GETARG, INDEXC
      LOGICAL*1 DOTDIR(5)
      LOGICAL*1 ROOT(8)
      LOGICAL*1 ST001Z(27)
      LOGICAL*1 ST002Z(3)
      EQUIVALENCE (FUIC, BUIC(1))
      DATA DOTDIR(1)/46/,DOTDIR(2)/100/,DOTDIR(3)/105/,DOTDIR(4)/114/,DO
     *TDIR(5)/0/
      DATA ROOT(1)/91/,ROOT(2)/48/,ROOT(3)/44/,ROOT(4)/51/,ROOT(5)/55/,R
     *OOT(6)/55/,ROOT(7)/93/,ROOT(8)/0/
      DATA ST001Z(1)/117/,ST001Z(2)/115/,ST001Z(3)/97/,ST001Z(4)/103/,ST
     *001Z(5)/101/,ST001Z(6)/58/,ST001Z(7)/32/,ST001Z(8)/32/,ST001Z(9)/1
     *08/,ST001Z(10)/115/,ST001Z(11)/100/,ST001Z(12)/32/,ST001Z(13)/91/,
     *ST001Z(14)/45/,ST001Z(15)/108/,ST001Z(16)/118/,ST001Z(17)/93/,ST00
     *1Z(18)/32/,ST001Z(19)/91/,ST001Z(20)/100/,ST001Z(21)/101/,ST001Z(2
     *2)/118/,ST001Z(23)/105/,ST001Z(24)/99/,ST001Z(25)/101/,ST001Z(26)/
     *93/,ST001Z(27)/0/
      DATA ST002Z(1)/83/,ST002Z(2)/89/,ST002Z(3)/0/
      CALL QUERY(ST001Z)
      LOCAL = 0
      VERBOS = 0
      WIDTH = -1
      CALL TRNDEV(ST002Z, 0, DEV)
      I=1
23000 IF (.NOT.(GETARG(I, ARG, 10) .NE. -1))GOTO 23002
      IF (.NOT.(ARG(1) .EQ. 45))GOTO 23003
      CALL FOLD(ARG)
      IF (.NOT.(INDEXC(ARG, 108) .GT. 0))GOTO 23005
      LOCAL = 1
23005 CONTINUE
      IF (.NOT.(INDEXC(ARG, 118) .GT. 0))GOTO 23007
      WIDTH = -20
      VERBOS = 1
23007 CONTINUE
      GOTO 23004
23003 CONTINUE
      CALL FXLATE(ARG,6, DEV)
23004 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      CALL CONCAT(DEV, ROOT, DIRECT)
      IF (.NOT.(OPENDR(DIRECT, DESC) .NE. -3))GOTO 23009
23011 IF (.NOT.(GDRPRM(DESC, FILE) .NE. -1))GOTO 23012
      I = INDEXS(FILE, DOTDIR)
      IF (.NOT.(I .GT. 0))GOTO 23013
      FILE(I) = 0
      J = 1
      CALL STCOPY(DEV, 1, BUF, J)
      CALL CHCOPY(91, BUF, J)
      CALL STCOPY(FILE, 1, BUF, J)
      CALL CHCOPY(93, BUF, J)
      JUNK = F11UIC(DESC, FUIC)
      MEM = BUIC(1)
      GRP = BUIC(2)
      CALL FMTUIC(GRP, MEM, UIC)
      IF (.NOT.(LOCAL .EQ. 1))GOTO 23015
      CALL FXLATE(BUF,6, FILE)
      GOTO 23016
23015 CONTINUE
      CALL MKPATH(BUF, FILE)
23016 CONTINUE
      CALL PUTSTR(FILE, WIDTH, 2)
      IF (.NOT.(VERBOS .EQ. 1))GOTO 23017
      CALL PUTLIN(UIC, 2)
23017 CONTINUE
      CALL PUTCH(10, 2)
23013 CONTINUE
      GOTO 23011
23012 CONTINUE
23009 CONTINUE
      CALL CLOSDR(DESC)
      RETURN
      END
