Hi

I've been trying to make sense of part file algorithms for some distributed
file work I'm doing.  In so doing, I've come up with the following
"micro-explanations" and examples.

Can anyone in the know please say whether the following is correct? ...


If a file has [EMAIL PROTECTED] records consisting mainly of numbers (or more
specifically, ending with a number), algorithms like the following can be used
to spread incoming data across the parts:

For a...

2-part file:  "INDEX('01234',@ID[LEN(@ID),1],1); IF @1 THEN 1 ELSE 2"
  (Records ending 0-4 go into one file, all else (eg 5-9) go into the other)

4-part file:  "@ID[1]; IF NUM(@1) THEN CONVERT("0123456789","1122333444",@1)
ELSE 2"
  (A compromise, as the 10 digits (0-9) don't go evenly into 4 groups or
parts.)
  (The ELSE 2 just puts anything non-conforming into part 2)

5-part file:  "@ID[1]; IF NUM(@1) THEN CONVERT("0123456789","1122334455",@1)
ELSE 1"
  (Puts records ending 0-1 into part 1, records ending 2-3 into part 2, etc.)
  (All else, ie non-numeric, go into part 1.)

10-part file: "INTERNAL "@ID[LEN(@ID),1]+1""
  (Looks to me like this simply puts records ending 0-9 into the same-numbered
part file, ie  records ending with 0 go into part 0.  CAUTION: Obviously this
means the part files must start  their numbering from 0.)

Thanks,
LeRoi

LeRoi Keiller
Technical Support

Ultradata - Vision to Reality
+61 3 9291 1700
www.ultradata.com.au
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to