Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50212/ffm.opr
There are no other files named ffm.opr in the archive.
                  A FORTRAN  FILE MAINTENANCE SYSTEM                 

				MYRON W. CURTIS
				COMPUTING CENTER
				BOWDOIN COLLEGE
				BRUNSWICK MAINE 04011
                                                                                
                                                                                
INTRODUCTION                                                                    
                                                                                
     THE SYSTEM IS DESIGNED FOR A COMPUTER WITH A RANDOM ACCESS STORAGE DEVICE  
(DISK OR CORE).  THE SYSTEM CONSISTS OF A SET OF CONVENTIONS FOR FILE DESIGN AND
A SET OF FORTRAN SUBROUTINES THAT OPERATE ON AN ARBITRARY FILE.  THESE          
SUBROUTINES DO MOST OF THE ROUTINE JOBS NECESSARY TO KEEP DATA FILES UP TO DATE 
AND TO WRITE REPORTS FROM THESE FILES.  THE SUBROUTINES ARE WRITTEN IN FORTRAN  
WITH THE EXCEPTION OF THE DISK INPUT/OUTPUT ROUTINE WHICH IS A MACHINE LANGUAGE 
ROUTINE.  OF COURSE, ANY OF THE SUBROUTINES MAY BE REWRITTEN IN MACHINE LANGUAGE
AT A PARTICULAR INSTALLATION IN ORDER TO CONSERVE EXECUTION TIME.               
	THE SYSTEM WAS WRITTEN AT BOWDOIN COLLEGE IN FORTRAN II FOR THE I.B.M.
1620 AND HAS BEEN MODIFIED AND EXTENDED IN FORTAN IV FOR THE D.E.C. PDP-10
                                                                                
FILE CONVENTIONS                                                                
                                                                                
     THE FILE MAINTENANCE SYSTEM IS COMPLETELY DEPENDENT ON A SET OF CONVENTIONS
