Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inside Module 1 Introduction to Suprtool Page What is Suprtool? 3

Similar presentations


Presentation on theme: "Inside Module 1 Introduction to Suprtool Page What is Suprtool? 3"— Presentation transcript:

1 Inside Module 1 Introduction to Suprtool Page What is Suprtool? 3
A picture of how Suprtool works 7 Running Suprtool 9 Doing some basic Suprtool tasks 10 Redoing commands 16 Getting on-line Help 18 Entering commands 20 Vocabulary 24

2 What is Suprtool? It is a software tool for the HP 3000 and HP 9000
It extracts data quickly It does many data processing functions for files and databases: copies, selects, and sorts, reformats, prints It links data from several files into one It provides FAST serial processing of “flat” files, KSAM files, TurboIMAGE, Oracle, Allbase and Eloquence databases Suprtool provides fast batch reporting on your HP 3000 and HP With Suprtool, you can select records from an flat file, keyed file, or database file to feed into your report program. Suprtool reads TurboIMAGE and Allbase databases on the HP 3000, and Eloquence, Oracle and Allbase databases on the HP 9000. Suprtool performs best when you are selecting less than 50% of the entries. Once selected, you can rearrange and sort them, or calculate a total. Your report program then needs to read only the subset of qualified records. Suprtool solves many other common problems and routine data processing tasks that normally would require programming, such as archiving and deleting old transactions, checking the total amount of a day’s transactions, or verifying that the debits and credits balance out to zero. Suprtool is often used as a simple report writer, though it may be described more accurately as a “data dumper” or “record printer” than “report writer”. In Suprtool jargon, a “flat” file is any disc file with fixed-length records. It is called flat because it has no built-in indexing or structure. On the HP 3000 we often call these “MPE files”.

3 What is in Suprtool? Suprtool has six components on MPE and four on HP-UX: 1. Suprtool - main program 2. Suprlink - linking program 3. STExport - exporting program 4. Dbedit - TurboIMAGE editing utility (MPE only) 5. Speed Demon - TurboIMAGE extracting routines (MPE only) 6. Suprtool2 - interface routines Documentation on web site. Suprtool Provides fast serial processing of database, flat, and keyed files Suprlink Allows you to access and link multiple files and datasets STExport Converts fields in a self-describing input file into an output file that can be imported to other applications and databases Suprtool2 Interfaces between Suprtool and other user-written programs. Dbedit Allows you the convenience of interactively editing records in TurboIMAGE databases (MPE only) Speed Demon Reads through a TurboIMAGE dataset very quickly (5 times faster) (MPE only) Documentation Manuals available as from web site in pdf and in HTML Help formats

4 Why use Suprtool? It’s speedy
It has powerful, easy to use command syntax It maximises machine resources Its simple commands mean FAST programming It integrates well with other tools It has powerful reformatting functions Suprtool powerful command syntax means that its easy to perform relatively complex tasks with a few simple commands. Why write hundreds of lines of COBOL source when a handful of Suprtool commands will do the job?

5 Why is Suprtool/iX so much faster?
Traditional reports gather information in an inefficient way Suprtool uses serial scans to retrieve records in the order they are stored on the disk Suprtool sorts data more quickly than the system sort Suprtool can quickly extract, sort, and merge information from many sources Reports When reports retrieve information, they may take the first order number from one dataset, link it to the name in the customer dataset, the street and city in the address dataset, the products in the line-item dataset etc. Then for the next order number, the report jumps all over the system again. Suprtool Suprtool on MPE uses multi-record unbuffered serial scans that permit it to retrieve a large number of records with each disc read. This can reduce the number of disc accesses by up to 90%. There are a number of factors that contribute to Suprtool/iX speed: MR NOBUF I/O, pre-fetching data with the MPE/iX Transaction Manager (XM), optimized sort algorithms, and optimized execution paths.

