      SUBROUTINE MAIN
      LOGICAL*1 BUF(512), FILE(40), OBUF(512)
      INTEGER GETLIN, OPEN, LENGTH, ISATTY, GETARG, EQUAL
      INTEGER NXTCOL, PACKIT, INT, I
      CALL QUERY(19Husage:  users [-1].)
      PACKIT = ISATTY(2)
      IF (.NOT.(GETARG(1, FILE, 40) .NE. -1))GOTO 23000
      IF (.NOT.(FILE(1) .EQ. 45 .AND. FILE(2) .EQ. 49))GOTO 23002
      PACKIT = 0
      GOTO 23003
23002 CONTINUE
      CALL BADARG(FILE)
23003 CONTINUE
23000 CONTINUE
      CALL ADRFIL(FILE)
      IF (.NOT.(PACKIT .EQ. 1))GOTO 23004
      CALL INPACK(NXTCOL, 80, OBUF, 2)
23004 CONTINUE
      INT = OPEN(FILE, 1)
      IF (.NOT.(INT .NE. -3))GOTO 23006
23008 IF (.NOT.(GETLIN(BUF, INT) .NE. -1))GOTO 23009
      I=1
23010 IF (.NOT.(BUF(I).NE.32 .AND. BUF(I).NE.9 .AND. BUF(I) .NE. 64))GOT
     *O 23012
      FILE(I) = BUF(I)
23011 I=I+1
      GOTO 23010
23012 CONTINUE
      FILE(I) = 0
      IF (.NOT.(PACKIT .EQ. 1))GOTO 23013
      CALL DOPACK(FILE, NXTCOL, 80, OBUF, 2)
      GOTO 23014
23013 CONTINUE
      CALL PUTLIN(FILE, 2)
      CALL PUTCH(10, 2)
23014 CONTINUE
      GOTO 23008
23009 CONTINUE
      IF (.NOT.(PACKIT .EQ. 1))GOTO 23015
      CALL FLPACK(NXTCOL, 80, OBUF, 2)
23015 CONTINUE
      CALL CLOSE(INT)
      GOTO 23007
23006 CONTINUE
      CALL REMARK(22HCannot open user file!)
23007 CONTINUE
      RETURN
      END
