      SUBROUTINE MAIN
      INTEGER NCOL, I, J, N
      INTEGER GETARG, CTOI
      INTEGER UNIT
      INTEGER OPEN
      LOGICAL*1 ARG(40)
      LOGICAL*1 USESTR(29)
      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
     *12/,USESTR(10)/97/,USESTR(11)/99/,USESTR(12)/107/,USESTR(13)/32/,U
     *SESTR(14)/91/,USESTR(15)/45/,USESTR(16)/110/,USESTR(17)/93/,USESTR
     *(18)/32/,USESTR(19)/91/,USESTR(20)/102/,USESTR(21)/105/,USESTR(22)
     */108/,USESTR(23)/101/,USESTR(24)/93/,USESTR(25)/32/,USESTR(26)/46/
     *,USESTR(27)/46/,USESTR(28)/46/,USESTR(29)/0/
      CALL QUERY(USESTR)
      NCOL = 5
      N = 0
      I=1
23000 IF (.NOT.(GETARG(I, ARG, 40) .NE. -1))GOTO 23002
      IF (.NOT.(ARG(1) .EQ. 45 .AND. ARG(2) .NE. 0))GOTO 23003
      J = 2
      NCOL = CTOI(ARG, J)
      NCOL = MAX0(NCOL, 1)
      GOTO 23004
23003 CONTINUE
      N = N + 1
      IF (.NOT.(ARG(1) .EQ. 45))GOTO 23005
      UNIT = 1
      GOTO 23006
23005 CONTINUE
      UNIT = OPEN(ARG, 1)
      IF (.NOT.(UNIT .EQ. -3))GOTO 23007
      CALL CANT(ARG)
23007 CONTINUE
23006 CONTINUE
      CALL PAKFIL(UNIT, NCOL)
      IF (.NOT.(UNIT .NE. 1))GOTO 23009
      CALL CLOSE(UNIT)
23009 CONTINUE
23004 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF (.NOT.(N .EQ. 0))GOTO 23011
      CALL PAKFIL(1, NCOL)
23011 CONTINUE
      RETURN
      END
      SUBROUTINE PAKFIL(UNIT, NCOL)
      INTEGER UNIT
      INTEGER NCOL, RM, NXTCOL, I
      INTEGER GETLIN, GETWRD
      LOGICAL*1 OBUF(512), BUF(512), WORD(512)
      RM = NCOL * 16
      CALL INPACK(NXTCOL, RM, OBUF, 2)
23013 IF (.NOT.(GETLIN(BUF, UNIT) .NE. -1))GOTO 23014
      I = 1
23015 IF (.NOT.(GETWRD(BUF, I, WORD) .GT. 0))GOTO 23016
      CALL DOPACK(WORD, NXTCOL, RM, OBUF, 2)
      GOTO 23015
23016 CONTINUE
      GOTO 23013
23014 CONTINUE
      CALL FLPACK(NXTCOL, RM, OBUF, 2)
      RETURN
      END
