Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
C		T I T L E   UPDTF
C		THIS UTILITY PROGRAM ADDS OR DELETS(EXTRACTS)
C		RECORDS FROM A MASTER FILE. FOR ADDING
C		ONLY ID-IB(1) AND NAME-(IB(2)--IB(6)) ARE INPUT.
C		THE USER IS FREE TO CHANGE  INPUT UNIT (NCDR) AND READ/FORMAT
C		(STATEMENT 20) TO SUIT HIS OWN NEEDS.
	INTEGER ANSWER
      DIMENSION IPAR(10),IFRMT(3,20),IB(260),IB1(260),B(260)
	COMMON IDF,LFR,NAVR,MAXR,NSPR,LSR,LFMT,NCPR,LPFR,C1
       COMMON IFRMT
      EQUIVALENCE(IPAR(1),IDF)
      EQUIVALENCE(IB(1),B(1))
      DIMENSION IR(260)
      IDR=0
	TYPE 200
200	FORMAT(1X,'THIS PROGRAM WILL ADD OR EXTRACT SPECIFIED RECORDS FROM
	1 A MASTER FILE.'/' RECORDS ARE ASSUMED TO BE IN FORMAT(I,5A5)'/)
	IDM=ANSWER('MASTER FILE?')
	ID=ANSWER('TEMP FILE?')
	TYPE 205,ID
205	FORMAT(1X,'INPUT MAXR FOR FILE ',A5/)
	ACCEPT 206,MAX1
206	FORMAT(I)
      CALL SLECTF(IDM)
      LSR=LFR
      CALL SAVEF
      CALL DIO(1,1,IPAR,1)
      IF(IFIND(ID,1,0)) 3,4,3
4     CALL SLECTF(IDM)
      NSPR1=NSPR
      NCPR1=NCPR
      CALL DFINEF(ID,NSPR1,MAX1,NCPR1)
      CALL DFINER
3     CALL SLECTF(ID)
	IANS2=ANSWER('SHOULD TEMP FILE BE INITILIZED?')
	IF(IANS2.EQ.'YES')NAVR=LFR
      LSR=LFR
	NCDR=5
	TYPE 500
500	FORMAT(1X,'ENTER RECORD INFORMATION.TYPE <CR> FOR END OF FILE'/)
    2 CONTINUE
      CALL CLEAR(IB)
20    READ(NCDR,100)(IB(K23),K23=1,6)
100   FORMAT(I,5A5)
	IF(EOFC(NCDR))GO TO 10
		IF(IB(1).EQ.0)GO TO 10
	CALL INSRTR(IB,1)
	GO TO 20
  10  CALL SAVEF
130   TYPE 201,ID,IDM
201   FORMAT(15H TO MERGE FILE,,A6,16H, TO MASTER FILE,A6/
     162 H TYPE A 1, TO EXTRACT TEMPORARY FILE FROM MASTERFILE,TYPE A 0,
	2/' TO ABORT JOB TYPE A 2'/)
      ACCEPT202,NTYPE
202   FORMAT(I1)
      IF(NTYPE-1)11,12,131
11    CALL PULLF(IDM,ID,IB)
13    GO TO 130
12    CALL MERGEF(IDM,ID,IB)
      GO TO 13
131	TYPE 207,ID
207	FORMAT(1X,A5,' IS STILL ON THE PACK. TO DELETE IT'/)
	PAUSE
	CALL SLECTF(ID)
	CALL DELETF
	CALL EXIT
	END