FOR DESIGNING FILES WITHIN THE SYSTEM SINCE THE MAINTENANCE SUBROUTINES ARE     
PROGRAMMED WITH THESE CONVENTIONS IMPLICITLY IMBEDDED IN THE CODE.  SO TO MODIFY
A CONVENTION WOULD IN GENERAL REQUIRE A CORRESPONDING MODIFICATION IN THE SYSTEM
PROGRAMS.                                                                       
                                                                                
   **DEFINITION 1** - A W O R D IS A FORTRAN VARIABLE AND HENCE, MAY BE IN THREE
     MODES -- (1) INTEGER, (2) FLOATING POINT, AND (3) ALPHANUMERIC
                                                                                
   **CONVENTION 1** - ALL WORDS MUST HAVE THE SAME LENGTH.  IN FIXED WORD LENGTH
     COMPUTERS, THIS IS INHERENT IN THE NATURE OF THE COMPUTER.  IN THE 1620,   
     ONE COMPILES ALL PROGRAMS WITH INTEGER VARIABLES OF 10 DIGITS AND FLOATING 
     POINT VARIABLES OF 8 DIGIT FRACTIONS AND 2 DIGIT EXPONENTS.  (*FANDK0810)  
                                                                                
   **DEFINITION 2** - A F I E L D (SOMETIMES REFERRED TO AS C A T E G O R Y) IS 
     A CONSECUTIVE STRING OF WORDS IN THE SAME MODE.  THEREFORE, WE MAY DESCRIBE
     A FIELD BY THREE WORDS -- (1) THE LOCATION OF THE FIRST WORD, (2) THE      
     LENGTH OF THE FIELD OR NUMBER OF WORDS IN A FIELD, AND (3) THE MODE OF THE  
     FIELD.                                                                     
                                                                                
   **DEFINITION 3** - A R E C O R D IS A CONSECUTIVE STRING OF F I E L D S.  IT 
     IS SOMETIMES CONVENIENT TO THINK OF A RECORD AS A CONSECUTIVE STRING OF    
     WORDS.  IN THIS SYSTEM, A RECORD IS REFERRED TO BY THE ONE-DIMENSIONAL     
     ARRAY I R.  HENCE, THE ITH WORD IS I R(I).                                 
          ONE SHOULD NOTE THAT CONSECUTIVE, IN ADDITION TO ITS USUAL DEFINITION,
     MEANS STORED CONSECUTIVELY IN MEMORY OR ON THE DISK.                       
                                                                                
   **DEFINITION 4** - A F I L E IS A CONSECUTIVE STRING OF R E C O R D S.  EACH 
     RECORD IN A FILE MUST HAVE THE SAME NUMBER OF FIELDS OF CORRESPONDING MODE 
     AND ORDER.  ONE MIGHT SAY THEY ARE CONGRUENT.                              
                                                                                
   **CONVENTION 2** - THE FIRST FIELD IN EACH RECORD IS ASSUMED TO BE AN        
     IDENTIFICATION FIELD CONSISTING OF ONE WORD.  THERE IS NO UNIVERSAL        
     RESTRICTION ON MODE, BUT OF COURSE THE I D OF EACH RECORD OF A FILE MUST BE
     OF THE SAME MODE. SOME UTILITY ROUTINES ASSUME THE ID IS IN INTEGER MODE.                                                                                
   **DEFINITION 5** - A P A C K IS A CONSECUTIVE STRING OF F I L E S.  USUALLY  
     A PACK IS A CONTIGUOUS STORAGE AREA ON A DISK PACK (PACKS) OR IN A LARGE   
     MEMORY.  WE WILL ASSUME FROM NOW ON THAT A PACK IS LOCATED ON A DISK.      
                                                                                
   **DEFINITION 6** - A S E C T O R IS THE AMOUNT OF DISK STORAGE NECESSARY TO  
     STORE TEN CONSECUTIVE WORDS AND MUST BE LOGICALLY ADDRESSABLE BY THE        
     COMPUTER IN QUESTION.                                                      
                                                                                
   **CONVENTION 3** - ALL RECORDS, FILES, AND PACKS TAKE UP AN INTEGRAL NUMBER  
     OF SECTORS ON THE DISK.  THIS MEANS THAT ALTHOUGH THE NUMBER OF WORDS IN A 
     RECORD MAY BE LESS THAN 10K, THE RECORD TAKES UP SPACE FOR 10K WORDS ON THE
     DISK.                                                                      
          DATA ON THE DISK IS LOCATED BY SECTOR NUMBER FROM A FIXED ADDRESS ON  
     THE DISK CALLED THE O R I G I N.  THIS ADDRESS IS DETERMINED BY DIO (A       
     MACHINE LANGUAGE DISK I/O ROUTINE).                                        
     LOCATION (ADDRESS) OF RECORDS AND FILES IN THE SYSTEM ARE GIVEN BY THE     
     APPROPRIATE SECTOR NUMBER RELATIVE TO THE ORIGIN.                          
                                                                                
     WE SEE THAT ONE MAY DESCRIBE AN ARBITRARY FILE IN A PACK BY GIVING IT AN   