6 Some Suprtool Commands
Process Suprtool Commands BASE, GET, INPUT, CHAIN, OPEN, SELECT Specify source of records Select records IF, TABLE, CHAIN Sort the selected records SORT, KEY Save this page: fold the corner, mark it with a post-it. This is the best page in the entire course. This page is a handy reference to the commands that perform the various functions in Suprtool. And it shows the sequence of operations inside Suprtool. This can also be used as a reference as to how to think about writing Suprtool code for your tasks. Specify fields for output EXTRACT Other optional steps DELETE, DUPLICATE, TOTAL,CLEAN Define destination of records OUTPUT, PUT, LIST, UPDATE, ADD

7 What is a task? A task is Suprtool’s basic unit of work
A task has one source of records and one destination for output records A task is executed using the XEQ or EXIT commands A task can be canceled or reset by using the RESET or EA commands The job you are doing may require multiple tasks This is what a task does: 1. Copies records from one file to another 2. Processes the data (record selection, sorting, extracting certain fields to the output file) Canceling or changing a task Use the Reset command to cancel any previous Sort, Key, If, Delete, and List commands. You can reset more than one command by separating them with a comma or space. The Reset All command cancels all input and output commands. It closes databases and files, and resets everything to initial conditions, except options with the Define, Item, and Set commands. You can use the Exit Abort command to quit Suprtool without executing the task. You can use Suprlink to combine the output from multiple Suprtool tasks into one composite file.

8 Getting into Suprtool To get into Suprtool for MPE, you simply use the RUN command :run suprtool.pub.robelle To get into Suprtool for HPUX you simply type: /opt/robelle/bin/suprtool When you invoke Suprtool, it first shows you its version number. This is important information if you ever have to report a problem! On MPE it also prints the hint of the day. Suprtool displays a greater than (>) sign , which is the Suprtool prompt, and tells you that Suprtool is ready for you to type a command.. You must press Return after typing each command. You may have a shortcut, UDC or command file to make it easier to run Suprtool. E.g., :SU On HP-UX you can put /opt/robelle/bin on the PATH

9 Copying an entire dataset to a file
Use the BASE command to access a database and copy dataset to a file >base store,5,reader >get d-sales >output salesout >xeq By default, Suprtool creates a new output file > Suprtool prompt Base Tells Suprtool which database to open Get Tells Suprtool which dataset to copy Output Creates an output file Xeq Performs this task Works on MPE with Turbo-Image databases and also on HP-UX with Eloquence databases. See the next slide for an example of selecting only some of the records.

10 Copying a subset of records to a file
Use the IF command to select records from a dataset >get d-inventory >if on-hand-qty < 5 >list standard >output testfile >xeq Get Selects the specified d-inventory dataset If Selects records whose on-hand-quantity field has a value of less than 5 List Standard Produces a formatted listing of records Testfile Assigns a filename to the output. If this filename already exists, Suprtool prompts you to purge the old file. Xeq Performs this task Abbreviations for Commands Most command names can be abbreviated to the fewest number of letters that uniquely identifies them. These are some examples: BAse, Before, Define, DELete, DO, DUplicate, EDit, Exit, EXTract. All the abbreviations are shown in the Suprtool Quick Reference Guide and the Suprtool User Manual. You must have done a Base command first, to be able to use the Get command.

11 Looking at the contents of a file
You can look at any file using INPUT and OUTPUT Beware of unprintable characters >input lowstock >output * >xeq 159 , , , , ,94.49 133 , , , , ,80.59 138 , , , , ,41.53 107 , , , , ,146.39 111 , , , , ,128.99 IN=5, OUT=5. CPU-Sec=1. Wall-Sec=1. Input Selects the Lowstock file as the source of records Output * Sends the output to your terminal or job $stdlist Garbage When you use Output *, you need to know that non- ASCII printable characters in the file may look funny. This may include data not lining up properly, strange characters appearing on the screen, or the terminal beeping and doing other weird things. If that happens, use the List command’s Char option instead of Output *.

12 Exercise Copying the m-customer dataset
Open the Store database and copy the m-customer dataset into a file called Custfile: > base store,1,WRITER > get m-customer > output custfile > xeq Then look at the contents of Custfile > input custfile > list > xeq Repeat, but create a “link” file: > output custfile,link In addition to Output *, try these commands: List List Char

