      SUBROUTINE SETNAM(KK)
      LOGICAL ERR, SYSERR, ABORT
      INTEGER STMT, PSTMT, S(5)
      COMMON /FACTS/ NAME, NOST, ITYP, IASF
      COMMON /DETECT/ ERR, SYSERR, ABORT
      COMMON /INPUT/ NSTMT, PSTMT, STMT(1327)
      DATA S(1) /66/, S(2) /42/, S(3) /30/, S(4) /38/, S(5) /43/
C
C     KK=11 FOR BLOCK DATA PGM;  KK=12 FOR MAIN PGM
C     NAME POINTS TO SYMBOL TABLE ENTRY FOR NEW PGM
C
      IF (KK.EQ.11) GO TO 30
      PSTMT = 1
      DO 10 I=1,5
        STMT(I) = S(I)
   10 CONTINUE
      NAME = LOOKUP(6,.FALSE.)
      IF (SYSERR) RETURN
      CALL SATT1(NAME, 8, 12)
   20 RETURN
   30 PSTMT = 5
      STMT(PSTMT) = S(1)
      NAME = LOOKUP(11,.FALSE.)
      IF (SYSERR) RETURN
      CALL SATT1(NAME, 8, 11)
      GO TO 20
      END