IDENTIFYING NAME, ITS RECORD FORMAT (THE NUMBER AND MODE OF FIELDS), AND THE    
LOCATION AND SIZE OF THE FILE.  THE FOLLOWING CONVENTIONS DEFINE THESE FILE AND 
RECORD PARAMETERS EXPLICITLY.                                                   
                                                                                
   **CONVENTION 4** - THE RECORD FORMAT SPECIFICATIONS (**DEFINITION 3**) ARE   
     STORED IN MEMORY IN A 2-DIMENSIONAL ARRAY, CALLED I F R M A T.  WHERE      
     I F R M A T (1,I), I F R M A T (2,I), I F R M A T (3,I) ARE INTEGERS       
     DEFINING THE LOCATION, LENGTH, AND MODE OF THE ITH FIELD OF A RECORD.      
     THE LOCATION OF A FIELD IS GIVEN BY A WORD NUMBER RELATIVE TO              
     THE FIRST WORD OF A RECORD.                                                
          I F R M A T (3,I) = (1) - INTEGER                                     
                              (2) - FLOATING POINT                              
                              (3) - ALPHA                                       
                                                                                
   **CONVENTION 5** - THIS CONVENTION GIVES THE DEFINITION AND A SUGGESTED      
     FORTRAN MNEMONIC FOR THE FILE PARAMETERS.                                  
          I P A R (1) = I D F - A 5-CHARACTER ALPHA IDENTIFICATION FOR THE FILE.
          I P A R (2) = L F R - THE BEGINNING SECTOR NUMBER FOR THE FIRST RECORD
                                OF THE FILE.                                    
          I P A R (3) = N A V R - THE SECTOR NUMBER FOR THE NEXT AVAILABLE      
                                  RECORD IN THE FILE.                           
          I P A R (4) = M A X R - THE MAXIMUM SECTOR NUMBER AVAILABLE FOR THE   
                                  FILE.                                         
          I P A R (5) = N S P R - THE NUMBER OF SECTORS PER RECORD.             
          I P A R (6) = L S R - THE SECTOR NUMBER, OR ADDRESS, ONE MIGHT SAY THE
                                SCANNED RECORD ADDRESS, OF A RECORD IN THE FILE 
                                TO BE READ OR WRITTEN.                          
          I P A R (7) = L F M T - THE SECTOR NUMBER ADDRESSING THE RECORD FORMAT     
                                  SPECIFICATION.
          I P A R (8) = N C P R - THE NUMBER OF FIELDS (CATEGORIES) PER RECORD. 
          I P A R (9) = L P F R - THE LOCATION OF THE POINTER FILE RECORD WHERE THE
				FILE PARAMETERS ARE STORED
          I P A R (10) = DATME - DATE AND TIME OF LAST "CALL SAVEF"                                              
                                                                                
   **CONVENTION 6** - THE FIRST FILE IN A PACK IS CALLED THE P O I N T E R      
     F I L E.  ITS RECORDS CONSIST OF THE 10 FILE PARAMETER WORDS IN THE ABOVE   
     CONVENTION.  THE FIRST RECORD OF THE POINTER FILE IS THE RECORD OF FILE    
     PARAMETERS DESCRIBING THE POINTER FILE.  THE I D OF THE FIRST RECORD IS    
     CONSIDERED THE I D FOR THE PACK. THE LAST RECORD OF THE POINTER FILE       
     DESCRIBES THE MASTER FILE AND THE MASTER FILE PARAMETERS DESCRIBE THE      
     COMPLETE SET OF DATA ON A PACK ONE SECTOR PER RECORD.                      
     THE CONCEPT OF THE MASTER FILE IS USED TO ENABLE ONE TO MANIPULATE FILES ON
     THE PACK.  M A X R OF THE MASTER FILE IS THE MAXIMUM SECTOR ADDRESS        
     AVAILABLE ON A PACK.                                                       
          IF WE ALLOW 20 FILES ON OUR PACK AND 20,000 SECTORS, INITIALLY THE POINTER FILE IS GIVEN 
     BY THE 20 X 10 MATRIX                                                      
          PACK1     1    3     20    1    1    0    0    1    0                 
             0     21   21  20000    1   21    0    0    2    0                 
             .                                      .                           
             .                                      .                           
             .                                      .                           
             0              .   .   .   .                                       
     WHERE THE ITH ROW CORRESPONDS TO THE FILE PARAMETERS OF THE ITH FILE ON THE
     PACK.  SINCE THE RECORD FORMAT FOR THE POINTER FILE AND THE MASTER FILE IS ALWAYS THE SAME, IT 
     IS NOT STORED ON THE DISK, AND NCPR=0.                                                 
                                                                                
     WE SEE THAT A FILE IN THE SYSTEM MAY BE VIEWED AS A 2-DIMENSIONAL MATRIX,  
F I L E, WHERE F I L E (I,J) IS THE JTH WORD OF THE ITH RECORD.  IN GENERAL,    
THERE IS NOT ENOUGH ROOM IN CORE TO STORE AN ENTIRE FILE SO THAT ONE RECORD AT  
A TIME IS USUALLY READ INTO MEMORY INTO A 1-DIMENSIONAL ARRAY, I R, WHERE       
I R (J) IS THE JTH WORD OF THE RECORD.                                          
                                                                                
   **CONVENTION 7** - THE ADDRESS (SECTOR NUMBER) OF THE FIRST RECORD OF THE    
     FILE MINUS THE NUMBER OF SECTORS PER RECORD IS THE ADDRESS OF A SCRATCH    
     RECORD.  IN FORTRAN, THIS ADDRESS MIGHT BE GIVEN BY I A D R E S = L F R -  
     N S P R.                                                                   
                                                                                
