HPlogo IMAGE/SQL Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 2 Using the IMAGE/SQL Utility

Task 13: Logging IMAGE/SQL Utility Commands

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

This task describes how to log IMAGE/SQL utility commands and how to save frequently used command sequences in different log files so they can easily be reissued in batch or interactive mode.

Performing the Task

By default, IMAGE/SQL utility commands are logged to the ASCII file ATCLOG, which you can read and edit. You can change log files within the IMAGE/SQL utility by issuing a file equation for ATCLOG. For example, to rename and save the IMAGE/SQL utility log file as a permanent file, set a file equation for the ATCLOG file before the

IMAGE/SQL utility is run:

   :FILE ATCLOG = DOATTACH; SAVE

   :

When the IMAGE/SQL utility is run, the DISPLAY OPTIONS command confirms that commands are being logged to DOATTACH.

   >>DISPLAY OPTIONS

   Current base          :

   Current SQLDBE        :

   Echo                  : ON

   Command Logging       : ON

   Current Log File      : DOATTACH.SERED.ATC



   *** Database is not attached.

   >>

The SALES database is then attached to the PartsDBE DBEnvironment:

   >>SET TURBODB SALES.SERED.ATC

   >>SET SQLDBE PARTSDBE.SERED.ATC

   >>ATTACH

   >>

After the attach, the contents of the log file DOATTACH look like this:

   DISPLAY OPTIONS

   SET TURBODB SALES.SERED.ATC

   SET SQLDBE PARTSDBE.SERED.ATC

   ATTACH

To close this log file and write to a new one, issue another MPE/iX FILE command from within the IMAGE/SQL utility. For example:

   >>:FILE ATCLOG=UPDATYPE;SAVE

   >>

The DISPLAY OPTIONS command confirms that commands are now being logged to UPDATYPE:

   >>DISPLAY OPTIONS

   Set Turbodb       : SALES.SERED.ATC

   Set Sqldbe        : PARTSDBE.SERED.ATC

   Echo              : ON

   Command Logging   : ON

   Current Log File  : UPDATYPE.SERED.ATC



   *** Database is attached.

Any IMAGE/SQL utility commands now issued are written to UPDATYPE. For example, when the following command is issued,

   >> UPDATE TYPE IN CUSTOMER.CREDIT_RATING TO CHAR(4)

   Updated information in table CUSTOMER.

   >>

the log file UPDATYPE contains the following commands:

   DISPLAY OPTIONS

   UPDATE TYPE IN CUSTOMER.CREDIT_RATING TO CHAR(4)

Using this technique, you can create several files containing often-used IMAGE/SQL utility commands. The commands in these files can then be executed using the XEQ command.

Log files can be edited with a text editor. (Be sure to keep the edited file unnumbered or it cannot be used as a command file.)

NOTE: Many editors automatically insert an end-of-file marker at the end of the text in an edited file. This prevents the file from having log records appended to it. For this reason, if the original file is to be used as a log file, you should keep the edited file under a different name.

Task Reference

  • Task 12, "Setting IMAGE/SQL Utility File Equations," contains more information about issuing IMAGE/SQL utility file equations.

  • Task 14, "Using IMAGE/SQL Utility Command Files," contains more information about using the IMAGE/SQL utility XEQ command interactively or in batch to execute IMAGE/SQL utility commands.

  • When an IMAGE/SQL utility session begins, logging is on. The temporary file ATCLOG is created (if it does not already exist) and opened in the user's logon group and account. If the log file already exists as a temporary or permanent file, log records are appended to it.

  • If you want to save the temporary file, either save the file before ending your current MPE/iX session or specify ;SAVE as a part of the FILE equation.

  • The FILE command can be used to override default ATCLOG file attributes, such as size and file domain. However, the log file must remain an unnumbered ASCII file.

Feedback to webmaster