      INTEGER FUNCTION SSPAWN(IMAGE, ARGS, PID, WAIT)
      LOGICAL*1 MCRLIN(80), IMAGE(100), ARGS(100), PID(100), WAIT
      LOGICAL*1 CLOWER
      INTEGER MCR, SPDESC(5), STATUS
      INTEGER EQUAL, LENGTH, TCSPWN
      LOGICAL*1 LOCAL(6)
      DATA LOCAL(1)/108/,LOCAL(2)/111/,LOCAL(3)/99/,LOCAL(4)/97/,LOCAL(5
     *)/108/,LOCAL(6)/0/
      IF(.NOT.(CLOWER(WAIT) .NE. 119))GOTO 23000
      SSPAWN=(-3)
      RETURN
23000 CONTINUE
      CALL SCOPY(IMAGE, 1, MCRLIN, 1)
      CALL FOLD(MCRLIN)
      IF(.NOT.(EQUAL(MCRLIN, LOCAL) .EQ. 1))GOTO 23002
      CALL SCOPY(ARGS, 1, MCRLIN, 1)
      MCR = 1
      SPDESC(4) = 0
      SPDESC(3) = 2
      GOTO 23003
23002 CONTINUE
      MCRLIN(1) = 32
      CALL SCOPY(IMAGE, 1, MCRLIN, 2)
      MCR = 0
      SPDESC(4) = LENGTH(ARGS)
      CALL GETADR(SPDESC(5), ARGS)
      SPDESC(3) = 0
23003 CONTINUE
      CALL UPPER(MCRLIN)
      SPDESC(1) = LENGTH(MCRLIN)
      CALL GETADR(SPDESC(2), MCRLIN)
23004 CONTINUE
      STATUS = TCSPWN(SPDESC)
      I23007=(SPDESC(3))
      GOTO 23007
23009 CONTINUE
      SPDESC(3) = 1
      GOTO 23008
23010 CONTINUE
      SPDESC(3) = 3
      GOTO 23008
23011 CONTINUE
      MCR = 0
      GOTO 23008
23007 CONTINUE
      IF(I23007.EQ.1)GOTO 23010
      IF(I23007.EQ.2)GOTO 23009
      GOTO 23011
23008 CONTINUE
23005 IF(.NOT.(MCR .EQ. 0 .OR. STATUS .NE. -1))GOTO 23004
23006 CONTINUE
      IF(.NOT.(STATUS .NE. 0))GOTO 23012
      STATUS = -3
23012 CONTINUE
      SSPAWN=(STATUS)
      RETURN
      END