PROGRAMMING CONVENTIONS                                                         
                                                                                
     THE GENERAL PROGRAMMING PHILOSOPHY IN THE FILE MAINTENANCE SYSTEM IS THAT  
THE FILE AND RECORD PARAMETERS DESCRIBING THE FILE BEING OPERATED ON BE IN CORE.
THESE ARE STORED IN C O M M O N.                                                
                                                                                
   **CONVENTION 8** - EACH PROGRAM IN THE SYSTEM MUST DEFINE C O M M O N STORAGE
     TO ACCOMMODATE THE ABOVE FILE AND RECORD PARAMETERS.  HENCE, THE FOLLOWING 
     FORTRAN STATEMENTS SHOULD PRECEDE ANY OTHER C O M M O N STATEMENTS IN A    
     MAIN PROGRAM.                                                              
                                                                                
	C O M M O N   IDF,LFR,NAVR,MAXR,NSPR,LSR,LFMT,NCPR,LPFR,DATME
	C O M M O N   IFRMAT(3,N)
	E Q U I V A L E N C E  (IDF,IPAR(1))
                                                                                
     (WHERE N IS THE LARGEST NUMBER OF FIELDS PER RECORD IN ANY FILE            
     BEING USED).  NOTE IF THE PROGRAM IS A SUBROUTINE,  I F R M A T            
     MAY BE ONE-DIMENSIONAL AND THE SUBROUTINE  I S U B (I,J) GIVES             
     THE CORRESPONDING ONE-DIMENSIONAL SUBCSRIPT.                               
                                                                                
                                                                                
     THE USER SHOULD NOTE THAT THERE ARE TWO WAYS OF REFERRING TO THE FILE      
     PARAMETERS IN A FORTRAN PROGRAM.  FOR EXAMPLE, TO COMPUTE THE NUMBER OF    
     RECORDS IN A FILE ONE MIGHT WRITE                                          
               N R  =  (N A V R - L F R) / N S P R                              
          OR                                                                    
               N R = (I P A R (3) - I P A R (2) ) / I P A R (5)                 
     TO ALLOW FOR FIELDS OF BOTH INTEGER AND FLOATING POINT MODE IN THE SAME    
     RECORD.  WE DEFINE A BUFFER REGION (A 1-DIMENSIONAL ARRAY) AND GIVE IT BOTH
     INTEGER AND FLOATING POINT MODE.  IF I R IS THE NAME OF THE RECORD BUFFER  
     WE HAVE                                                                    
                                                                                
   **CONVENTION 9** -                                                           
          D I M E N S I O N I R (N), R (N) ( WHEREN IS EQUAL TO 10*NSPR

          E Q U I V A L E N C E (I R(1), R(1))                                  

          NOTE THAT IF A SUBROUTINE NEEDS BOTH INTEGER AND FLOATING FIELDS IN A 
     RECORD, THEN BOTH I R, AND R MUST APPEAR IN THE CALLING SEQUENCE.          







	     THE BULK OF THE SYSTEM CONSISTS OF A SET OF FORTRAN SUBROUTINES AND        
     FUNCTIONS WRITTEN IN EITHER FORTRAN OR  ASSEMBLY LANGUAGE THAT       
PERFORM THE BULK OF THE WORK IN ANY OPERATION ON A DATA FILE.  THESE PROGRAMS   
COME IN THE FOLLOWING CLASSES -                                                 
          (1) FILE DEFINITION AND MANIPULATION                                  
          (2) RECORD DEFINITION AND MANIPULATION                                       
          (3) RECORD SEARCHING                                                  
          (4) WORD MANIPULATION                                                 
          (5) GENERAL UTILITY AND DEBUGGING PROGRAMS.                           
                                                                                
     THE USER SHOULD NOTE THE LIBRARY OF THESE PROGRAMS SHOULD IN NO WAY BE     
CONSIDERED FIXED.  PROGRAMS MAY BE ADDED AND IMPROVED AT ANY TIME AS LONG AS    
THEIR APPEARANCE TO THE USER REMAINS THE SAME.                                  
                                                                                
     THE FOLLOWING IS A LIST OF THE MOST COMMONLY USED PROGRAMS OF THE SYSTEM.  
TYPE          DESCRIPTION                      NAME AND CALLING SEQUENCE        
(FUNCTION,                                                                      
SUBROUTINE,                                                                     
OR MAIN                                                                         
PROGRAM)                                                                        
                                                                                
S             DEFINE A FILE                    DFINEF(IDFILE,NSPR1,MAXR1,NCPR1) 
S             DEFINE A RECORD                  DFINER                           
S             SELECT A FILE                    SLECTF(IDFILE)                   
S             WRITE A RECORD ON DISK           WRITER(IR)                       
S             READ A RECORD ON DISK            READR(IR)                        
S             SAVE FILE PARAMETERS IN                                           
              POINTER FILE                     SAVEF                            
S             CLEAR RECORD BUFFER TO ZERO      CLEAR(IR)                        
S             ADVANCE N RECORDS IN FILE        RIGHT(N)                         
S             RETREAT N RECORDS IN FILE        LEFT(N)                          
F             FIND RECORD ON DISK              IFIND(IDR,IDIR,IHOW)             
S             CLEAR A FILE TO ZEROS            CLEARF(IDFILE)                   
S             TO DELETE A RECORD FROM FILE     DELETR(IDR,IR)                   
S             TO INSERT A RECORD IN A FILE     INSRTR(IR,IHOW)                  
F             SELECTIVE SEARCH                 IGETR(IR,N,INDEX,IVALUE,IF,LOGIC)
S             TO DUMP A RECORD WORD BY WORD    DUMP(IR)                         
MP            TO DELETE A FILE                 SCRTCH                           
MP            TO EXPAND A FILE                 INLRGE                           
S             TO DUMP A RECORD CATEGORY BY                                      
              CATEGORY                         DUMPR(IR,R)                      
MP		SELECTIVE TYPING		TYPEF
MP		SELECTIVE RECORD DUMP		DUMPF
MP		DEFINE A PACK			DPACK
MP		DEFINE INITIAL POINTER FILE	LODPTF
MP		DUMP POINTER FILE PARAMETERS	DMPPTF
MP		LOAD FORMAT SPECIFICATIONS	LODFMT
MP		DUMP FORMAT SPECIFICATIONS	DMPFMT
MP		EDIT CATEGORIES IN A RECORD	EDITF
MP		DEFINE INITIAL FILE PARAMETERS	CREATF
MP            SELECTIVE LISTING                LISTF                           
                                                                                
                                                                                
     IN NAMING PROGRAMS, THOSE DEALING WITH RECORDS USUALLY END IN R AND THOSE  
WITH FILES END IN F.                                                            
                                                                                
     NOTE THAT VARIABLES DEFINED IN C O M M O N MAY NOT BE USED IN CALLING      
SEQUENCES.                                                                      
                                                                                
      THE FOLLOWING IS A DESCRIPTION OF SOME OF THE MOST COMMONLY USED          
SUBROUTINES IN THE SYSTEM.  FORTRAN VARIABLE NAMES ARE INCLOSED IN **.          
QUOTES APPEAR AS ".                                                            
TYPE I                   FILE DEFINITION AND MANIPULATION                       
                                                                                
                                                                                
                                                                                
1.  DFINEF (IDFILE, NSPR1, MAXR1, NCPR1)                                        
     THIS PROGRAM SETS UP FILE PARAMETER RECORD IN POINTER FILE AND LEAVES      
THEM IN MEMORY UPON EXIT.  THE PARAMETERS IN THE CALLING SEQUENCE MUST NOT BE IN
**IPAR**(COMMON).                                                               
                                                                                
2.  SLECTF (IDFILE)                                                             
     LOOKS UP **IDFILE** IN POINTER FILE AND READS FILE AND RECORD PARAMETERS   
FROM DISK INTO COMMON VARIABLES **IPAR** AND **IFRMAT**.                        
                                                                                
3)  SAVEF                                                                       
     PUTS **IPAR** AND **IFRMAT** BACK ON THE DISK.  SHOULD BE USED WHENEVER    
