TEXT [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation
HP RPG/XL Utilities-Part 2 RISE
TEXT
TEXT copies a permanent file into a work file for editing.
Form
T[EXT] filename [N[OW]]
Parameter Explanation
filename Name of the permanent file you are copying to the work
file.
N[OW] Your work file contains the contents of one file but you
may wish to TEXT another without saving the contents of
that work file. The contents of the file you wish to
TEXT will not be copied unless you KEEP the current work
file to a permanent file. You can override the need to
KEEP the file by using the NOW parameter. In doing so
you discard your changes. If you are directly editing a
file (using the FILE command) and you give the TEXT
command, the file will be saved (closed) first
automatically, whether you specify "NOW" or not.
If you choose not to use the "NOW" parameter, RISE
displays a safety message asking you if it is all right
to clear the current work file. You may respond with
"Y[ES]" to clear the current file and text in another.
If you respond with "N[O]", the TEXT command is
cancelled so that you may perform a KEEP first if you
wish.
Purpose
The TEXT command copies the contents of a permanent file into a work file
for additions and changes. You make additions and changes to a work file
only, which you save after editing with the KEEP command.
Related Commands
See the discussion of the KEEP command. If the file is unnumbered, RISE
automatically appends the sequence numbers in columns 81-88. If the text
file is already numbered, RISE uses the existing sequence numbers. Text
files are compatible with EDIT/3000 files.
* Execution mode: Line or Block.
* Record pointer: At first line in work file.
Examples
The following are legal abbreviations which may be used with the TEXT
command and its parameters:
T FILE1 N Copy the contents of a permanent file named FILE1 into
the work file immediately, without displaying safety
prompts or saving changes made to the work file.
TEX FILE1 Copy the contents of the permanent file named FILE1 into
the work file, displaying safety prompts if the current
work file has been edited and has not be saved with the
KEEP command.
In the first example, SIMCAL is copied into the work file using the TEXT
command, and an execution message is returned (1). The first five lines
of the file are listed, and then lines 1 through 3 are deleted (2). An
attempt to TEXT SIMCAL with these changes receives a safety prompt (3).
When it is answered negatively, the command is cancelled (4). Next, the
KEEP command is used with the filename BACKUP. Thus, BACKUP without the
three lines, is now stored as a permanent file (5).
(1) >TEXT SIMCAL
Text completed.
>L 1/5
1 00011H
SIMCAL
2 00012FINPUT IP F 72 DISK
3 00013FOUTPUT O F 72 DISK
4 00014IINPUT AA 01 1 CA
5 00015I OR 02 1 CS
(2) >D 1/3
1 00011H
SIMCAL
2 00012FINPUT IP F 72 DISK
3 00013FOUTPUT O F 72 DISK
Delete completed.
(3) >T SIMCAL
KEEP not done, CLEAR current work file?NO
Text cancelled.
(4) >KEEP BACKUP
Keep completed.
(5) File name is BACKUP
In the second example, the CHANGE command is used to replace one
four-character string with another. The results of the command, and an
execution message, are then displayed (1). The TEXT command is used with
the NOW parameter and is executed (2). Note that no safety prompts were
issued even though changes were previously made. When LIST 1/8 is given,
the first three lines are missing from the listed lines because they were
deleted in the first example (3). Next, line 5 is modified (4). The
TEXT command used with SIMCAL evokes the safety prompts because of the
changes made to the file. When the prompt is answered in the
affirmative, the command is executed (5).
>CHANGE ;DISK; TO ;TAPE; IN ALL
2 00012FINPUT IP F 72 TAPE
3 00013FOUTPUT O F 72 TAPE
(1) Changes completed.
>TEXT BACKUP NOW
(2) Text completed.
>
(3) >L1/8
4 00014IINPUT AA 01 1 CA
5 00015I OR 02 1 CS
6 00016I OR 03 1 CM
7 00017I OR 04 1 CD
8 00018I OR 05
(4) >MS
5 00015I OR 02 1 CS
: RAND
5 00015I AND 02 1 CS
:
(5) >TEXT SIMCAL
KEEP not done, CLEAR current work file?YES
Text completed.
>
MPE/iX 5.0 Documentation