BEGIN [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation
HP RPG/XL Utilities-Part 2 RISE
BEGIN
BEGIN allows you to initiate a new editing session as if you had just
entered the RPG Interactive System Environment.
Form
B[EGIN] [N[OW]]
Parameter Explanation
N[OW] If you are editing a work file initiated with the TEXT
command, NOW will cause the command to execute
immediately, and it will disable the safety prompts. If
omitted, and you have made changes to the work file,
RISE will prompt with the following message:
"KEEP not done; CLEAR current work file?"
If you respond "YES", the command will execute, and the
file will be purged. A "NO" will cancel the command.
Purpose
The BEGIN command achieves effects similar to entering an EXIT command,
thus leaving RISE to end the current editing session, and then reentering
RISE to begin a new editing session. If you are editing or adding to one
file and you wish to clear what you have done and start over quickly,
BEGIN will save time and add convenience. If the file you are editing
was initiated with the FILE command, RISE will automatically close that
file for you and save your changes so you can start working on a new
file.
If you are editing a work file initiated by the TEXT command, the BEGIN
command will clear the work file by purging it so that you may start over
on a new file. Because you may wish to save the changes in a permanent
file first, a safety prompt will remind you that you have not used the
KEEP command with this file, and that it will be cleared upon execution.
Thus you may reconsider the consequences of the command before consenting
to them. With the NOW parameter in effect, however, RISE will clear the
work file immediately, without displaying the safety messages.
Execution mode: Line
Examples
The following are legal abbreviations which may be used with the BEGIN
command and its parameter:
BEG Begin a new editing session.
BN Disable safety prompts and immediately terminate the
current editing session to begin a new one.
In the first example, the ADD command is used to create a five-line file.
When the BEGIN command is issued, safety prompts are returned by RISE. An
affirmative response causes the command to be executed (1). The results
of BEGIN are shown when LIST ALL is commanded. The execution message
informs the user that there is no edit file since the file has been
cleared (2). Again the ADD command is used to create a file. In this
case, the new file is made permanent using the KEEP command (3). Note
that the new filename, "SAVEFILE", already exists, and a safety prompt
appears to ensure that the user wishes to replace the old SAVEFILE with
the new (4).
>ADD
Creating work space file.
1 :LINE 1
2 :LINE 2
3 :LINE 3
4 :LINE 4
5 :LINE 5
6 :<Control Y>
>BEGIN
KEEP not done, CLEAR current work file?YES
(1) Ready to begin new session.
>LIST ALL
(2) Error 65: There is no edit file.
>ADD
Creating work space file.
1 :LINE ONE
2 :LINE TWO
3 :LINE THREE
4 :LINE FOUR
5 :LINE FIVE
6 :<Control Y>
(3) >KEEP SAVEFILE
File exist already, purge old SAVEFILE?YES
Keep completed.
(4) File name is SAVEFILE
In the next example, SIMCAL is copied into a work file, and the first
five lines are listed (1). When BEGIN is entered, no safety prompts
appear because no changes have been made to the work file. With the ADD
command, RISE is able to start a new file. Three lines are entered
before <Control Y> ends Add Mode (2). The new file is then permanently
stored under the filename "DATAFILE" (3).
>TEXT SIMCAL
Text completed.
>LIST 1/5
1 00011 H
SIMCAL
2 00012FINPUT IP F 72 DISK
3 00013FOUTPUT O F 72 DISK
4 00014IINPUT AA 01 1 CA
(1) 5 00015I OR 02 1 CS
>
>
>BEGIN
Ready to begin new session.
>ADD
Creating work space file.
1 :DATA RECORD 1
2 :DATA RECORD 2
3 :DATA RECORD 3
(2) 4 :<Control Y>
>KEEP DATAFILE
(3) Keep completed.
File name is DATAFILE
>
In the next example, the FILE command is used to allow for direct editing
of SIMCAL (1). Since SIMCAL is not a KSAM file and must be converted to
one (see FILE), an execution message is returned which prompts the user
for additional information (2). The file DIRSIM is opened, and 6 lines
are listed (3). A CHANGE command is issued which changes the string
"DISK" to "TAPE", and the results are listed (4).
Suppose at this point the user wishes to create a new file to contain
important data. Currently, however, the user is directly editing DIRSIM.
Before creating the new file, the user would want to close DIRSIM, making
the new changes permanent and start a new editing session to create the
new data file. The BEGIN command will accomplish this. When it is
executed, an execution message is displayed (5), and a LIST ALL command
brings an error message to the screen which indicates that RISE is ready
for a new editing session (6).
>
(1) >FILE SIMCAL
(2) Enter new file name followed by additional number of records.
DIRSIM 10
File opened.
>LIST 1/6
1 00011H
(3) 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
6 00016I OR 03 1 CM
(4) >CHANGE ;DISK; TO ;TAPE; IN ALL
2 00012FINPUT IP F 72 TAPE
3 00013FOUTPUT O F 72 TAPE
Changes completed.
(5) >BEGIN
Ready to begin new session.
>LIST ALL
(6) Error 65: There is no edit file.
The user is now able to create the new data file mentioned in the last
example. The ADD command is given, and data records are added (1). The
work file is stored to a permanent file with the KEEP command. The
filename, DATAFILE, already exists, so RISE issues a safety prompt (2).
Finally, DIRSIM is again accessed for direct editing with the FILE
command (3). The first 6 lines are listed (4). The listing shows that
the changes were made permanent to DIRSIM when "DISK" was changed to
"TAPE" (4) previously.
>ADD
(1) Creating work space file.
1 :DATA RECORD ONE
2 :DATA RECORD TWO
3 :DATA RECORD THREE
4 :<Control Y>
>K DATAFILE
(2) File exist already, purge old DATAFILE?YES
Keep completed.
File name is DATAFILE
>
>
(3) >FILE DIRSIM
File opened.
(4) >L1/6
1 00011H
SIMCAL
2 00012FINPUT IP F 72 TAPE
3 00013FOUTPUT O F 72 TAPE
4 00014IINPUT AA 01 1 CA
5 00015I OR 02 1 CS
6 00016I OR 03 1 CM
>
>
>
MPE/iX 5.0 Documentation