HP 3000 Manuals

Saved Tables [ Information Access Server: Database Administration ] MPE/iX 5.0 Documentation


Information Access Server: Database Administration

Saved Tables 

Here we discuss ways the PC user can save a "result table" on the host
and how such tables are managed and recovered.

Saving PC Result Tables on the Host 

Typically, your PC users will be saving tables (local or remote) on the
host HP 3000 for later use in Access PC. While the PC user works with the
table, it's called a result table.  When the PC user saves the result
table as a  Remote Saved Table, it then appears on that PC user's Remote
Tables screen with the label Saved.  We refer to such tables as saved 
tables.

There are, however, five other ways of saving remote table information on
the host HP 3000:

   *   As DIF files, for subsequent work using Deluxe VisiCalc/3000.
       (The PC user can also convert the information into DIF format for
       use in VisiCalc on the PC.)

   *   As SD (self-describing) files, for use in such HP 3000
       applications as HP Listkeeper and DSG/3000.

   *   As ASCII files, perhaps for inclusion in an edited document on the
       host, using EDIT/3000, TDP/3000, or HP Word.

   *   As binary files, which contain data as it appeared in its original
       file source.  This data can be used as input to application
       programs.

   *   As BRW/IRF files, for use in Business Report Writer.

Saving Information as an ASCII File.   

Table information saved as an ASCII file is saved in the user's current
group and account on the host HP 3000.  The record length of the file is
132 bytes (characters).  Here's an example drawn from the sample
databases used in the tutorial in the Information Access:  Learning the 
Administrator Utility manual:

       Output file : ZZZZZ.PUB.SYS  Date : TUE, MAY 6, 1986, 5:23PM

       ACCOUNT   SALES-REP             PRODUCT-NBR  ORDER-DEPOSIT
       -----------------------------------------------------------
       AB8801    Len Croley            PAP001        001000.00
       OM988     Ellen Ashcraft        PAP008        000700.00
       LN9870    Fred Waters           PAP009        000050.00
            

Line 1 of the file gives the file name, group, and account, and the date
and time the file was saved.  Line 2 is blank.  Line 3 gives the item
names as column headings.  Line 4 contains dashes.  Line 5 is blank.
Each remaining line in the file contains one record.

The minimum width of a column is the length of the item name, while the
maximum width is the length of the field itself.

If the length of the formatted record exceeds 132 bytes, the remainder of
the record "wraps around" to the next line of the file.  Suppose, for
example, that there were several columns intervening between ACCOUNT and
SALES-REP, and that the separator after SALES-REP was the 128th byte.
The file would then be formatted like this:

         ACCOUNT   . . . . . . . . . . . . .  SALES-REP
         PRODUCT-NBR  ORDER-DEPOSIT
         ---------- . . . . . . . . . . . . . -------------------

         AB8801    . . . . . . . . . . . . .  Len Croley
         PAP001        001000.00
         OM988     . . . . . . . . . . . . .  Ellen Ashcraft
         PAP008        000700.00
         LN9870    . . . . . . . . . . . . .  Fred Waters
         PAP009        000050.00
            

Fields are not split by the wrap-around feature.  In this example,
PRODUCT-NBR would ordinarily have begun at the 130th byte, but instead,
it and its corresponding entries are moved forward to the next line.

If two lines are not sufficient to contain all of the information in the
formatted record, wrap-around will occur again.

No information is lost in this format.  Of course, if you print such a
file to a printer that only prints the first, say, 78 bytes of each line,
then the remainder of each line, beyond the 78th character, will be
truncated.

Saving Information as a Binary File.   

The binary file output option is available from Access PC or the Host
Batch Facility and can be used on any file table.  The structure of the
output file will match that of the table exactly as shown in the Show
Items screen in the Administrator Utility.  The original data types are
used, not the converted data types.  These data types include integer
(I1, I2, I3, and I4), real (R2 and R4), packed, zoned, logical,
free-format numeric, and character.

Numeric types, however, can be converted to other types by performing
arithmetic operations on the item.  The following table shows how you can
convert numeric types to I2 type, R4 type, and in one special case, to
packed type.

          Table 12-1.  Numeric Type Conversion 

-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
|   Source Data Type    |      Result Type      |                       |                       |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
|                       | I2                    | R4                    | P                     |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| R (2 or 4)            | DIV 1                 | * 1.0                 | n/a                   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| Pn                    | DIV 1                 | * 1.0                 | No change necessary   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| Zn                    | DIV 1                 | * 1.0                 | *1                    |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| N                     | DIV 1                 | * 1.0                 | n/a                   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| I1                    | DIV 1                 | * 1.0                 | n/a                   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| I2                    | No change necessary   | * 1.0                 | n/a                   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------
|                       |                       |                       |                       |
| I3/I4                 | DIV 1                 | * 1.0                 | n/a                   |
|                       |                       |                       |                       |
-------------------------------------------------------------------------------------------------

