      SUBROUTINE MAIN
      INTEGER DESC, N, J, I, DDESC, PAT(132)
      INTEGER GETARG, GETPAT, OPENDR, GDRPRM, INDEXS, MATCH
      LOGICAL*1 TEMP(36), FILE(36), DEVICE(36)
      LOGICAL*1 USESTR(29)
      LOGICAL*1 SYSDEV(5)
      LOGICAL*1 ZZ(6)
      LOGICAL*1 DOTDIR(5)
      LOGICAL*1 ST001Z(16)
      LOGICAL*1 ST002Z(24)
      DATA USESTR(1)/117/,USESTR(2)/115/,USESTR(3)/97/,USESTR(4)/103/,US
     *ESTR(5)/101/,USESTR(6)/58/,USESTR(7)/32/,USESTR(8)/32/,USESTR(9)/1
     *19/,USESTR(10)/104/,USESTR(11)/101/,USESTR(12)/114/,USESTR(13)/101
     */,USESTR(14)/105/,USESTR(15)/115/,USESTR(16)/32/,USESTR(17)/112/,U
     *SESTR(18)/97/,USESTR(19)/116/,USESTR(20)/32/,USESTR(21)/91/,USESTR
     *(22)/97/,USESTR(23)/110/,USESTR(24)/99/,USESTR(25)/104/,USESTR(26)
     */111/,USESTR(27)/114/,USESTR(28)/93/,USESTR(29)/0/
      DATA SYSDEV(1)/47/,SYSDEV(2)/115/,SYSDEV(3)/121/,SYSDEV(4)/48/,SYS
     *DEV(5)/0/
      DATA ZZ(1)/91/,ZZ(2)/48/,ZZ(3)/44/,ZZ(4)/48/,ZZ(5)/93/,ZZ(6)/0/
      DATA DOTDIR(1)/46/,DOTDIR(2)/100/,DOTDIR(3)/105/,DOTDIR(4)/114/,DO
     *TDIR(5)/0/
      DATA ST001Z(1)/105/,ST001Z(2)/108/,ST001Z(3)/108/,ST001Z(4)/101/,S
     *T001Z(5)/103/,ST001Z(6)/97/,ST001Z(7)/108/,ST001Z(8)/32/,ST001Z(9)
     */112/,ST001Z(10)/97/,ST001Z(11)/116/,ST001Z(12)/116/,ST001Z(13)/10
     *1/,ST001Z(14)/114/,ST001Z(15)/110/,ST001Z(16)/0/
      DATA ST002Z(1)/58/,ST002Z(2)/32/,ST002Z(3)/99/,ST002Z(4)/97/,ST002
     *Z(5)/110/,ST002Z(6)/110/,ST002Z(7)/111/,ST002Z(8)/116/,ST002Z(9)/3
     *2/,ST002Z(10)/111/,ST002Z(11)/112/,ST002Z(12)/101/,ST002Z(13)/110/
     *,ST002Z(14)/32/,ST002Z(15)/100/,ST002Z(16)/105/,ST002Z(17)/114/,ST
     *002Z(18)/101/,ST002Z(19)/99/,ST002Z(20)/116/,ST002Z(21)/111/,ST002
     *Z(22)/114/,ST002Z(23)/121/,ST002Z(24)/0/
      CALL QUERY(USESTR)
      IF (.NOT.(GETARG(1, TEMP, 36) .EQ. -1))GOTO 23000
      CALL ERROR(USESTR)
23000 CONTINUE
      CALL FOLD(TEMP)
      IF (.NOT.(GETPAT(TEMP, PAT) .EQ. -3))GOTO 23002
      CALL ERROR(ST001Z)
23002 CONTINUE
      IF (.NOT.(GETARG(2, TEMP, 36) .EQ. -1))GOTO 23004
      CALL GWDIR(TEMP, 6)
23004 CONTINUE
      CALL FXLATE(TEMP,6, DEVICE)
      IF (.NOT.(INDEXC(DEVICE, 91) .EQ. 0))GOTO 23006
      DOALL = 1
      CALL CONCAT(DEVICE, ZZ, TEMP)
      GOTO 23007
23006 CONTINUE
      DOALL = 0
      CALL STRCPY(DEVICE, TEMP)
23007 CONTINUE
      CALL MKPATH(TEMP, FILE)
      IF (.NOT.(OPENDR(FILE, DESC) .NE. 0))GOTO 23008
      CALL CANT(FILE)
23008 CONTINUE
      IF (.NOT.(DOALL .EQ. 0))GOTO 23010
      CALL DSPFIL(DESC, FILE, PAT)
      GOTO 23011
23010 CONTINUE
23012 IF (.NOT.(GDRPRM(DESC, TEMP) .NE. -1))GOTO 23013
      N = INDEXS(TEMP, DOTDIR)
      IF (.NOT.(N .GT. 0))GOTO 23014
      J = 1
      CALL STCOPY(DEVICE, 1, FILE, J)
      CALL CHCOPY(91, FILE, J)
      I=1
23016 IF (.NOT.(I .LE. 3))GOTO 23018
      CALL CHCOPY(TEMP(I), FILE, J)
23017 I=I+1
      GOTO 23016
23018 CONTINUE
      CALL CHCOPY(44, FILE, J)
      I=4
23019 IF (.NOT.(I .LE. 6))GOTO 23021
      CALL CHCOPY(TEMP(I), FILE, J)
23020 I=I+1
      GOTO 23019
23021 CONTINUE
      CALL CHCOPY(93, FILE, J)
      CALL MKPATH(FILE, TEMP)
      IF (.NOT.(OPENDR(TEMP, DDESC) .EQ. -3))GOTO 23022
      CALL PUTLIN(TEMP, 3)
      CALL REMARK(ST002Z)
      GOTO 23023
23022 CONTINUE
      CALL DSPFIL(DDESC, TEMP, PAT)
23023 CONTINUE
23014 CONTINUE
      GOTO 23012
23013 CONTINUE
      CALL CLOSDR(DESC)
23011 CONTINUE
      RETURN
      END
      SUBROUTINE DSPFIL(DESC, DIRECT, PAT)
      INTEGER DESC, PAT(132)
      LOGICAL*1 DIRECT(100), ENTRY(36)
      INTEGER GDRPRM, MATCH
23024 IF (.NOT.(GDRPRM(DESC, ENTRY) .NE. -1))GOTO 23025
      IF (.NOT.(MATCH(ENTRY, PAT) .EQ. 1))GOTO 23026
      CALL PUTLIN(DIRECT, 2)
      CALL PUTLIN(ENTRY, 2)
      CALL PUTCH(10, 2)
23026 CONTINUE
      GOTO 23024
23025 CONTINUE
      CALL CLOSDR(DESC)
      RETURN
      END