13 First Rule of output: “Unless you have a really good reason not to, always make your output files self-describing” > output myfile,link When you’re working with data files, its always better if Suprtool “knows” the structure and fieldnames, and the easiest way to keep this information with the data, is to use self-describing files. This means that you can use Suprtool’s LIST command to examine the data without having to redefine the fields first. On MPE, Suprtool uses the file labels to store the file “layout” information. On HP-UX, Suprtool creates a file with a “.sd” extension. On both MPE and HP-UX, the form <filename> command will list the structure of the data. On HP-UX it is a good idea to create a command file that deletes both the data file and the “.sd” file. We call ours delfile, you could call yours purge <filename>, which will mean your Suprtool code could easily port between the two systems. Here is the command file we use: #!/bin/sh # delfile: command file to "purge" files. We do this without # printing any warning about the file being missing. filename=$1 if [ -f $filename ]; then rm $filename fi if [ -f $filename.sd ]; then rm $filename.sd

14 Getting out There are 4 ways to complete a task:
XEQ - executes task, remains in Suprtool EXIT- executes task, exits Suprtool, suspending if possible EXIT ABORT (EA) - cancels task, terminates and exits Suprtool EXIT SUSPEND (ES) - puts task “on hold”, suspends and exits Suprtool Historical Note Suprtool started out as a plug-compatible replacement for SORT/ It was originally called Suprsort and supported only the most common SORT/3000 commands (i.e., Input, Output, Key, and End or Exit). There was no Xeq statement in SORT/3000; the Exit command signaled the end of the commands and the beginning of the sort operation. So Suprsort (now Suprtool) used the Exit command to mean “Exit after doing the task I just described.” On HP-UX you cannot currently suspend Suprtool.

15 Redoing a task A task can be easily corrected and repeated if a mistake has been made Use these commands to avoid retyping long lists of commands: LISTREDO REDO DO BEFORE MPEX abbreviations >do if >if on-hand-qty < 5 > Listredo Shows the commands in a Redo stack Redo Pulls previous commands out of the Redo stack Allows you to change the command and repeat either the command or the complete task. Without parameters, Redo just repeats the last command you typed. Redo uses the following shortcuts: D for delete, R for replace, I for insert, U for undo, > to append to the end, >D to delete from end, >R to replace from the end, D> to delete from current position to the end, and C to change (e.g., c\xx\yyy to change xx to yyy). You can use a string parameter to search backward in the stack of commands for the most recent match. Do Repeats commands but without any changes It can pull out any command from the Redo stack by absolute or relative line number, or by searching backward. It can even repeat a set of commands. Before Identical to Redo except that it uses Qedit-style editing: Control-D for delete and Control-B for insert. If you want more than 1,000 commands in your MPE Redo stack, you must do a :File command on the Suprredo file before running Suprtool.

16 Do, Redo, and Listredo DO re-executes the last command or any prior command, as-is REDO re-executes the last command or any prior command after making changes to the command LISTREDO List some prior commands, to the screen or to a file Useful for saving work to a file that may become a script >do >do 5/10 >redo in >listredo all;unn;out=savefile If you execute Suprlink from inside Suprtool with the Link command syntax, the Suprlink commands will also be in the Suprtool Redo stack.

17 Getting on-line Help Try these Help keywords to access the user manual: Help Help Intro Help News HQ HQ List Press “+” to show the Help tree, which lists Help keywords hierarchically Help Help introduction and list of keywords Help Help Syntax of Help Help Intro Help introduction Help News What is new in Suprtool HQ Help Quick HQ List Help Quick for syntax summary While you’re in Help Keywords May be abbreviated Return or ^ Exits back to the previous level F8 Exits Help, returns to Suprtool ? Explains Help commands + Shows the Help tree of a keyword. For example, >help exit {displays Exit command information} ?+ {displays the following Exit Help tree} EXIT ABORT(13) EXAMPLES(13) SUSPEND(8) EXAMPLES(17) Stringing keywords together with commas helps you move faster through Help (e.g., Help Apply, Image).

