|
July 2001 Get the most out of your Robelle Tools Suprtool: New
Extract from a Table For some time, users have been aggressively asking us how to update a field in a dataset, or even a file, with a value from another file, based on a key. A classic example: Your boss comes to you with a list of new prices for certain parts and asks you to update the Part-Master dataset. Big News: You can now do
this easily in Suprtool. Starting with pre-release 4.4.10,
just load the new prices into a Table, index by the product number
(prodno), then Extract the price field from each record and replace
it with a $lookup on the table. Here is the code: As you can see, Suprtool now has the ability to load and extract data to and from a Table. Let’s go through the capability in more detail. For years Suprtool had the combination of the Table command and associated $lookup function to find the key values that have been loaded into a table, but only when doing record selection. Here is a simple example of
record selection using $lookup, where we build a file of orders that
both have a status of “OP” and are in a list that comes
from the file “orders;” >table province-table,prov-code,file,provfile,data(prov-name) At this point the key into
the Table is the prov-code item and for each entry in the Table there
is one associated prov-name. To append prov-name to each output
record, we read the customer dataset, extracting the customer name.
We also Define prov-name as a new field and extract it for the output
record, but we fill it with a value that is based on the prov-code
for each customer entry: Let’s assume that we have new
unit cost information for each product: >table
prodcost-table,prodno,file,newcosts,data(unit-cost) >extract unit-cost =
$lookup(prodcost-table,prodno,unit-cost) Here is the entire task, keeping in
mind that Update must be specified before the Extract command: This version of Suprtool is currently in beta-test. Robelle is looking for keen users to do some testing of the pre-release. Interested Suprtool sites, please send email to support@robelle.com or telephone 604.592.1700. This is the most requested
Suprtool enhancement request ever in the Suprtool’s 20 years.
Copyright The 3000 NewsWire. All rights reserved. |