**NAVR** OR **LSR** HAVE BEEN CHANGED BY THE PROGRAM AND THE USER IS CALLING IN 
A NEW FILE OR THE PROGRAM HAS FINISHED.  **IPAR** AND **IFRMAT** REMAIN IN CORE.
THE USE OF THIS PROGRAM ALSO INSURES THAT ANY UPDATED INFORMATION IN 
I/O BUFFERS (IN DIO) IS WRITTEN ON THE DISK.
                                                                                
4.  CLEARF(IR)                                                                  
     THIS PROGRAM INITIALIZES THE ENTIRE FILE AREA ON THE DISK TO ZEROS IE      
IT WRITES A RECORD FILE FULL OF ZEROS FROM **LFR** TO **NAVR**. IR(1) OF 
EACH RECORD IS UNCHANGED.
                 
                                                                                
5.  MERGEF(IDM,IDT,IR)                                                          
     **IDM**, **IDT** ARE FILE "ID'S" OF MASTER AND TEMPORARY FILES           
RESPECTIVELY.  BOTH FILES MUST BE IN ASSENDING ORDER BY THEIR RECORD "ID'S"   
THE PROGRAM MERGES THE TEMPORARY FILE TO THE MASTER FILE SO AS TO PRESERVE      
**ID** ORDER.  THE TEMPORARY FILE IS LEFT UNCHANGED.                            
                                                                                
