Distribute a file on UniVerse
(thanks to Lauren Shah for her help on this document. KLP)
MEMO file used in this example.
Be sure to read the notes at the end carefully. They can save you hours.
Run ANALYZE.FILE MEMO from TCL
If the file is going to be separated into 5 parts, do the following:
Number of databytes divided by the number of parts divided by the separation times 512 (2048 for separation of 4) times 1.2
Example: 829211120 / 5 / 2048 * 1.2 = 97173
If you are creating a new file and wish each partfile to be 5000MB (number of bytes = 5000 * 1024 * 1024), just divide that number by 2048 and multiply by 1.2 (assuming you need to add 20% for growth.
Example: 5242880000 / 2048 * 1.2 = 3072000
> PRIME 97173 (or 3072000)
Next lower prime number: 97171. (or 307189)
Next higher prime number: 97177. (or 307201)
The one you select will be the modulo of each partfile
> CREATE.FILE MEMO1 1,1,5 97177,4,18
> CREATE.FILE MEMO2 1,1,5 97177,4,18
> CREATE.FILE MEMO3 1,1,5 97177,4,18
> CREATE.FILE MEMO4 1,1,5 97177,4,18
> CREATE.FILE MEMO5 1,1,5 97177,4,18
> CREATE.FILE MEMO6 1,1,5 7,4,18 <=- CATCH-ALL part, which should remain empty but seldom does. Data in this file can usually be deleted.
> CNAME MEMO,MEMO-OLD
> ED MD FIVE.ALG
0001: I
0002: IF @ID[1]='0' OR @ID[1]='1' THEN 1 ELSE IF @ID[1]='2' OR @ID[1]='3' THEN 2 ELSE IF @ID[1]='4' OR @ID[1]='5' THEN 3 ELSE IF @ID[1]='6' OR @ID[1]='7' THEN 4 ELSE IF @ID[1]='8' OR @ID[1]='9' THEN 5 ELSE 6
> DEFINE.DF MEMO ADDING MEMO1 1 MEMO2 2 MEMO3 3 MEMO4 4 MEMO5 5 MEMO6 6 INTERNAL FIVE.ALG
> COPY DICT MEMO-OLD *
TO:(DICT MEMO
> COPY MEMO-OLD * (I
TO:(MEMO
> DELETE.FILE MEMO-OLD
Instructional differences for 10 PARTFILESChange the number of files created to 11, with the commands also reflecting 11 files, then use the following algorithm:
> ED MD TEN.ALG
0001: I
0002: IF @ID[1]='1' THEN 1 ELSE IF @ID[1]='2' THEN 2 ELSE IF @ID[1]='3' THEN 3 ELSE IF @ID[1]='4' THEN 4 ELSE IF @ID[1]='5' THEN 5 ELSE IF @ID[1]='6' THEN 6 ELSE IF @ID[1]='7' THEN 7 ELSE IF @ID[1]='8' THEN 8 ELSE IF @ID[1]='9' THEN 9 ELSE IF @ID[1]='0' THEN 10 ELSE 11
To Define a distributed file with ten parts, use the following command:
> DEFINE.DF MEMO ADDING MEMO1 1 MEMO2 2 MEMO3 3 MEMO4 4 MEMO5 5 MEMO6 6 MEMO7 7 MEMO8 8 MEMO9 9 MEMO10 10 MEMO11 11 INTERNAL TEN.ALG
|
The benefit will be seen when distributed files are created that use non-numeric keys and access is needed to a specific partfile first. Partfiles are accessed with LIST, SORT, SELECT and other commands in the order in which they are assigned at the DEFINE.DF command starting with part 1 regardless of which filename is part 1. 0001: I |