HPlogo Getting Started with HP IMAGE/SQL: HP 3000 MPE/ iX Computer Systems > Chapter 5 IMAGE/SQL Tasks

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 an ASCII file, ATCLOG, which you can read and edit. You can change log files within 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

   {{Log File            : DOATTACH.PUB.TURBONM}}



   *** Database is not attached.

   >>

The MUSIC database is then attached to the MusicDBE DBEnvironment:

   >>SET TURBODB MUSIC.PUB.TURBONM

   >>SET SQLDBE MUSICDBE.PUB.TURBONM

   >>ATTACH

   >>

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

   DISPLAY OPTIONS

   SET TURBODB MUSIC.PUB.TURBONM

   SET SQLDBE MUSICDBE.PUB.TURBONM

   ATTACH

To close this log file and write to a new one, issue another MPE/iX FILE command from within 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     : MUSIC.PUB.TURBONM

   Set Sqldbe      : MUSICDBE.PUB.TURBONM

   Echo            : ON

   Command Logging : ON

   {{Log File        : UPDATYPE.PUB.TURBONM}}



   *** 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 ALBUMS.DATERECORDED TO CHAR(20)

   Updated information in table ALBUMS.

   >>

the log file, UPDATYPE, contains the following commands:

   DISPLAY OPTIONS

   UPDATE TYPE IN ALBUMS.DATERECORDED TO CHAR(20)

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 (see Task Reference).

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

  • The section "Setting IMAGE/SQL File Equations" in this chapter contains more information about issuing IMAGE/SQL file equations.

  • The section "Using IMAGE/SQL Utility Command Files" in this chapter 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