6.  PULLF (IDM,IDT,IR)                                                          
     **IDT** IS A FILE WHOSE RECORD "ID'S" CORRESPOND TO SPECIFIC RECORD      
"ID'S" OF THE MASTER FILE **IDM**.  THE ORDER OF THE RECORD **ID'S** OF       
**IDT** MUST BE THAT OF THEIR ORDER OF OCCURANCE IN THE MASTER FILE.  THIS PRO- 
GRAM EXTRACTS THE SPECIFIED RECORDS FROM THE MASTER FILE AND STORES THEM IN THE 
TEMPORARY FILE.  THESE RECORDS ARE DELETED FROM THE  MASTER FILE.               
                                                                                
7.  EXPNDF (IDM,N)                                                              
     THIS PROGRAM EXPANDS THE MAXIMUM CAPACITY OF THE FILE FILE **IDM** BY **N**
RECORDS.                                                                        
                                                                                
8.  DELETF (IDM)                                                                
     THIS PROGRAM DELETS THE FILE **IDM** FROM THE PACK.  WHEN AT ALL POSSIBLE  
FILES SHOULD BE DELETED BY THE "LAST IN - FIRST OUT" ALGORITHM.               
                                                                                
                                                                                
9.	RLSORT(NPACKS,PACK1,ORIGF,PACK2,TEMPF,SORTDF,NWORD,NPASS,NCHAR,
	NSEC,MODE)
	  THIS PROGRAM SORTS A FILE ON SELECTED LOGICAL CHARACTERS OF
A SPECIFIED WORD IN A RECORD. A SECOND PACK ON A DIFERENT
FILE STRUCTURE(LEVEL D) MAY BE USED TO HOLD A TEMPORARY SCRATCH FILE TO 
SPEED UP THE SORT. THE SORTING ALGORITHM PRESERVES PREVIOUS
ORDERINGS.
	NPACKS-NUMBER OF  PACKS USED. 1 OR 2
	PACK1- ID OF POINTER FILE OF PACK CONTAINING ORIGF
	ORIGF- ID OF MASTER FILE.WILL BE ALTERED BY SORT.
	PACK2- ID OF POINTER FILE OF PACK TO HOLD TEMPF
	TEMPF- ID OF TEMPORARY FILE USED BY ALGORITHM
	SORTDF- ID OF FILE TO PUT SORTED FILE. MUST BE ORIGF,OR TEMPF.
	NWORD- WORD NUMBER WITHIN A SECTOR OF RECORD TO SORT ON.
	NPASS- NUMBER OF LOGICAL CHARACTERS IN WORD TO SORT ON.
	NCHAR- LOGICAL CHARACTER NUMBER FROM RIGHT TO START WITH.
	NSEC- SECTOR NUMBER WITHIN RECORD HOLDING KEY WORD.
	MODE- TYPE OF LOGICAL CHARACTER TO SORT. 
			1- 0NE DECIMAL DIGIT
			2- TWO DECIMAL DIGITS
			3- ONE ASCII CHARACTER