For example, to convert the item ''SALES (an N type) to an R4 type, you
specify the following in the Item Clause of a view table or the SELECT
clause of an SQL statement:

           R4-SALES = SALES * 1.0 

Or, if you wanted to convert the item SALES (an R4 type) to an I2 type,
you specify the following in the Item Clause of a view table or the
SELECT clause of an SQL statement:

           I2-SALES = SALES DIV 1 

You can also define a view table using complex structures (such as the
SUB function, JOINs, concatenation, Where Clause specifications, and so
on) and output the data from these tables to a binary file.  This file
will contain the dataas it appeared in the original data source, except
for any further manipulation performed in the view table.  All of the
data types are kept in their original form.

For more information on placement of output fields for binary file
output, see "Adding a View Table Definition" in Chapter`5.


NOTE If an error occurs in a packed or zoned field, Access Server will set all bits (hexFF) for each byte in the field. This is an invalid value for a packed or zoned field. (The Synchronization feature would flag such a value.) Any program reading the file should have significant error handling capabilities to prevent the job from aborting.
Saving Information as a BRW/IRF File. Information Access can create BRW/IRF files that can be fed into Business Report Writer reports. Information Access supports BRW version A.01.30 or later. Saved Versus Configured Tables Saved tables differ from configured tables in four ways, as shown in the following table: Table 12-2. Configured versus Saved Tables ---------------------------------------------------------------------------------------------- | | | | | | Configured Tables | Saved Tables | | | | | ---------------------------------------------------------------------------------------------- | | | | | Data comes from: | Host or remote systems | PC, host, or remote systems | | | | | ---------------------------------------------------------------------------------------------- | | | | | Data is current: | At the time of access (DBA | At the time of the save | | | defines its structure; user | (data dictionary saves its | | | works with a temporary file | structure; an encrypted, | | | created on access) | privileged file in | | | | PPCSAVE.HPOFFICE saves its | | | | data) | | | | | ---------------------------------------------------------------------------------------------- | | | | | Can be accessed by: | Any user in access groups | Only the user who saved it, | | | assigned to it (or by all | whose Remote Tables screen | | | users if a public table) | is the only one it appears | | | | on (a command file on the HP | | | | 3000 can use the RELEASE | | | | command to allow access by | | | | other users) | | | | | ---------------------------------------------------------------------------------------------- | | | | | Controlled by: | DBA (but users in access | User (primary DBA sets table | | | groups with capability 2 or | and sector limits when | | | 3 can add IMAGE tables) | defining each user) | | | | | ---------------------------------------------------------------------------------------------- An example will clarify these points. Suppose USER9 performs a query on TABLE7 and saves the result table as SAVEDTABLE1. The next time USER9 (but not USER7 or USER8) returns to the Remote Tables screen, four table names will appear instead of three, as in the following figure:
[]
Figure 12-1. When a PC User Saves a Result Table USER9 is identified as the sole owner of SAVEDTABLE1. No other user will see SAVEDTABLE1 named on the Remote Tables screen, and no other user will be able to access it. Whenever USER9 goes to the Remote Tables screen, SAVEDTABLE1 will contain precisely the same data it contained when USER9 saved it (because it was kept in a T-file). But TABLE7, from which it is derived, will contain current data (because its contents are brought in from the database each time the table is accessed). Restoring Saved Tables from a Backup Tape When a user saves a table, Access Server adds an entry to the data dictionary and saves the contents of the table as a privileged MPE file with the name Txxxxxxx.PPCSAVE.HPOFFICE, where Txxxxxxx is a unique alphanumeric name based on the date and time the file was created. When a saved table is deleted (by the PC user in Access PC, or by the primary DBA using the Delete Saved Table screen), both its definition and its T-file are deleted. As a consequence, whenever a backup version of Access Server is restored to the system, it is essential that the group PPCSAVE.HPOFFICE also be restored from the same backup tape. Otherwise, there can be T-files without corresponding saved table definitions, and saved table definitions without corresponding T-files. To put it simply, the groups PPCSAVE.HPOFFICE and PPCDICT.HPOFFICE (which contains the data dictionary) must always be restored together. T-Files and Saved Table Definitions To keep T-files coordinated with saved table definitions, Access Server checks that they correspond whenever you run the Administrator Utility with PARM=1 or PARM=2 (that is, whenever you enable or disable Access Server). If a definition exists without a corresponding T-file, Access Server lists the saved table, the user, and the missing T-file. You can then either restore the missing T-file from a backup tape or delete the saved table using the Delete Saved Table (DS) screen. If a Saved Table is Deleted By Mistake One final note: If a user mistakenly deletes a saved table, there is no way to restore that particular saved table. Restoring Access Server from a backup tape would lose all work previously performed by you and your users. The user's only recourse is to regenerate the table using Access PC.


MPE/iX 5.0 Documentation