HP 3000 Manuals

Files [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 2 RISE

Files 

The Work File 

RISE performs all of your editing commands on a work file.  The File and
Text commands tell RISE which permanent file you wish to become your work
file.  The work file is a KSAM file (Keyed Sequential Access Method), and
is used so that RISE can quickly random access your source records.  (See
the KSAM/3000 Reference Manual for more information on this file
organization.)

The name of the work file is in the form Wdddhhmm, where "ddd" is the day
of the year, "hh" is the hour of the day, and "mm" is the minute of the
hour.  The name of the associated key file is WKddhhmm, where "K"
overlays the first "d" in the day of the year, and "ddhhmm" have the same
meaning as they do with the work file.  If there is an existing file with
the same name, RISE will increment the last digit.

RISE automatically supplies sequence numbers to the KSAM work file in
columns 81-88 if none already exist.  These sequence numbers serve as
search keys when RISE accesses the KSAM work file.  In your command
parameters you specify which source lines you want to work on.  For
example "LIST 1/10" will list to the screen the source lines whose
seqence numbers are included in the range 1 to 10.

The renumber command allows you to manage the sequence numbers.  Note
that the sequence numbers are not associated with the RPG line numbers in
columns 1-5 of your source program.  The sequence numbers are not a part
of the RPG program.

There are several ways in which you may specify which sequence numbers
you want processed.  You may give the precise number, as in "LIST 1/10",
or you may use relative numbers in relation to the current position of
the record pointer.  You may also use the literal specifications FIRST,
LAST, or ALL. More information concerning the specification of sequence
numbers with various commands appears in the command section (chapter 2).

Accessing Files 

When you TEXT your files, your permanent file is copied into a work file
(which is a KSAM file).  It is copied back to a permanent file when you
use the KEEP command.  Using TEXT and KEEP you edit work files only,
bringing them to the screen for editing and storing them as permanent
files when the work is concluded.

The TEXT/KEEP commands provide a safeguard in that the editing done to a
work file is not made permanent until the KEEP is given.  Thus, if
erroneous deletions were made to the work file, you would retain the
deleted lines in the permanent file.  Using the TEXT command you could
copy it back to the work file in its original state for further work at
the terminal.

The price of the safeguard is additional time required to copy the files
back and forth between your permanent file and the RISE work file.  If
your RPG source file is long, the overhead may be considerable.

You can also edit your files directly using the FILE/EXIT commands.  Only
one copy of the file is created with this option.  RISE edits the copy
directly so that no time is wasted.

In using FILE/EXIT you sacrifice your safeguard, however.  You do not
have a permanent copy which can be recalled if, for example, you wish to
restore lines mistakenly deleted.  Changes made to a file called with the
FILE command cannot be rescinded unless you made a backup copy before
editing it.

In general, FILE/EXIT serve best when you are adding to or editing a
large RPG source file.  When your file is small, TEXT/KEEP are
recommended.  Also, for a more efficient use of space, TEXT/KEEP are
recommended for large files that are debugged, complete, and in
production.  Such files rarely need additional editing.  Storage of a
regular sequential file takes less disk space than storage of the same
file in KSAM format because of the extra space consumed storing the
associated key file.

[]
Figure 1-4. RISE Editing Methods


MPE/iX 5.0 Documentation