What is Suprtool?
Suprtool is a data extraction product that runs on the HP 3000 (MPE) and HP 9000 (HP-UX).
Sample SuprtoolCode
base store,1,; {opens the database }
get d-inventory {opens a dataset/table}
if item-qty >=0 {some selection criteria}
out myinv,link {output to file with self-describing format }
exit {do the task}
Writing good Suprtool Code
Suprtool is not only a database tool, but is also a language. Like any "programming" language there are things you can do to improve the readability of the scripts you are writing.
Suprtool does very little work when accepting commands. It does syntactic checking and some semantic checking of the commands, but Suprtool does very little work until you "xeq" the task or exit. (The Table command is the exception to this rule as it may have to read and sort a file to fill the table!)
Here is some sample bad code (although it is syntactically correct, the ordering of the commands does not make the logic clear):
base mytest,5
table mytable,order-number,file,myords
get mydataset
item order-date,date,ccyymmdd
output myfile,link
sort order-number
ext order-number
if order-date=$today(-1) and $lookup(mytable,order-number)
sort order-date
ext order-quantity,order-ctgy
ext order-description
ext order-dollars
ext order-tax
xeq
exit
- Source of Records
- Selection of records
- Order of records
- Fields for output
- Optional Steps
- Destination of records
In the Suprtool course there is one slide that I always tell student to mark as the most important slide in the course, as it clearly outlines the commands and what they are for. So applying this slide to the previous code we would get the following:
base mytest,5
get mydataset
table mytable,order-number,file,myords
item order-date,date,ccyymmdd
if order-date=$today(-1) and $lookup(mytable,order-number)
sort order-number
sort order-date
ext order-number
ext order-quantity
ext order-ctgy
ext order-description
ext order-dollars
ext order-tax
output myfile,link
exit
base mytest,5
get mydataset
def order-total,1,4,double
table mytable,order-number,file,myords
item order-date,date,ccyymmdd
if order-date=$today(-1) and $lookup(mytable,order-number)
sort order-number
sort order-date
ext order-number
ext order-quantity
ext order-ctgy
ext order-description
ext order-total=order-dollars
ext order-tax
output myfile,link
exit