Suprtool

Dynamic Duo: Suprtool and the Web

You've got a Web server running on an HP-UX or MPE/iX machine. Your users are clamoring to get their data and reports from their Intranet. You remember hearing, "If it's on paper it's dead", so you need to come up with a solution that is dynamic, easy to maintain and implement, cost effective, and alluring. You may already have all the parts to your solution!

The Common Gateway Interface (CGI) feature of your Web server allows you to execute custom programs or scripts, and to dynamically display Web pages. These custom programs and scripts can be written in almost any programming language. Perl is probably the most commonly used language, but you can use C or C++, COBOL, SPL, FORTRAN etc.

Form1

We don't necessarily need Java, ActiveX or any other client-based solutions; we only need Suprtool and some software that came with your HP-UX box. If you are running an HP 3000, you will have to go out and get some freeware, such as Perl and the Apache Web server. You'll also have to learn a little more about HTML (Hyper Text Markup Language) to do some form processing.

We've put together a few examples on our Web pages to show you how Suprtool can run from a Perl script on an HP-UX machine accessing an Allbase database. Because the sample scripts are a few hundred lines long, we decided to leave them on our Web site for you to browse. The URL to check out is http://www.robelle.com/support/examples.html

Here's a synopsis of how the example works. An input form is declared as part of the HTML document This form contains the definitions of radio buttons, text fields, etc., whose values will get sent to the server together with the name of the script that will process the data.

  <FORM METHOD="POST" ACTION="/cgi-bin/sx_orders.pl">
  <input type="radio" name="tablename" 	value="inventory">Inventory
  <INPUT TYPE="submit" VALUE="Send Request">
  </FORM>
Pressing the submit button causes the values of all the input tags to be sent from the client to the server, and then to the Perl script sx_orders.pl as arguments. (The Perl compiler has some great built-in string manipulation routines!) The input data is edited, and the script containing the Suprtool Run/Call/Extract is invoked. In our example, Suprtool opens an Allbase database and dumps a table to a self-describing file. With the simple command HTML TABLE, STExport converts the file into HTML. The Perl script then checks the Suprtool return codes and sets the browser location to the output file, which displays the script's output. Voila!

Form 2

There is a lot more you can do with CGI scripting and Suprtool. You can pass parameters to extract information out of different tables or sets in your database, specify the sort sequence, and vary the selection criteria. And that's not all. All of the things that you have been using Suprtool for on your IMAGE, KSAM and flat file data can now be output n a Web browser. Users can view their reports on the Web, perhaps saving on paper. And you won't even have to write a user interface. Francois Desrochers and Ken Robertson

....Back to the Suprtool Q&A Page