Putting SQLThing's Procedures on your AS/400

 


SQLThing comes with several stored procedures that it uses to manipulate the AS/400 job log.  If you do not install the stored procedures, you will not be able to use the SQLThing Job Log Viewer.  Installing the stored procedures requires creating a library, restoring a save file and registering the stored procedures.

First, log into the target AS/400 and create a library that will hold the SQLThing procedures.  It is recommended that you call the library SQLBOOK as this is the product default, but you may name the library anything you desire.

Once the library is created, create a save file in the library with the CRTSAVF command.  Name the save file SQLBOOK.

Now, start a command prompt in windows and navigate to the directory where SQLThing was installed on your computer.  By default, this is the \Program Files\SQLThing Enterprise\ directory.

Start FTP and connect to your AS/400. Change to the library you have created using the CD command.  If your library is SQLBOOK, you would change to that library by typing CD SQLBOOK.

Type in BINARY and press enter to change the FTP program into binary transfer mode.

Using the put command, send the save file to your AS/400.  This can be accomplished by typing PUT SQLTHING.SAVF.

Log out of FTP, (using the bye command).

Back in a terminal session connected to the AS/400, use the RSTOBJ command to restore the objects from the save file into the SQLTHING library.  Here is sample syntax for the RSTOBJ command:

RSTOBJ OBJ(*ALL) SAVLIB(SQLBOOK) DEV(*SAVF) 
	SAVF(SQLBOOK/SQLTHING) MBROPT(*ALL) ALWOBJDIF(*ALL) RSTLIB(SQLBOOK)

The objects are now available for use, and need only be registered as stored procedures. In the install directory, default C:\Program Files\SQLThing Enterprise\, you will find two SQLP files. The SQLP extension indicates a stored procedure file.  Once you have completed setting up an ODBC Data source, detailed in the next section, you can start SQLThing and use the Procedure Editor to execute the procedure definitions in these files.  These procedure definitions will make the stored procedures available to SQLThing for displaying your job log.

Steps for declaring the procedures

  1. Start SQLThing and log into the iSeries box where you restored the procedures. 
  2. Use the Tools menu and select Procedure Editor
  3. Use the File menu and Open the file CSDRJOBM.SQLP. This file contains the definition of the procedure that returns details/help for a single job log message.
  4. Click on the Editor tab to ensure the procedure editor is in focus and then use the Procedure menu and select the Compile option. This will cause the procedure to be declared on your iSeries.
  5. Use the File menu and Open the file CSDRJOBL.SQLP. This file contains the definition of the procedure that returns a list of job log messages.
  6. Click on the Editor tab to ensure the procedure editor is in focus and then use the Procedure menu and select the Compile option.  This will cause the procedure to be declared on your iSeries.

Exit SQLThing.  The next time you start SQLThing and connect to this iSeries, you should be able to use the job log viewer.