THE MANAGEMENT PACKAGE
Wouldn’t it be nice if we could CAT the disk directory, and with X-RAY eyes see the data that is in each program! But all we can see is the titles and the data length of each recording. Too bad that data can’t be more visable! Probably the biggest problem of using computers is the need to plan ahead and organize indexes of files so that later we will be able to find the data that we need to use. Last issue, we started with “SDOS MAIL MERGE”, a software that creates all kinds of Listings of Data, from “mailing lists, inventory lists, books and articles lists, to the daily milk producing records of a dairy herd”. These lists are Saved for future use in “Character Arrays”.
The lists produced by SDOS MAIL MERGE are just that, “lists”. SDOS Mail Merge gives you a “Sorted, pure List”, and provides options for print outs in several formats, LABELS being one of the most useful. Now if you work with many lists of things or people, you know that each list that you produce is likely to repeat some of the data that is contained in another list. If you print a lot of mailing labels using several mailing lists, you are likely sending out duplicate letters to the same persons. It takes a lot of time to cross reference several mailing lists, then more time to eliminate the duplications. So, we have two problems to solve, one- eliminate duplications, and two- “X-RAY the disk files to see their contents”.
The Data Management Package consists of SDOS MAIL MERGE and the two Companion Programs, “PURITY” and “LIST LOOKER”, both given in this issue. These two companion programs are short enough that the key-in project should be easy. But, as usual, the two programs will be included in the January Issue Diskette. “LIST LOOKER” is your “X-RAY Eyes”, and “PURITY” is your program to PURIFY all of your various listings against each other to eliminate duplications within all of the lists. Each of these programs are independant, and designed to be used with the files produced by SDOS MAIL MERGE. Actually, they can be used to purify and process ANY Dimensioned Character Array files, whatever the source.
PURITY also has another purpose. Long Mail or Inventory Files cannot be LOADED to a Printing software because of the limited amount of FREE memory of the host program. MSCRIPT and SMART TEXT both gives us somewhere between 12K and 17K of FREE memory to be used for both TEXT and MAILING LISTS. A 96 Name File, having 7 lines of 31 Characters each, takes up 20732 bytes, and cannot be loaded to either program. BUT, if we break down such large mailing lists to, say, 12 names per list, and “process the groups automatically”, then there is sufficient FREE available with almost any word processing software. Such a scheme would result in the handling of mail files of 2604 bytes each, well within the capacity of any Word Processing Software.
I wont speak for MSCRIPT, but Smart Text can take 40 such files of 12 name groups, and print them all without hesitating, as Form letters, or Labels, or as just print outs of the listings. So, “PURITY” is designed to enhance the capabilities of all Word Processing Softwares, by splitting up Large Listings so that they can be loaded to the operating programs. Now for the details.
PURITY
At right is a screen copy of the Purity Function Menu. This menu is line number 152 which is the starting line number of the program. As functions are accomplished, this menu is re-presented. The PURITY program may be SAVED and re-loaded with data aboard. Or, a selection of <6> will bring prompts to install a Data Diskette, then CAT the directory and prompt for input of “file name”. When a file is loaded, the menu re-appears and processing can begin. Each loaded file is “purified” with itself, eliminating duplicates, and eliminating skips, by a selection of <7>. When finished, the file may be RE-SAVED by a selection of <1> or <3>.
YOUR CHOICES ARE: 1. RE-SAVE This FILE (SAVE OVER) 2. Break into 12 Name Files, SAVE to PURITY DISK 3. SAVE this Large File To PURITY DISK 4. COMPARE with all PURITY FILES for DUPLICATES 5. FLIP through File Names on Screen 6. LOAD another Large File 7. PURIFY this File
The selection of <2> will result in the large file being broken up into groups of 12 name files and each file SAVED with IN-SEQUENCE numeric file names, “mx1 through mx100”. This begins the creation of your “Purity Disk”. For example, if the large file being processed is a file of 96 name groups, your “purity disk” will have 8 group SAVES, and their titles will be “mx1 through mx8”. The “purity files” will be used to “purify your other large group files”. To process more large files, select <6> to load in the files one at a time, then <7>, then <4>. As that sequence finishes, the large file being processed has been compared with the 8 purity files, and all duplicates eliminated. The large file is now PURE, and may be SAVED as a large file.
Now that we have the second large file purified, it may also be saved to the purity disk by selecting <2>. Then, the “mx” files are again saved as “12 name groups”, mx9 through mx16. There will be fewer saves of mx files if the elimination of duplicate names resulted in fewer name files in the large list. As more files are loaded in and processed, the purity file grows, and as it grows the number of comparisons with the next large file increases. For example, if we purify 10 files of 96 names, there could be as many as 80 mx files saved to the purity disk (no duplicates found), or 40 mx files if half of the names were duplicated within the files being processed.
PROGRAMMING
This is a program of Nested Counters within Nested counters. The number of individual counts is astronomical. To purify just one 96 name file against itself requires 4608 comparison counts, plus 7 counts for each duplicate found, plus 4608 counts to eliminate interior skips, plus 7 counts for each skip eliminated. I haven’t even attempted to sum up the number of counts required to compare all of the fields of a large file with the mx files in the purity disk (be my guest). One or two files are processed fairly fast, taking only about two minutes. As the purity files build, the time of processing increases. This is an ideal BASIC program to assemble with TIMECHINE to greatly increase its speed of operation.
PURITY will not recognize such repeats as, “John L. Sullivan, Mr. John L. Sullivan, and J. L. Sullivan”. While using MAIL MERGE to create the files, you should be consistant with the format for entering names. Comparisons are made with the FIRST LINE of each name group, the “name line”. If two Name Lines are the same, then the whole group of 7 lines “of the large file being processed” are deleted. The files in the Purity Disk are never changed. The menus are arranged so that prompts give the break needed to change diskettes. You can use PURITY in several different ways to process your listings. The pure files are then ready to print out with either SDOS MAIL Merge, LIST LOOKER, Smart Text, or any software that can handle character array listings.
THE PURITY LLIST
10 FOR n=1 TO 8: LOAD /"mx"+STR$ n DATA k$(): FOR y=1 TO 12: PRINT n;" ";y: FOR g=1 TO 4: PRINT k$(y,g): NEXT g: NEXT y: NEXT n
20 STOP
25 FOR n=1 TO 96: PRINT n'o$(n,1): NEXT n
30 STOP
55 CLS : PRINT AT 10,0;"Install your Mail File Diskette"''"Touch ENTER": PAUSE 4e4: CLS
60 LET i=0: LET b=1: LET x=0
65 LET a=0: BORDER 0: PAPER 0: INK 5: CLS : CAT : INPUT "Input Name of Array to LOAD";a$: LOAD /a$ DATA o$()
66 GO TO 152
70 CLS : PRINT AT 10,0;"Check all 96 Names and DELETE DUPLICATES "; FLASH 1;"Line 80"
80 FOR n=1 TO 96: IF n>96 THEN GO TO 135: REM **Field counter
82 IF o$(n,1,1)=" " THEN NEXT n: GO TO 135
90 FOR y=n+1 TO 96: REM ** comparison counter
100 IF o$(n,1)=o$(y,1) THEN FOR m=1 TO 7: LET o$(y,m)="": NEXT m: REM ** Delete dup-licate
110 NEXT y
120 NEXT n
135 CLS : PRINT AT 10,0;"Eliminate skips in 96 Name array"; FLASH 1;"Line 140"
140 FOR n=1 TO 96: IF n>96 THEN GO TO 152
142 IF o$(n,1,1)<>" " THEN NEXT n: GO TO 152
144 FOR y=n+1 TO 96: IF y>96 THEN NEXT n: GO TO 152
146 IF o$(y,1,1)=" " THEN NEXT y: NEXT n: GO TO 152
148 FOR g=1 TO 7: LET o$(n,g)=o$(y,g): NEXT g: FOR g=1 TO 7: LET o$(y,g)="": NEXT g
150 NEXT n
151 CLS : PRINT AT 0,0;"The file "; FLASH 1;a$; FLASH 0;" is now Purified"
152 CLS : PRINT AT 2,0;"Your Choices are:"''"<1> Re-SAVE this file"''" (SAVE OVER old file"''"<2> Break into groups of 12 name files and SAVE to the Purity disk"''"<3> SAVE this whole file to the Purity disk"''"<4> Compare with ALL Purity files for Repeats."''"<5> Flip Through File Names"''"<6> LOAD another File"''"<7> Purify this File"''"<8> Remove Skips Only": INPUT "Input choice ";z: GO TO (z=8)*VAL "140"+(z=7)*70+(z=1)*160+(z=2)*178+(z=3)*160+(z=4)*370+(z=5)*600+(z=6)*50+(z<1 OR z>8)*152
160 CLS : PRINT AT 10,0;"Split the 96 name array into 8 12 name arrays and save each to disk "; FLASH 1;"Line 170"
170 CLS : PRINT AT 10,0;"This is a PURE FILE SAVE. To SAVE OVER EXISTING, keep same disk."''"To SAVE on PURITY DISK, Install PURITY DISK"''"ENTER When READY": PAUSE 4e4: CLS
172 INPUT "INPUT FILE NAME ";z$: PRINT '' FLASH 1;"SAVING ";z$: SAVE /z$ DATA o$(): GO TO 152
174 FOR n=1 TO 100: ON ERR GO TO 176: LOAD /"mx"+STR$ n DATA k$(): NEXT n
176 ON ERR RESET : LET b=(n-1 AND n>1)+(1 AND n<2)
178 LET a=0: REM * "a"counts the large fields in inc- rements of 1. "b" numbers the disk files to save.
180 FOR c=1 TO 96 STEP 12: REM *get groups of 12 name fields
190 IF c>96 THEN STOP : GO TO 340
200 DIM k$(12,7,31)
210 FOR y=1 TO 12: REM ** count to fill a 12 name file array
220 FOR g=1 TO 7: REM **count to fill 7 lines
230 IF o$(c+a,1,1)=" " THEN LET c=96: LET y=12: LET g=7: GO TO 340: REM ** If first chr is aspace then quit, no more names present
240 LET k$(y,g)=o$(c+a,g): IF a=12 THEN LET a=0: GO TO 300
250 NEXT g
255 LET a=a+1: IF a>12 THEN NEXT c
260 NEXT y
300 CLS : LET z$=STR$ b: PRINT ;AT 15,0;"Saving ""mx"; FLASH 1; INK 6;z$; INK 5; FLASH 0;"""";: SAVE /"mx"+STR$ b DATA k$(): LET b=b+1: LET a=0: NEXT c
310 NEXT c
330 CLS : BEEP 1,20: PRINT AT 10,0;"File name ";a$;" has been split"''"into ";b-1;" groups named ""mx";i+1'"through mx";b-1;"""."''"ENTER to Continue.": PAUSE 4e4: CLS : GO TO 350
340 IF k$(1,1,1)<>" " THEN GO TO 300
342 LET b=b-1: GO TO 330
350 CLS : PRINT AT 10,10;"Your Choices:"''TAB 4;"1. Quit"''TAB 4;"2. Load Another File": INPUT z: IF z=1 THEN PRINT ''TAB 4;"Install BASIC Disk, ENTER": PAUSE 4e4: CAT : INPUT "Input Title to LOAD";a$: LOAD /a$
360 CLS : PRINT AT 10,0;"Install Data file Diskette"''"ENTER When READY": PAUSE 4e4: CLS : GO TO 65
370 CLS : PRINT AT 10,0;"Now purifying against the ""mx"" files in Purity Disk."'' FLASH 1;"Install Purity Disk and ENTER": PAUSE 4e4: FOR r=1 TO 200: ON ERR GO TO 372: LOAD /"mx"+STR$ r DATA k$(): PRINT AT 15,0;"Checking number of Files "; FLASH 1;"mx";r: NEXT r
372 CLS : ON ERR RESET : LET i=r-1: FOR r=1 TO i: PRINT AT 10,0;"Processing file "; FLASH 1;"mx";r; FLASH 0;" to Delete Repeats in "; FLASH 1;a$: LOAD /"mx"+STR$ r DATA k$()
374 FOR n=1 TO 12: IF n>12 THEN GO TO 388: REM **Group counter
376 FOR y=1 TO 96: IF y>96 THEN GO TO 386
378 IF o$(y,1,1)=" " THEN GO TO 384
382 IF k$(n,1)=o$(y,1) THEN FOR m=1 TO 7: LET o$(y,m)="": NEXT m: REM ** Delete dup-licate
384 NEXT y
386 NEXT n
388 NEXT r
396 LET b=i+1: GO TO 135
500 FOR w=7 TO 12: LOAD /"mx"+STR$ w DATA k$(): FOR z=1 TO 12: LPRINT z;" ";k$(z,1): NEXT z: NEXT w
550 STOP
600 FOR w=1 TO 100: ON ERR GO TO 602: PRINT w;" ";o$(w,1): NEXT w: STOP
602 ON ERR RESET : PRINT FLASH 1: PRINT '"ENTER WHEN READY": PAUSE 4e4: CLS : GO TO 152
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.