      SUBROUTINE GETSTD(IFILE,ICARD,STD2T,NSTD,XL,TTY,LUNPDF,D2)
C
C  GET STANDARD DATA FOR INTERNAL STANDARD CORRECTION FROM PDF FILE
C              WRITTEN BY RAY GOEHNER  9/83
C
      DIMENSION STD2T(100)
      INTEGER TTY
      INTEGER INDEX(2500),INT(100) 
      BYTE FILE(17),D2(12),INDX(22)
      BYTE CNAME(110),IN(10),NF
C
      ENCODE(20,2000,FILE) D2
 2000 FORMAT(12A1,'PDF.    ')
      ENCODE(22,2010,INDX) D2
 2010 FORMAT(12A1,'INDEX.PDF ')
      INDX(22)=0
      NF='T'
      OPEN(UNIT=LUNPDF,NAME=INDX,ACCESS='DIRECT', 
     &RECORDSIZE=1250,SHARED,TYPE='OLD',READONLY) 
      ENCODE(3,9300,FILE(17))IFILE
9300  FORMAT(I3)
      IF(FILE(17).EQ.' ')FILE(14)='0'
      IF(FILE(18).EQ.' ')FILE(15)='0'
      FILE(20)=0
      READ(LUNPDF'IFILE) INDEX 
      CLOSE(UNIT=LUNPDF)
      NREC=INDEX(ICARD) 
      IF(NREC.NE.0) GO TO 160 
22      WRITE(TTY,150) IFILE 
  150   FORMAT(1X,'SORRY, NO SUCH CARD IN FILE ',I2) 
      RETURN
160   OPEN(UNIT=LUNPDF,NAME=FILE,ACCESS='DIRECT', RECORDSIZE=16,SHARED
     %,TYPE='OLD',READONLY)
      IF(NREC.LT.0)NREC=-NREC
      CALL RCARD(NREC,STD2T,INT,NSTD,CNAME,NSYM,LUNPDF,RIC,NF,XL)
      CLOSE(UNIT=LUNPDF)
60    RETURN
	END
      SUBROUTINE PDFNUM(LUTI,IFILE,ICARD,IR)
C
C  GET PDF FILE & CARD NUMBER
C  IR=3 REFRESH THE SCREEN
C
      BYTE INP(10)
      IR=10
      IFILE=0
      ICARD=0
C
  100 READ(LUTI,1000,END=9998) IQ,INP
 1000 FORMAT(Q,10A1)
      IF(INP(1).EQ.'R'.OR.INP(1).EQ.'#') IR=3
      IF(INP(1).EQ.'R'.OR.INP(1).EQ.'#') GO TO 9999
      IF(INP(1).EQ.' ') GO TO 9998
      IF(INP(1).LT.48.OR.INP(1).GT.57) GO TO 9999
      DO 1100 I=1,10
      IF(INP(I).EQ.','.OR.INP(I).EQ.'-') J=I
 1100 CONTINUE
      K=J-1
      DO 1200 I=1,(J-1)
      K=K-1
 1200 IFILE=IFILE+(INP(I)-48)*10**K
      K=IQ-J
      DO 1300 I=(J+1),IQ
      K=K-1
 1300 ICARD=ICARD+(INP(I)-48)*10**K
      IF(IFILE.LE.0) GO TO 100
      IF(ICARD.LE.0.OR.ICARD.GE.2500) GO TO 100
 9999 RETURN
 9998 IR=9
      RETURN
      END
