| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
Robelle Sponsor Message

January 2003

Get the most out of your Robelle Tools

Suprtool: a power beta version

Neil Armstrong, the Suprtool architect, is very proud to announce the release of Suprtool 4.6.02, which he considers one of the most exciting pre-releases of Suprtool in a long time. This version has many features that Suprtool users have asked for, for a very long time.

For the HP-UX version of Suprtool, the big news is that we rewrote the underlying file handling for tables, so that Update from a table is available, as well as expanded tables. Not to mention support for HP Eloquence version 7 (see www.eloquence3000.com for more information).

Some of the key new features for both the MPE and HP-UX versions are:

• Suprtool and STExport now support features to “clean” your data (see below for details).

• STExport now supports an Escape command which will escape out certain characters (usually delimiters).

• Suprtool now supports a $Counter function which will increment an integer field for output record (like >output,new. This is useful for resorting data back into original sequence). See below for $Counter details.

• Suprtool now supports a $Total function which will total a specified field ($subtotal coming soon).

• The Table command now supports filenames up to 80 characters. Previously, the Table command truncated filenames at the limit of 36 characters.

• The number of defines allowed in Suprtool has been increased to 768.

The HP-UX version has the following new features:

• Suprtool for HP-UX now supports environment variable substitution.

• Suprtool has been enhanced to support HP Eloquence 7.0 features. The Base and Put commands have been changed to support new syntax. Suprtool now supports the expanded database limits in HP Eloquence 7.0.

Cleaning Your Data

In this day and age of migrations we were looking at issues that customers have run into when importing data into new databases. What came from this investigation where ways to Clean up your data in any given byte type field.

For example, if an Name field contains a Linefeed character, this will cause an export record to be logically treated as two records by the importing database.

We have added two methods to clean your data: you can use Suprtool to clean an individual byte type field, or STExport to clean all of the byte-type fields for a given file that you are exporting.

Sometimes un-printable or extraneous characters get stored in files or databases that have no business being there. This may be some tab characters in an address field or perhaps and embedded carriage return or line-feed.

There are three things that Suprtool needs to know in order to “clean” a field. Suprtool needs to know which characters to clean, what character it needs to change the “bad” characters to, and also what field does it need to clean.

Defining a Clean Character

The Clean command is used to tell Suprtool what characters it needs to look for in a given byte type field.

For example, clean “^9”,“^10”,“.” will tell Suprtool to replace the tab character (Decimal 9), Line Feed (Decimal 10), and a period to whatever the Clean character is set to.

The Clean command takes both decimal notation and the character itself, however, it is probably most convenient to use the Decimal notation for the characters that you wish to clean. The Decimal notation is indicated by the “^” character.

Setting the Clean Character

By default, Suprtool will replace any of the characters specified in the clean command with a space.

You can specify what character to use to replace any of the characters that qualify with the following set command: >set CleanChar “.”

This will set the character to replace any of the qualifying “to be cleaned” characters to be a period.

Cleaning a Field

You call the clean function, the same way you normally use other functions available to if and extract.

For example, >ext address1=$clean(address1) shows how to clean the field address1. You do not necessarily need to have the target field be the same as the source field.

>def new-address,1,30

>ext new-address=$clean(address1)

An example of cleaning your data

An example of how easy it would be to clean your database of certain “bad” characters in byte-type fields would be as follows:

>base mydb,1,;

>get customer

>clean “^9”,“^10”,“^0”,“^7”

>set cleanchar “ ”

>update

>ext address(1) = $clean(address(1))

>ext address(2) = $clean(address(2))

>ext address(3) = $clean(address(3))

>xeq

The above task will look at the three instances of address and replace the tab, linefeed, null and bell characters with a space.

STExport

This same feature has been added to STExport, except that STExport will automatically clean all the byte type fields for a given SD file. The commands are very similar, except STExport just needs to know what the replace character should be and what characters it needs to look for.

$in mysdfile

$clean “^9”,“^10”,“^0”,“^7”

$set cleanchar “ ”

$out myexport

$xeq

Since the Cleanchar is by default set to space, the above task could simply be:

$in mysdfile

$clean “^9”,“^10”,“^0”,“^7”

$out myexport

$xeq

$counter Function

For years Suprtool has had the ability to output a unique record number to each entry of an output file with the num option of the output command:

>in mysdfile

>out myfile,num,data

Many users used this to return the data to the original retrieved order after doing some other sorts or data manipulation. The above would generate an output file called myfile.

However, you would lose the SD information and you can only put the number at the beginning or the end of the data. Suprtool now has a $counter function that allows you to place a counter at any spot in the record, as well as preserve the SD information.

>in mysdfile

>def mycount,1,4,double

>ext field1

>ext field2

>ext mycount=$counter

>ext field3

>ext otherfield

>out myfile,link

>xeq

The file myfile will be self-describing (meaning that you can feed it to Suprlink and STExport with the structure information intact) and it will contain the fields field1, field2 and mycount.

The field mycount is defined as a double integer, since this is the only field type that the $counter function can use. The mycount field in each record will have a unique ascending number starting with one.

To request a test copy of Suprtool 4.6.02 for MPE or HP-UX, please contact Neil Armstrong at neil@robelle.com

 


Copyright The 3000 NewsWire. All rights reserved.