18 Command conventions No command line may be over 256 characters
Separate multiple commands on the same line with semi-colon ; Continue a long line to the next line by ending it with ampersand & Append comments to commands using braces {comment} >base store,5,reader {read access only} >get d-sales; item deliv-date,date,yyyymmdd >if deliv-date < $today(-30) and product-no = ,& >>234567,345678

19 Execute sequences of commands - Use
Save a set of commands in a file Use the file to execute all the commands Create usefiles of DEFINE and ITEM commands for datasets and flat files Create usefiles with LISTREDO Suppress listing the commands with USEQ Suprmgr.Pub.Sys or /opt/robelle/suprmgr are always used at startup Use files can be “nested”

20 Set and Verify options Enable or disable processing options using SET
Check the current state of affairs using VERIFY Put SET commands for all tasks in Suprmgr files

21 Using OS commands within Suprtool
If Suprtool and the OS do not have the same command name, a leading colon is optional with OS commands. For example, >:showtime is equivalent to >showtime {only MPE} >:reset is not the same as >reset {MPE and Suprtool} OS commands cannot be abbreviated On MPE, you can execute :Run, Command Files, and User Defined Commands (UDC) inside Suprtool No more OS commands can be executed in Suprtool after the SET LIMITS MPE OFF command On HP-UX, you may precede OS commands within Suprtool with either a colon (:) or an exclam (!). And, as on MPE, the special character is optional when there is no overlap between the OS command and Suprtool commands. Warning: on HP-UX, shell commands cannot change environment variables that are accessible to Suprtool. This is because the shell commands are executed by a child process. You must exit from Suprtool in order to change an environment variable such that Suprtool can read it.

22 Run Suprtool on MPE Parm=4; Info="use foo.defs" Execute Info string once at startup UX: -c“use foo.defs” Parm=8; Info="use doit" Execute Info string upon each re-activation Parm=16 Copy the input file to the output file Parm=32 Terminate completely; don’t suspend Parm= UX: suprtool -v Check with user before exiting Both Suprtool./UX and Suprtool/IX have command line options to start the program in special ways. On HP-UX, use -c to execute a command line and -v to verify before exiting. On MPE, use PARM= values and INFO=. One special MPE option is Parm=16, to make a UDC or command file similar to the MPE/iX COPY command: USER DEFINED COMMAND FILE: DUP.CMD.ROBOPS parm in, out comment this udc copies a file quickly. file input=!in file output=!out run suprtool.pub.robhome;parm=16 reset input reset output

23 Running Suprtool for HP-UX
Options entered in normal HP-UX conventions suprtool [-cv -oc ] -c”use usefile” -v {Verify exit } -oc { sets .stoutcount } if [ `cat .stoutcount` -ge 10 ]; then echo “More than 10 records found” fi The -c option allows for a command string to be specified, there must be no space in between the -c and the command list. The -v option tells Suprtool to verify that you wanted to exit. The -oc option allows you to test how many records have been processed.

24 Quick Vocabulary database LIST dataset OUTPUT EXTRACT REDO EXIT record
file SORT GET task IF XEQ Database A database in Suprtool is a TurboIMAGE/3000 database, Eloquence database, or an Oracle or Allbase SQL database Dataset A file within an IMAGE or Eloquence database Extract Extract data or constants from the input Exit Execute the current task, then terminate File A flat file or disc file Get Read input from an IMAGE or Eloquence dataset If Conditional selection of records List List the output records Output Specify the output filename Redo Repeat last command Record A collection of related fields Sort Rearrange order of records based on values in key field Task A unit of work Xeq Execute the current task, but do not exit Suprtool

25 Summary Six Suprtool components on MPE four on HP-UX
Documentation and helpful web site. Fast processing Edit data interactively on MPE Basic Suprtool tasks On-line Help


Download ppt "Inside Module 1 Introduction to Suprtool Page What is Suprtool? 3"

Similar presentations


Ads by Google