TEXT [ EDIT/3000:Reference Manual ] MPE/iX 5.0 Documentation
EDIT/3000:Reference Manual
TEXT
3-98. TEXT COMMAND
3-99. Purpose.
The TEXT command copies the contents of an MPE/3000 file into the WORK
file.
3-100. Form.
The form of the TEXT command is
(linenumber/linenumber)
T[EXT] [filename [ (#recnum/#recnum) ] [,UNN[UMBERED]]]
3-101. Description. A TEXT command that includes only the filename
parameter copies the entire file into the WORK file. If the
(linenumber/linenumber) parameter is included, only the records
corresponding to the line numbers specified will be copied into the WORK
file, and if the (#recnum/#recnum) parameter is included, only those
records corresponding to the logical record numbers specified will be
copied into the WORK file. (See paragraph 3-103, EXAMPLES.) If
neither(linenumber/linenumber)nor (#recnum/#recnum) is used, the entire
TEXT file contents are copied to the WORK file.
If the filename and the UNNUMBERED option are not specified, they are
implied from the previous KEEP or TEXT command (whichever was performed
last) for that file. If only the filename, but not the option, is
specified, the UNNUMBERED option is implied if the text file is
unnumbered, and the EDITOR responds with the message,
FILE UNNUMBERED
For example,
:EDITOR
HP32201A.7.01 EDIT/3000 WED, MAY 3, 1978 1:51 PM
(C) HEWLETT-PACKARD CO. 1976
/TEXT KEPFIL,UNN
/K KEPFIL,UNN
KEPFIL ALREADY EXISTS - RESPOND YES TO PURGE OLD AND THEN KEEP
PURGE OLD?Y
/T
KEPFIL,UNN
/TEXT KEPFIL
FILE UNNUMBERED
/
If the UNNUMBERED option was not specified in the last KEEP or TEXT
command, only the filename is implied from that command when the current
TEXT command is executed.
For example,
:EDITOR
HP 32201 A.07.01 EDIT/3000 MON, MAY 8, 1978, 3:55 PM
(C) HEWLETT-PACKARD CO. 1976
/A
1 OLD MATTER
2 NEW MATTER
3 ...
/K KEPFIL
/T
KEPFIL
/END
END OF SUBSYSTEM
:
In an interactive session, if the TEXT command is used when the WORK file
has been altered, EDIT/3000 asks if it is OK to clear the WORK file
before the TEXT command is executed. If the response is other than YES
or Y, the TEXT command is not executed. When a TEXT command is executed
in batch mode, EDIT/ 3000 clears the WORK file automatically if it has
been altered.
If FIXED is currently set when the TEXT command is issued, the value of
LENGTH is taken from the TEXT file (the maximum record length). If
VARIABLE is set, LENGTH remains set at its current value. EDIT/3000 then
resets RIGHT to the value of LENGTH and LEFT to 1, and sets FIXED or
VARIABLE depending on whether the TEXT file is a fixed or variable record
file. This has the advantage of giving you more control over your
operating environment. For example, if you desire to expand the records
of a fixed length record file, you may issue the SET LENGTH= colnum and
SET VARIABLE commands before texting in the file. These same commands
should be used for variable length record files. EDIT/3000 cannot
calculate the maximum record length of variable length files, so it uses
the block size. By setting VARIABLE and LENGTH when texting in or
keeping a variable length record file, less disc space is used for the
WORK and TEXT files and better performance can be obtained.
3-102. Limitations.
If a file is saved with a KEEP, UNNUMBERED command (or otherwise created
without sequence numbers), the TEXT command usually will be of the form
TEXT filename, UNNUMBERED. New line numbers will be assigned by EDIT/3000
starting with the SET FROM = linenumber option in effect and incremented
by the SET DELTA = integer option in effect. If the text file has
variable length records (type "V" ), then VARIABLE will be set. (See the
SET command, paragraph 3-92.)
When texting in unnumbered files from devices that cannot be rewound, the
UNNUMBERED option should always be specified. Otherwise, one or more
records will be lost from the beginning of the file.
Any sequence numbers contained in a file specified by filename must be in
the front or rear bytes as specified in a SET FORMAT, SET FRONT, or SET
REAR command (see the SET command, paragraph 3-92). The sequence numbers
will be interpreted as line numbers instead of being copied as part of
the text. If the sequence numbers are not in bytes that match the SET
FORMAT or SET FRONT/REAR conditions in effect, the command TEXT filename,
UNNUMBERED should be used. Then, the sequence numbers will be copied as
part of the text and new line numbers will be assigned by EDIT/3000,
starting from the SET FROM = linenumber in effect and incremented by the
SET DELTA = integer option in effect.
If a file has been saved with the KEEPQ filename command, then the
filename must be specified in a TEXT command for that file.
If a file has been saved with the KEEPQ filename command, the file is
saved in its structured "edit" format, instead of in the sequential
format in which files normally are stored by the MPE/3000 file system.
This is accomplished by appending EDIT/3000 variables to the file and
assigning a filecode of 1050 or 1051 to the file. A filecode of 1050
signifies an EDIT/3000 KEEPQ file (DEFAULT) and a filecode of 1051
signifies an EDIT/3000 KEEPQ file (COBOL). All such files are intended to
be read only by EDIT/3000, although SPL/3000 can read KEEPQ files also.
A TEXT command to copy the contents of such a file into the WORK file
renames the file. To prevent destruction of such a file, enter the
commands TEXT filename and KEEP filename in a succession. (See paragraph
3-62 for a discussion of the KEEP command and the MPE Com- mands
Reference Manual for a discussion of filecode and the MPE/3000 file
system.)
Texting in an empty file will result in error #23, FAILURE TO OPEN TEXT
FILE (0), with File System error #0 (END OF FILE).
Texting in a file with records greater than 256 bytes will result in
error #24, RECORD SIZE TOO LARGE.
The default TEXT file is limited to disc files on the local computer. If
a device or remote file is being used, an MPE file equation (see the
description of the :FILE command in the MPE Commands Reference Manual)
must have been issued and an asterisk (*) must be used to back-reference
the file. (See the example of texting in a card deck in paragraph
3-103).
When texting in a numbered file, an extra data segment is required.
Since a two-word entry is made in the extra data segment for every eight
records texted in, the number of records that can be texted in is limited
by the configured maximum size for extra data segments. Consult your
System Manager to determine the maximum size for extra data segments
(<=32K) and multiply it by 4 to determine the maximum number of records
that can be texted in from a numbered file. There is no limit on the
number of records when texting in unnumbered file.
Trailing blanks are truncated from the records before they are placed in
the WORK file. Therefore, if a search is made for a string which ends
with blanks, the string will not be found if it is located at the end of
a record.
3-103. Examples.
Several variations of the TEXT command are shown in the following
examples. The location of the pointer is illustrated at the conclusion
of each command.
* COPYING A NUMBERED FILE WITH A TEXT filename UNNUMBERED COMMAND
If a numbered TEXT file is copied into the WORK file with a TEXT
filename, UNNUMBERED command, EDIT/3000 treats the entire text record as
data and generates sequencing information.
In the following example, the file TEST (with a record size of 60 bytes)
is copied into the WORK file with the T[EXT] TEST command, the first
three lines are listed, and EDIT/3000 operation is terminated,
Next, EDIT/3000 is accessed and the same file is copied into the WORK
file with a T TEST,UNN command.
When the first three lines are listed, note that EDIT/3000 has appended
sequencing information to each record. When the WORK file is saved with
the K TEST command, EDIT/3000 appends another set of sequencing
information and now the record size is 68 bytes (as shown by the LISTF
TEST,1 command).
If the KEEP filename, UNNUMBERED form of the command is used, the
sequencing information generated by EDIT/3000 will not be appended to the
end of the records.
:LISTF TEST,1
ACCOUNT, GOODWIN GROUP= PUB
FILENAME CODE ------------LOGICAL RECORD--------
SIZE TYP EOF LIMIT
TEST 60B FA 3 3
:EDITOR
HP32201A.4.01 EDIT/3000 TUE, JUNB 3, 1975, 3:59 PM
/S SHORT;T TEST;L 1/3
1 1-2. WHAT IS EDIT/3000?
2
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
/E
END OF SUBSYSTEM
:EDITOR
HP32201A.4.01 EDIT/3000 TUE, JUN 3, 1975, 4:00 PM
IS SHORT;T TEST,UNN;L 1/3
1 1-2. WHAT IS EDIT/3000? 00001000
2 00002000
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000 00003000
/K TEST
PURGE OLD?T
PURGE OF OLD FILE NOT CONFIRMED - TEXT NOT KEPT
/K TEST
PURGE OLD?Y
/E
END OF SUBSYSTEM
:LISTF TEST,1
ACCOUNT= GOODWIN GROUP= PUB
FILENAME CODE ------------LOGICAL RECORD--------
SIZE TYP EOF LIMIT
TEST 68B FA 3 3
:EDITOR
HP32201A:4.01 EDIT/3000 TUE, JUN 3, 1975, 4:05 PM
/S SHORT;T TEST,UNN;L 1/3
1 1-2. WHAT IS EDIT/3000? 00001000
2 00002000
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000 00003000
/K TEST, UNN
PURGE OLD?Y
/E
CLEAR? Y
END OF SUBSYSTEM
:LISTF TEST,1
ACCOTUNT= GOODWIN GROUP= PUB
FILENAME CODE ------------LOGICAL RECORD--------
SIZE TYP EOF LIMIT
TEST 60B FA 10 10
* TEXT filename
The next example illustrates the use of the TEXT filename command. Note
that the FIND * command causes an error message to be displayed. (The
pointer location is at line zero after a TEXT command is executed.)
/S SHORT;TEXT EDIT3
/FIND*
*44*LINE NUMBER ZERO CAN NOT BE ACCESSED
/LIST FIRST;LIST LAST
1 1-2. WHAT IS EDIT/3000?
1 1 MANIPULATED BY USING EDIT/3000 COMMANDS.
/LIST ALL
1 1-2. WHAT IS EDIT/3000?
2
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
4 MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM
5 (MPE/3000) THAT 15 USED TO CREATE AND
6 MANIPULATE ASCII FILES.
7
8 CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
9 LINES OF CHARACTERS CAN BE INSERTED, DELETED,
10 REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE
11 MANIPULATED BY USING EDIT/3000 COMMANDS.
* TEXT filename,range
The range (3/8) specified in the following example copies lines 3 through
8 of file EDIT2 into the WORK file.
Note that the location of the pointer is still at line zero even though
text starts at line 3.
/S SHORT;TEXT EDIT3 (3/8)
/FIND*
*44*LINE NUMBER ZERO CAN NOT BE ACCESSED
/LIST FIRST;LIST LAST
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
8 CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
/LIST ALL
3 EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
4 MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM
5 (MPE/3000) THAT IS USED TO CREATE AND
6 MANIPULATE ASCII FILES.
7
8 CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
* COPYING A TEXT FILE FROM CARDS
To copy a TEXT file, located on cards, into the WORK file, perform the
following steps as shown in the next example:
1. Log on to the system.
2. Enter a :FILE command, as follows:
:FILE filename;DEV=CARD
CARD is a device class assigned during system configuration
to the card reader.
for example
:FILE INFILE;DEV=CARD
3. Place the card deck in the card reader. The first card in the
card deck must be a :DATA card, as follows:
:DATA[jobname,] {username} [/upass] {.acctname} [/apass] {;filename}
where
jobname is the name of the job or session that is to read
the data. (Optional parameter.)
username is the user's name, as established in MPE/3000 by
the user with Account Manager Capability.
(Required parameter.)
upass is the user password. (Required if user has a
password.)
acctname is the name of the account, as established by the
user with System Manager Capability. (Required
parameter.)
apass is the account password. (Required if account
has a password.)
filename is an additional qualifying name that can be used
by the job or session to access the data.
(Optional parameter.)
The :DATA card used in the example was as follows:
:DATA MANAGER.SCR
Note that the jobname parameter was not included and that
the username.acctname is the same as that used to log on
(MANAGER.SCR).
The last card in the card deck must be an :EOD card.
See the MPE Commands Reference Manual for further discussions of
the :DATA and :EOD commands,
4. Press the RESET switch (or equivalent) on the card reader to read
the cards.
5. Enter the :EDITOR command to access EDIT/3000.
6. Enter the TEXT command. The command used in the example is
TEXT *INFILE,UNNUMBERED
NOTE The asterisk is a back reference to the file defined in the :FILE
command. The UNNUMBERED parameter is recommended because the file
to be read did not contain line numbers. (Note that EDIT/3000
assigned line numbers as the file was texted in.)
:HELLO MANAGER.SCR
SESSION NUMBER = #S109
WED, MAY 38, 1975, 9:47 AM
HP32000C.00.04
:FILE INFILE; DEV=CARD
:EDITOR
HP32201A.4.01 EDIT/3000 WED, MAY 28, 1975, 9:47 AM
/S SHORT
/TEXT *INFILE,UNNUMBERED
/LIST ALL
1 JOHN BIGTOWN
2 LOIS ANYONE
3 ALI BABA
4 JAMES DOE
5 JOHN DOUGHE
6 MARY MEEK
7 SPACE MANN
8 KING ARTHUR
9 KARISSA GRANDTR
10 JENNA GRANDTR
11 StIASH BUCKLER
12 KNEE BUCKLER
/KEEP NAMELIST
/END
END OF SUBSYSTEM
:BYE
CPU (SEC) = 75
CONNECT (MIN) = 56
MON, JUN 30, 1975, 2:00 PM
END OF SESSION
MPE/iX 5.0 Documentation