TYPE II               RECORD DEFINITION AND MANIPULATION                        
                                                                                
                                                                                
                                                                                
1.  DFINER                                                                      
     THIS SUBPROGRAM WRITES THE CONTENTS OF **IFRMAT** ON THE DISK ACCORDING    
TO THE SPECIFICATIONS OF **LFMT** AND **NCPR** OF THE FILE **IDF** WHOSE        
PARAMETERS ARE CURRENTLY IN COMMON.                                             
                                                                                
2.  CLEAR(IR)                                                                   
     THIS PROGRAM CLEARS THE RECORD STORAGE AREA SPECIFIED BY **IR** TO ZEROS   
FOR NUMBERIC WORDS AND BLANKS FOR ALPHABETIC WORDS.                             
                                                                                
3.  READR(IR), WRITER(IR)                                                       
     THESE PROGRAMS READ (WRITE) THE RECORD FROM (TO) THE DISK SPECIFIED BY     
**LSR** (THE LOCATION OF THE SCANNED RECORD).  **LSR** MUST BE WITHIN THE       
RANGE OF DEFINITION OF THE FILE.  **LFR** IS LESS THAN OR EQUAL TO  **LSR** IS  
LESS THAN OR EQUAL TO **MAXR**                                                  
                                                                                
4.  INSRTR(IR,IHOW)                                                             
     THIS SUBPROGRAM INSERTS THE RECORD STORED IN **IR** IN THE FILE ACCORDING  
TO **IHOW**.                                                                    
     A)  **IHOW=+1.  THE PROGRAM SEARCHES THE FILE FROM **LSR** TO THE END AND  
AND PLACES THE RECORD IN FRONT OF THE FIRST RECORD IT MEETS WITH AND **ID**     
GREATER THAN **IR(1).  IF NONE EXIST THE RECORD IS PLACES AT THE END OF THE FILE
**NAVR**.                                                                       
     B) **IHOW**=-1        SIMILIAR TO CASE (A) EXCEPT SEARCH IS MADE TO FIND   
THE FIRST RECORD WHOSE **ID** IS LESS THAN **IR(1)**.                           
     C)  **IHOW=0.         RECORD IS PLACED AT THE END OF THE FILE.             
                                                                                
5.  DELETR(IDR)                                                                 
     THIS FILE IS SEARCHED FOR A RECORD WHOSE "ID" (IR(1)) IS EQUAL TO        
**IDR** AND THAT RECORD IS DELETED FROM THE FILE.                               
THIS PROGRAM SHOULD ONLY BE USED SPARINGLY ON LARGE FILES.
IF MANY RECORDS ARE TO BE DELETED , USE PULLF.                                                                                
                                                                                
TYPE III                       RECORD SEARCHING                                 
                                                                                
                                                                                
                                                                                
1.  RIGHT (N), LEFT (N)                                                         
     ADVANCE, N (BACK SPACE) RECORDS IN THE FILE.  NO INFORMATION IS            
TRANSMITTED TO OR FROM THE DISK.                                                
                                                                                
2.  IFIND(IDR, IDIR, IHOW)                                                      
THIS FUNCTION SEARCHES A FILE FOR A RECORD WHOSE ID IS EITHER LESS THAN,EQUAL TO
OR GREATER THAN **IDR** ACCORDING TO DIRECTIONS GIVEN WITH PARAMETERS **IDIR**, 
**IHOW**.                                                                       
                                                                                
     **IDIR**=1 MEANS SEARCH IS TO THE RIGHT OR (DOWN A FILE) AND PROCEEDS      
RECORD BY RECORD.  **IDR**=-1 MEANS SEARCH IS TO THE LEFT. AFTER 15 REOCRDS A   
BINARY SEARCH IS CALLED.  ***IDR***=0  MEANS SEARCH IS LINEAR TO THE RIGHT      
(NO BINARY SEARCH) AND THE FILE IS VIEWED AS A CIRCLE.                          
                                                                                
     **IHOW**=0  THE PROGRAM SEARCHES LINEARLY UNTIL A RECORD IS FOUND WITH     
