Trailing-Edge
-
PDP-10 Archives
-
decus_20tap5_198111
-
decus/20-0137/mthmrg/mthmrg.doc
There are 2 other files named mthmrg.doc in the archive. Click here to see a list.
LIBRARY PROGRAM #3.4.1
CALLING NAME: MTHMRG
PREPARED BY: BERENICE HOUCHARD
PROGRAMMED BY: BERENICE HOUCHARD
APPROVED BY: JACK R. MEAGHER
DATE. OCTOBER, 1972
MATCH MERGE PROGRAM
1.0 GENERAL DESCRIPTION
THE MATCH MERGE PROGRAM UPDATES A DATA FILE WITH THE USER'S CHOSEN OPTION
ON A CERTAIN KEY WORD. THE FIVE OPTIONS AVAILABLE ARE: REPLACE, INSERT,
DELETE, MISMATCH AND MATCH.
A FILE IS UPDATED BY EITHER REPLACING, ADDING, DELETING A RECORD OR BY
CREATING MATCHED AND MISMATCHED FILES.
2.0 LIMITATIONS & REQUIREMENTS
1. TWO INPUT DATA FILES ARE REQUIRED:
(A) AN ORIGINAL DATA FILE TO BE UPDATED, AND
(B) AN UPDATING FILE.
2. THE INPUT FILES SHOULD BE ON THE USER'S AREA BEFORE EXECUTION
UNDER A FILENAME NOT MORE THAN SIX CHARACTERS LONG WITH OR
WITHOUT AN EXTENSION.
3. THERE IS NO LIMIT ON FILE SIZE.
4. PROGRAM GENERATES OUTPUT FILES AND AUTOMATICALLY ASSIGNS NAMES.
THE FILENAMES HAVE THE FORM ?N.DAT WHERE ? RANGES FROM A TO Z
AND N RANGES FROM 1 TO 3.
5. THE PROGRAM CAN BE REPEATED AT MOST 26 TIMES PER EXECUTION.
3.0 PROGRAM CAPABILITIES & OPTIONS
THE MATCH MERGE PROGRAM CAN BE PROCESSED BY BATCH OR TERMINAL. THE
PROGRAM IS IN CONVERSATIONAL MODE TO ALLOW INTERACTION WITH THE USER
ON TERMINAL JOBS.
3.1 PROGRAM OUTLINE
FOLLOWING IS AN OUTLINE OF THE PROGRAM OPTIONS. THE STATEMENTS LISTED
BELOW WILL BE TYPED OUT BY THE PROGRAM IN WHICH A RESPONSE IS IMPERATIVE
TO EACH LINE. ON BATCH JOB, MAKE UP ONE CARD FOR EACH APPROPRIATE STATEMENT.
ALL ENTRIES ON TERMINAL JOBS ARE TERMINATED BY A "<CR>".
LINE 1 ENTER INPUT DATA FILENAME--
ENTER NAME OF THE DATA FILE TO BE UPDATED. THIS NAME SHOULD BE AT MOST
SIX (6) CHARACTERS LONG WITH OR WITHOUT EXTENSION.
LINE 2 UPDATE FILENAME--
ENTER THE NAME OF THE UPDATING FILE. AGAIN, THIS NAME SHOULD BE AT
MOST SIX (6) CHARACTERS LONG WITH OR WITHOUT EXTENSION. EVIDENTLY,
ENTRIES FOR LINES 1 AND 2 CANNOT BE IDENTICAL.
LINE 3 ENTER OPTION (REPLACE, INSERT,DELETE,MISMATCH,MATCH)--
ENTER ONE OF THE ABOVE OPTIONS ENCLOSED IN PARENTHSES. THE FIRST
THREE OPTIONS ARE SELF-EXPLANATORY, AFILE IS UPDATED BY EITHER REPLACING,
INSERTING OR DELETING A SPECIFIC RECORD. IN THE LAST TWO OPTIONS,
RECORDS IN THE DATA FILE AND THE UPDATING FILE THAT DO NOT MATCH
WITH ONE ANOTHER ARE PLACED IN TWO DIFFERENT FILES. A THIRD FILE IS
GENERATED COMPRISING OF , IN THE CASE OF THE MATCH OPTION, RECORDS
PRESENT IN BOTH INPUT DATA FILES; AND IN THE CASE OF THE MISMATCH
OPTION, RECORDS FROM BOTH INPUT DATA FILES THAT DO NOT MATCH WITH ONE
ANOTHER.
LINE 4 KEY WORD LOCATED IN COLUMNS--FROM,TO--
ALL UPDATING IS BASED ON THE KEY WORD, EXAMPLE: STUDENT NUMBER, LAST
NAME OF A PERSON, CATALOG NUMBER. THE KEY WORD SHOULD APPEAR
IN THE SAME COLUMNS FOR EVERY RECORD OF BOTH INPUT DATA FILES. IT
CAN BE AT MOST 80 CHARACCTERS LONG.
IN THIS LINE INDICATE WHERE THE KEY WORD IS LOCATED BY ENTERING THE FIRST AND
LAST COLUMNS BETWEEN WHICH THE KEY WORD IS SITUATED. SEPARATE THE TWO NUMBERS BY A
COMMA.
LINE 5 END OF JOB, TYPE 1 TO CONTINUE OR 0 TO TERMINATE--
AT THIS STAGE, ONE UPDATING JOB IS DONE. THE USER HAS THE CHOICE OF
REPEATING THE PROCESS, IN THIS CASE ENTER A 1 AND PROCEED TO LINE 1
OR BRANCHING OUT OF THE PROGRAM, IN THIS CASE ENTER A 0.
3.2 PROGRAM OUTPUT
(1) A SUMMARY REPORT THAT COMES OUT ON THE TERMINAL ON TERMINAL
JOBS OR ON THE TRAILER SHEET ON BATCH JOBS.
(2) OUTPUT FILES
OUTPUT FILES HAVE THE FORM ?N.DAT, WHERE ? RANGES FROM A TO Z
CORRESPONDING TO THE ALLOWABLE 26 REPETITIONS PER EXECUTION AND
AND N RANGES FROM 1 TO 3 TO BE EXPLAINED BELOW:
TWO OUTPUT FILES WILL BE GENERATED WITH THE REPLACE, INSERT AND
DELETE OPTIONS. THE FIRST FILE, WHERE N=1, IS THE FINAL UPDATED
FILE. THE SECOND FILE, WITH N=2, CONSISTS OF ALL RECORDS IN THE
INPUT UPDATING FILE THAT ARE NOT USED. OBVIOUSLY, IN THE THE CASE
WHERE ALL THE RECORDS ARE USED, THE SECOND FILE WILL BE EMPTY.
THREE OUTPUT FILES WILL BE GENERATED WITH THE MISMATCH AND
MATCH OPTIONS. THE FIRST TWO FILES, WITH N=1 AND 2, COMPRISE
OF RECORDS FROM THE ORIGINAL DATA FILE AND THE UPDATING
FILE RESPECTIVELY THAT DO NOT MATCH WITH ONE ANOTHER. IN THE
CASE OF THE MISMATCH OPTION, THE THIRD FILE CONSISTS OF RECORDS
FROM BOTH INPUT DATA FILES THAT DO NOT MATCH WITH ONE ANOTHER.
IN THE CASE OF THE MATCH OPTION,THE THIRD FILE CONSISTS OF
RECORDS THAT ARE PRESENT IN BOTH INPUT DATA FILES. FOR
EXAMPLE, SUPPOSE TWO DATA FILES, DATA1.FIL AND DATA2.FIL
ARE TO BE UPDATED BY UP1.FIL AND UP2.FIL WITH OPTIONS DELETE
AND MATCH RESPECTIVELY. THEN, ASIDE FROM THE TWO SUMMARY REPORTS
FIVE (5) OUTPUT FILES WILL BE GENERATED; NAMELY A1.DAT, A2.DAT,
B1.DAT, B2.DAT, B3.DAT.
4.0 METHOD OF USE
PROCEDURE AND SET UP FOR TERMINAL AND BATCH JOBS DIFFER SLIGHTLY.
4.1 TERMINAL JOB
FOLLOWING A SUCCESSFUL LOGIN, IF THE USER NEEDS TO PUT THE DATA ON
THE DISK ENTER THE FOLLOWING LINES (DO NOT TYPE IN THE PERIODS AND
STARS I.E. . AND *):
.AS CDR<CR> ASSIGN CARD READER TO USER'S JOB
.R PIP MONITOR CONTROL INSTRUCTION
*DATA.DAT=CDR: THESE LINES IN ESSENCE ARE
*UP.DAT=CDR: 2*N NUMBER OF LINES WHERE
(A) N=# OF DATA FILES TO BE
BE CREATED AND UPDATED.
(B) THE NAMES DATA.DAT AND
UP.DAT ARE ARBITRARY,
*^C MONITOR CONTROL INSTRUCTION
.DEAS CDR<CR> DEASSIGN CARD READER
TO START PROGRAM EXECUTION, ENTER "R MTHMRG<CR>". INTERACTION BETWEEN
USER AND PROGRAM BEGINS AT THIS POINT. THE PROGRAM WILL TYPE OUT THE
STATEMENTS OUTLINED IN SECTION 3.1.
OUTPUT DISK FILES WILL HAVE <077> PROTECTION CODE, USER IS ADVISED TO
CHANGE THE PROTECTION CODE IF THE FILES ARE TO BE SAVED FOR FUTURE USE.
ONE WAY OF GIVING A HIGHER PROTECTION CODE WILL BE,
.PRO ??.DAT<155><CR>
4.1.1 SAMPLE TERMINAL RUN
CONSIDER A DATA FILE INI.DAT TO BE UPDATED BY UP.DAT. THE KEY WORD IS
LOCATED IN COLUMNS 1 TO 5. TWO OPTIONS ARE SELECTED USING THE SAME
INPUT FILES.
NOTE: EXCEPT FOR PROMPTINGS, <CR> AND ALL INFORMATION ON THE
SAME LINE WITH <CR> ARE ENTERED BY USER.
.R MTHMRG<CR>
ENTER INPUT DATA FILENAME--INI.DAT<CR>
UPDATE FILENAME--UP.DAT<CR>
ENTER OPTION (REPLACE,INSERT,DELETE,MISMATCH,MATCH)--REPLACE<CR>
KEY WORD LOCATED IN COLUMNS--FROM,TO--1,5<CR>
*****SUMMARY REPORT*****
TOTAL NUMBER OF RECORDS IN INPUT DATA FILES:
INI.DAT = 7
UP.DAT = 5
NUMBER OF RECORDS IN FINAL UPDATED FILE = 7
THIS FILE IS UNDER FILENAME A1.DAT
NUMBER OF RECORDS REPLACED = 2
NUMBER OF RECORDS IN UP.DAT NOT USED = 3
THIS FILE IS UNDER FILENAME A2.DAT
**************
END OF JOB, TYPE 1 TO CONTINUE OR 0 TO TERMINATE--1<CR>
ENTER INPUT DATA FILENAME--INI.DAT
UPDATE FILENAME--UP.DAT
ENTER OPTION (REPLACE,INSERT,DELETE,MISMATCH,MATCH)--MATCH<CR>
KEY WORD LOCATED IN COLUMNS--FROM,TO--1,5<CR>
*****SUMMARY REPORT*****
TOTAL NUMBER OF RECORDS IN INPUT DATA FILES:
INI.DAT = 7
UP.DAT = 5
NUMBER OF RECORDS MISMATCHED IN INI.DAT = 5
THIS FILE IS UNDER FILENAME B1.DAT
NUMBER OF RECORDS MISMATCHED IN UP.DAT = 3
THIS FILE IS UNDER FILENAME B2.DAT
TOTAL NUMBER OF RECORDS MATCHED = 2
THIS FILE IS UNDER FILENAME B3.DAT
**************
END OF JOB, TYPE 1 TO CONTINUE OR 0 TO TERMINATE--0<CR>
EXIT
.
FOR REFERENCE PURPOSES, FOLLOWING ARE THE INPUT AND OUTPUT FILES:
INPUT FILES
INI.DAT UP.DAT
12384AAAAAAA 11111KOKOKOK
29384KKKKKKK 28345UPUPUPU
98475IIIIIII 12384HUHUHUH
18273LLLLLLL 73849UIUIUIU
29389KKKKKKK 29381TYTYTYT
87645OOOOOOO
29381LLLLLLL
REPLACE OPTION OUTPUT FILES
A1.DAT A2.DAT
12384HUHUHUH 11111KOKOKOK
18273LLLLLLL 28345UPUPUPU
29381TYTYTYT 73849UIUIUIU
29384KKKKKKK
29389KKKKKKK
87645OOOOOOO
98475IIIIIII
MATCH OPTION
B1.DAT B2.DAT B3.DAT
18273LLLLLLL 11111KOKOKOK 12384AAAAAAA
29384KKKKKKK 28345UPUPUPU 29381LLLLLLL
29389KKKKKKK 73849UIUIUIU
87645OOOOOOO
98475IIIIIII
4.2 BATCH JOB
THE FOLLOWING IS A BATCH JOB SET UP: (EACH LINE REPRESENTS ONE
CARD, EACH CARD STARTING IN COLUMN 1; DO NOT INCLUDE THE COMMENTS AT THE
RIGHT. IGNORE $DECK TO $EOD IF DATA ARE ALREADY ON THE DISK.
COMMENTS
$JOB [#,#] JOB CARD; INSERT USER'S PROJECT
PROGRAMMER NUMBER WITHIN THE BRACKET
$PASSWORD ###### IN PLACE OF THE 6 #'S, PUT IN THE
PASSWORD.
$DECK FILE.EXT FILE.EXT IS A DUMMY NAME USED IN THIS
WRITEUP. THE USER IS EXPECTED TO
PROVIDE A UNIQUE NAME TO EACH DATA
FILE.
DO NOT USE ANY OF THE OUTPUT
FILE NAMES TO BE GENERATED BY THE
PROGRAM.
(DATA CARDS) INSERT THE DATA CARDS TO BE UPDATED
HERE
(REPEAT THE ABOVE 4 LINES AS MANY TIMES AS THERE ARE DATA FILES TO BE UPDATED.)
$EOD SIGNIFY THE END OF THE DATA DECKS.
.R MTHMRG START PROGRAM EXECUTION.
(RESPONSES TO LINES 1-5 IN
SECTION 3.1) USER'S RESPONSES.
.PRO ??.DAT<155> TO PROTECT OUTPUT FILES.
.Q ??.DAT/FI:AS IF YOU WANT A LISTING OF THE OUTPUT
FILES, USE THIS LINE OTHERWISE IGNORE IT.
***********************************************************************
IF YOU WANT A CARD DECK OF THE OUTPUT FILES, USE THE FOLLOWING
.PLEASE START THE CDP SPOOLER
.Q CDP:=??.DAT
***********************************************************************
(EOF) AN END-OF-FILE CARD