**IR(1)=IDR**.  LSR IS SET AT THE APPROPRIATE RECORD.  THE FUNCTION RETURNS WITH
VALUE 1.  IF RECORD IS NOT FOUND THE FUNCTION EXITS WITH THE VALUE 0 AND **LSR**
IS UNCHANGED.                                                                   
                                                                                
     **IHOW=1**  THE PROGRAM FINDS THE FIRST RECORD SUCH THAT **IR(1)** IS      
GREATER THAN **IDR** AND EXITS WITH VALUE 1 AND **LSR** SET TO THE APPROPRIATE  
VALUE.  IF THE RECORD IS NOT FOUND **IFIND** RETURNS WITH THE VALUE 0 AND       
**LSR** UNCHANGED.                                                              
                                                                                
     **IHOW=-1**  THE PROGRAM LOOKS FOR THE FIRST RECORD SUCH THAT **IR(1)**    
IS LESS THAN **IDR**.                                                           
                                                                                
3.  IGETR (IR,N,INDEX,IVALUE,IF,LOGIC)                                          
                                                                                
  THIS IS A SELECTIVE SEARCH FUNCTION SUB-PROGRAM THAT READS A RECORD INTO      
**IR** OR NOT, ACCORDING TO VALUES OF N WORDS WITHIN THE RECORD IN THE FILE.    
THE WORD NUMBERS WITHIN THE RECORD ARE SPECIFIED BY A LIST **INDEX(I), I=1,N**. 
THE VALUES WITH WHICH THESE WORDS ARE TO BE COMPARED ARE GIVEN BY THE LIST      
**IVALUE(I), I=1,N**.  NOTE THAT ONLY FIXED POINT OR ALPHA VALUES ARE ALLOWED.  
THE CONDITION OF WHETHER OR NOT A SPECIFIED WORD IN THE RECORD SHOULD BE        
GREATER, EQUAL OR LESS THAN ITS CORRESPONDING VALUE IS GIVEN BY THE LIST        
**IF(I),I=1,N**.                                                                
                                                                                
     **IF (I)** SHOULD BE THE VALUE OF 1,0 OR -1 DEPENDING ON THE CONDITIONS    
SPECIFIED ABOVE.                                                                
                                                                                
     THE VALUE OF **LOGIC** SHOULD BE 1 IF ALL (LOGICAL AND) OF THE N CONDITIONS
ARE TO BE SATISFIED AND 0 IF ANY (LOGICAL OR) OF THE N CONDITIONS ARE TO BE     
SATISFIED.                                                                      
                                                                                
     THE FUNCTION RETURNS WITH 1 IF THE SCANNED RECORD SATISFIES THE ABOVE      
CONDITIONS AND **IR** CONTAINS THAT RECORD.  IT RETURNS WITH THE VALUE 0 IF THE 
RECORD DOES NOT SATISFY THE CONTITIONS.                                         
                                                                                
                                                                                
TYPE IV             WORD MANIPULATIONS                                          
                                                                                
                                                                                
                                                                                
1.  IUNPAK(NL,NR,IN)                                                            
     THIS FUNCTION DISCARDS **NL** DIGITS ON THE LEFT OF THE WORD **IW** AND    
**NR** DIGITS ON THE RIGHT OF THE WORD **IW**.  THE FUNCTION RETURNS WITH THE   
REMAINDER OF THE WORD RIGHT-JUSTIFIED.                                          
                                                                                
2.  LUNPAK(NL,NR,IW)                                                            
	THIS FUNCTION IS SIMILAR TO IUNPAK EXECPT THAT IT OPERATES ON
5 ASCII CHARACTERS PER WORD AND RETURNS THE RESULTS LEFT JUSTIFIED AND
BLANK FILL TO THE RIGHT.

3.	JUNPAK(NL,NR,IW)
		THIS FUNCTION OPERAPTES ON ASCII WORD AND RETURNS THE 
RESULTS RIGHT JUSTIFIED AS OCTAL NUMBER.



		COMMENTS AT THE BEGINNING OF EACH SOURCE PROGRAM IN THE
SYSTEM DEFINE ITS USE.




		THE UTILITY PROGRAMS IN THE SYSTEM ILLUSTRATE AND GIVE
PROGRAMMING EXAMPLES OF THE USE OF THE FILE MAINTAINCE SYSTEM.