home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.robelle3000.ai 2014
/
2014.06.ftp.robelle3000.ai.tar
/
ftp.robelle3000.ai
/
manuals
/
text
/
qcopy.txt
< prev
next >
Wrap
Text File
|
2007-12-20
|
98KB
|
2,551 lines
_____ _______ ___
QCOPY Version 4.7
___________ _______
Contributed Program
__ ____ ___ _____ _____ _____
to Read and Write Qedit Files
_____ ____ ______
Qcopy User Manual
_______ _________ __________ ____
Robelle Solutions Technology Inc.
_____ ____ __________ ____
Suite 201, 15399-102A Ave.
_______ ____ ______ ___ ___
Surrey, B.C. Canada V3R 7K1
__________ _____________
Toll-free: 1.888.robelle
________________
(1.888.762.3553)
______ ____________
Phone: 604.501.2001
____ ____________
Fax: 604.501.2003
___________________
support@robelle.com
_______________
www.robelle.com
________ ____
February 1998
Program and Manual Copyright Robelle Solutions Technology Inc.
1980-2007
___
Permission is granted to reprint this document (but not for
profit), provided that copyright notice is given.
QEDIT and SUPRTOOL are trademarks of Robelle Solutions Technology
Inc. Other product and company names mentioned herein may be the
trademarks of their respective owners.
1
_______ _ _______ __ _____
Chapter 1 Welcome to Qcopy
_ ___ ________ __ _____
* New Features of Qcopy
_ ________ __ _____
* Overview of Qcopy
_ ___ __ ___ _____
* How to Run Qcopy
_ __________ _____
* Suspending Qcopy
Qcopy 4.7 is a contributed program that reads and writes Qedit
files. Qedit is a high performance, full-screen text editor
available from Robelle Solutions Technology Inc. for all models
of the HP e3000 computer system. Qedit files exist in a special
compressed format which can only be read by Qedit or software such
as Qcopy that has been modified to read them. Qcopy is used to
convert files to and from Qedit's special format.
Along with Qcopy we provide a stand-alone routine named
Qeditaccess that provides the actual decoding of Qedit files. You
may merge this routine into your own programs if you wish. See
below for details. The code is available in both compatibility
-mode and native-mode formats.
Qcopy is also used to recover Qedit files that have been
corrupted. While this happens rarely, Qcopy is the only program
that can recover the lines of a Qedit file.
___ ________ __ _______ ___ _________ ______
New Features in Version 4.7 (November 2003):
* Qcopy and Qaccess now support the TrailingSpaces option in
Qedit workfiles.
___ ________ __ _______ ___ ________ ______
New Features in Version 4.6 (October 2002):
* Qeditaccess can read TEXT files with lines of up to 8,172
characters wide. If the file is wider, Qeditaccess returns
only the first 8,172 characters and ignores the rest.
Qedit workfiles are limited 1,000 characters i.e. Jumbo
workfiles.
Trying to access wide-jumbo workfiles now returns an error:
-9 for "Qaccess: Wide jumbo workfiles not supported yet."
_______ _ _______ __ _____
2 Chapter 1 Welcome to Qcopy
___ ________ __ _______ ___ _________ ______
New Features in Version 4.5 (February 1998):
* Qeditaccess no longer misses the last few lines in a Jumbo
file.
___ ________ __ _______ ___ ________ ______
New Features in Version 4.4 (January 1997):
* Fixed Qeditaccess bug in exceeding record sizes.
___ ________ __ _______ ___ __________ ______
New Features in Version 4.3 (September 1995):
* Qeditaccess can read Jumbo text files greater than 256
characters wide.
___ ________ __ _______ ___ _______ ______
New Features in Version 4.2 (August 1994):
* Qeditaccess has been upgraded to read Qedit's new Jumbo
workfiles. However, Jumbo files with a record length of more
than 256 characters are rejected by the existing open functions
(this is for backward compatibility). If you are willing to
accept any record size in your program, use functions 30 to 32:
30 - open a file with any record size.
31 - pass in a filenum already opened (any record size).
32 - open a file with any record size, read serially.
* There are three new error numbers:
-6 for "Qaccess: Invalid format for Jumbo Qedit file"
-7 for "Qaccess: use Jumbo Open (func 30) if rec>256"
-8 for "Qaccess: Write/Append to jumbo not impl yet"
Qeditaccess does not yet write Jumbo files.
________ __ _____
Overview of Qcopy
Qcopy expects commands in a format that is similar to FCOPY. The
________ ______
fromfile is specified by FROM= and the tofile is specified by TO=.
The TO= portion can be left off, in which case Qcopy copies the
________
fromfile into itself, converting it from Qedit format to Keep
format. Qcopy can copy a group of files with a single command.
_______ _____
Refer to the chapter Copying Files for more information.
Qcopy interprets any command line beginning with a colon (:) as an
MPE command. Only the commands that MPE allows in "break" are
_______ _ _______ __ _____
Chapter 1 Welcome to Qcopy 3
allowed in Qcopy. This feature can be used to :PURGE any files,
obtain a :LISTF of files, or to include :COMMENT lines.
For information on Qcopy and Qeditaccess, use the Help command.
All of the information in the Qcopy user manual is available
on-line through the Help command. For help on new features
recently added to Qcopy, type "Help News". The Help command can
be abbreviated to "?".
___ __ ___ _____
How to Run Qcopy
We include two copies of the Qcopy program: Qcopy.Qlib and
QcopyNM.Qlib, which is a native-mode version for MPE/iX systems.
To install the native-mode version of Qcopy as the production
version, use these commands:
:hello mgr.robelle,qlib
:rename qcopy,qcopycm
:rename qcopynm,qcopy
To access Qcopy, type this command:
:run Qcopy.Qlib.Robelle
Qcopy prints its version number and prompts with ">". You type
commands, ending each command with Return. For example, type
"HELP":
>help
Qcopy prints some help text and a keyword list. Type a keyword,
or press Return to leave Help and return to Qcopy.
Qcopy accepts commands from $STDINX, the standard MPE job input
file. This is usually the terminal or the stream file. You can
redirect the input by using the STDIN option of the :RUN command.
Qcopy writes all messages to $STDLIST, the standard MPE job
listing file. You can redirect the output by using the STDLIST
option of the :RUN command.
Qcopy can be run in batch, but Qcopy will abort if an error
occurs.
To leave Qcopy, type "EXIT" or "E".
__________ _____
Suspending Qcopy
When you run Qcopy from Qedit or Select, Exit suspends Qcopy so
that it can be re-activated quickly later. If you run Qcopy from
within HPDESK (and some other programs), Qcopy will suspend on
Exit but HPDESK will not notice. The next time you run Qcopy,
HPDESK will create a new copy of the program. Eventually you will
_______ _ _______ __ _____
4 Chapter 1 Welcome to Qcopy
have many suspended copies of Qcopy hanging from HPDESK, consuming
system resources. You can force Qcopy to terminate on Exit rather
than suspend by running Qcopy with PARM=32.
:run qcopy.qlib.robelle;parm=32
5
_______ _ _______ _____
Chapter 2 Copying Files
_ _______ ______ __ _____
* Copying Groups of Files
_ _______
* Options
_ ________
* Examples
The command used to copy files is:
________ ______ _______
FROM = fromfile ; TO = tofile ; options
________
The FROM=fromfile portion is the only part that is required.
________
Qcopy opens the fromfile as an old disc file with read access. It
can be any Qedit workfile, or any standard Keep file with
fixed-length or variable-length records.
________
Qcopy reads each record in the fromfile and transfers it to the
______ ________
tofile. When the fromfile is a Qedit workfile, the resulting file
corresponds to what you would get by doing a Keep of a Qedit
workfile from within Qedit. Where appropriate, line numbers are
______
included in each record of the tofile (columns 1-6 in COBOL,
columns 73-80 for SPL, FORTRAN, or Pascal, and no line number for
RPG, JOB and TEXT files, unless 'SERIAL' is specified).
If the entire TO= portion of the command line is not specified,
________
the fromfile is copied into itself. WARNING: you need save
________
access to the group and account of the fromfile in this case.
______
If the tofile file name is not specified, the records are printed
______
on $STDLIST. If the tofile file name is specified, it is opened
OLD with WRITE access, unless the 'NEW' or 'Qedit' option is
specified.
When the copy operation completes, Qcopy displays the number of
records that were copied. Qcopy then prompts for another command.
This continues until :EOF on $STDINX or you enter the "EXIT"
command.
You can interrupt a copy operation by pressing control-y. This
will stop the copy immediately. The current file being copied
will be closed and Qcopy will display the number of records that
were written to the file before the copy operation was
interrupted.
_______ ______ __ _____
Copying Groups of Files
Qcopy can copy an entire group of source files to another group or
back into itself. The syntax to copy from one group to a
different group is:
_________ _______
>FROM=@.fromgroup;TO=@.togroup;NEW
_______ _ _______ _____
6 Chapter 2 Copying Files
The syntax to convert an entire group from Qedit format to Keep
format is:
_________
>FROM=@.fromgroup
_________
For each file in the fromgroup, a file with the same name is
_______
created in the togroup. We recommend that you clear out the
_______
togroup first with a :PURGEGROUP command.
To interrupt a group copy operation, press control-y. This will
stop the copy immediately. The current file being copied will be
closed and Qcopy will display the number of records written to the
file before the copy operation was interrupted.
The group copy option can be combined with the 'INCLUDE' option to
provide a very convenient mechanism for distributing SPL, FORTRAN,
or Pascal applications in source code:
1. Use $INCLUDE for all FILE or DATASET record layouts and common
blocks in FORTRAN.
2. Publish the names of the include files for your users.
3. Distribute your source code in Qedit form in a special group.
This saves disc space.
4. Users who want to replace or expand the DATASET layouts, may
replace the appropriate 'INCLUDE' files, which can be either
Qedit or Keep files, and :RUN Qcopy to move the entire group or
selected programs to another group. The customized source code
is compatible with EDIT/3000.
5. If your users have Qedit, they can dispense with the Qcopy
operation completely and let the $INCLUDE operation happen at
compile-time, with the same customizing results.
_______
Options
The options to Qcopy must be separated by semi-colons and are
taken from the following list:
_______
options = NEW INCLUDE UNN ERASE APPEND SERIAL QEDIT FTN
___ ______
NEW Option
______
By default, the tofile is an OLD disc file. When the NEW option
______
is specified, the tofile is opened as a new disc file. In this
______ ___
case, the tofile must not exist. If it does, Qcopy will fail when
______ ______
it tries to close the tofile. If no TO= is specified, the tofile
is opened as a new disc file.
_______ _ _______ _____
Chapter 2 Copying Files 7
_______ ______
INCLUDE Option
The 'INCLUDE' option causes Qcopy to look for $INCLUDE records and
replace them by the lines of the specified file.
________
$INCLUDE filename
______
Qcopy adds 10000 to the size of the tofile in order to allow room
for the included lines. If you do not specify the 'INCLUDE'
option, the lines that start with $INCLUDE are copied to the
______
tofile without any change.
______
If you try to TEXT the tofile into EDIT/3000, it will detect that
the sequence fields in the included lines are out of sequence, and
treat the file as an unnumbered file. You may have to set
right=72 and length=72 to eliminate the sequence fields. With
Qedit, the file is automatically resequenced starting with the
first included line.
___ ______
UNN Option
This option causes the Qedit file to be read without sequence
numbers in each line. By default, Qedit files have sequence
numbers unless the Language is Job, RPG or Text.
_____ ______
ERASE Option
______
This option specifies that the tofile is an old file whose
contents are to be overwritten. This may seem like a useless
option, since Qcopy overwrites old files by default (unless you
specify the NEW or QEDIT options), but it isn't. The ERASE option
is the only way you can get Qcopy to erase and overwrite a Qedit
workfile.
______ ______
APPEND Option
______
This option specifies that the tofile is an existing file that you
want to append lines to. The old file may be a Qedit file or a
Keep file.
_____ ______
QEDIT Option
Normally, Qcopy reads a Qedit file and creates a standard Keep
file. The QEDIT option reverses this by reading a Keep file and
creating a Qedit file.
____
This option only works for new files (the NEW option is assumed).
With this option there is no way to write over an existing file.
Use the ERASE option instead if you want to write over an existing
Qedit file. This option also works with group copies.
_______ _ _______ _____
8 Chapter 2 Copying Files
___ ______
FTN Option
Qcopy has no method of distinguishing FORTRAN or Pascal Keep files
from SPL Keep files. All Keep files with record numbers in the
last eight columns are assumed to be SPL files.
If you want the new Qedit files to be identified as FORTRAN files
instead of SPL (when it is ambiguous), use the FTN option with the
Qedit option. This changes the default language when converting
Keep files with 8-byte sequence numbers.
___ ______
PAS Option
This option is similar to the FTN option, except that it sets the
default language to Pascal when converting Keep files.
________
Examples
1. Convert a Qedit file to Keep format. In this case the output
____
file must exist.
:run Qcopy.qlib.robelle
>from=qfile;to=kfile
>exit
2. Convert a Qedit file to Keep format, but the output file does
not already exist:
:run Qcopy.qlib.robelle
>from=qfile;to=kfile;new
>exit
3. Convert a Qedit file with $INCLUDE lines to Keep format. The
$INCLUDE files will be copied to the output file at the correct
place. The output file does not already exist.
:run Qcopy.qlib.robelle
>from=qfile;to=kfile;new;include
>exit
4. Convert a Qedit file into Keep format by copying it back into
itself.
:run Qcopy.qlib.robelle
>from=qfile
>exit
_______ _ _______ _____
Chapter 2 Copying Files 9
5. Copy an entire group of Qedit files to another group,
converting each file to Keep format. First, we logon in the
destination group and use the :PURGEGROUP command to purge all
of the existing files. Because we are logged on in the group
___
we are purging, the group will not be purged, only the files
will be.
:hello mgr.dev,ksource
:purgegroup ksource
:run Qcopy.qlib.robelle
>from=@.qsource;to=@.ksource;new
>exit
6. Copy an entire group into itself. This converts each Qedit
file in the group to Keep format.
:hello mgr.dev,qsource
:run Qcopy.qlib.robelle
>from=@.qsource
>exit
______
7. Convert a Keep file to Qedit format. The tofile must not
already exist:
:run Qcopy.qlib.robelle
>:purge qfile
>from=kfile;to=qfile;qedit
>exit
8. Convert an entire group from Keep format to Qedit format. Each
source file will be converted. Binary files will be ignored,
but ASCII data files will be converted to Qedit format:
:hello mgr.dev,ksource
:run Qcopy.qlib.robelle
>from=@.ksource;qedit
>exit
______
9. Convert a FORTRAN Keep file to Qedit format. The tofile must
not already exist:
:run Qcopy.qlib.robelle
>:purge qfile
>from=kfile;to=qfile;qedit;ftn
>exit
10
_______ _ ________ _____ ___ ______ ______
Chapter 3 Recovery Using the SERIAL Option
_ ____________
* Introduction
_ ________
* Examples
____________
Introduction
The "SERIAL" option is used to recover Qedit workfiles that have
been corrupted. Qedit workfiles have an internal linkage
structure that keeps all of the lines in line number order. It is
possible that through a system crash these pointers could be
incorrect. When this happens, Qedit goes through a recovery
procedure. It is possible that the Qedit recovery will fail. In
this case, use 'SERIAL' to recover the file.
The SERIAL option causes Qcopy to read records from the Qedit
workfile in serial order. Qcopy ignores the internal linkage
pointers of the workfile. Of course, the resulting lines will not
be in the correct order.
______ ______
When using this option, the tofile will always have sequence
numbers. This means that 88-byte records will be generated for
JOB/RPG files, with sequence numbers in columns 81 through 88, and
264-byte records for TEXT files, with sequence numbers in columns
______
257 through 264. The tofile must then be sorted by sequence
number in order to put the records back in their correct order.
________
Examples
1. Recovery of a COBOL or a COBOLX file:
:run Qcopy.qlib.robelle
>:purge k
>:purge ksorted
>from=cobprog;to=k;new;serial
>exit
:comment k = unsorted lines of cobprog
:run sort.pub.sys
>input k
>output ksorted
>key 1,6
>end
:comment ksorted contains recovered cobprog.
:run Qedit.pub.robelle
/t cobnew=ksorted
If there are any duplicate lines, Qedit prints
WARNING: Linenum
_______ _ ________ _____ ___ ______ ______
Chapter 3 Recovery Using the SERIAL Option 11
and renumbers the lines after the first duplicate line.
2. Recovery of a SPL, FORTRAN, or Pascal file:
:run Qcopy.qlib.robelle
>:purge k
>:purge ksorted
>from=splprog;to=k;new;serial
>exit
:run sort.pub.sys
>input k
>output ksorted
>key 73,8
>end
:run Qedit.pub.robelle
/t splnew=ksorted
3. Recovery of a RPG or JOB file:
:run Qcopy.qlib.robelle
>:purge k
>:purge ksorted
>from=jobprog;to=k;new;serial
>exit
:run sort.pub.sys
>input k
>output ksorted
>key 81,8
>end
:run Qedit.pub.robelle
/t jobnew=ksorted
4. Recovery of a TEXT file:
:run Qcopy.qlib.robelle
>:purge k
>:purge ksorted
>from=textprog;to=k;new;serial
>exit
:run sort.pub.sys
>input k
>output ksorted
>key 257,8
>end
:run Qedit.pub.robelle
/t textnew=ksorted
12
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure
_ ____________
* Introduction
_ ________ _________
* Function Parameter
_ _________ _________
* Workspace Parameter
_ ________ _________
* Argument Parameter
_ ______ _______ __ _______ _ _____ ____
* Pascal Example of Reading a Qedit File
_ ___ _______ __ _______ _ _____ ____
* SPL Example of Reading a Qedit File
_ _____ _______ __ _______ _____ __ ___
* COBOL Program to Convert Qedit to MPE
_ _____ _______ __ _______ ___ __ _____
* COBOL Program to Convert MPE to Qedit
____________
Introduction
Qeditaccess is a general-purpose interface routine that can be
called by a user program written in COBOL, FORTRAN, SPL, or
Pascal. It is used to access source files in programs such as
text formatters, assemblers, compilers, cross references, and so
on. It will open, read, rewind, and close any ordinary source
file. It also supports these same functions for Qedit workfiles,
making them look to the user program as if they were normal source
files with fixed-length records. Other functions of Qeditaccess:
find by line number function for Qedit files only, open new Qedit
file, open old Qedit file (and erase), write to Qedit file, close
as permanent file, and close as temporary file.
A shorter name, QACCESS, is provided for programs written in
Pascal Robelle (or any other language that restricts the length of
identifiers).
Qeditaccess is a routine of the Qcopy program, but it is also
distributed separately in both object and source format
(qaccess.qlibsrc.robelle). Qeditaccess may be used by anyone who
wants their software to read Qedit workfiles; it may be used in
software products provided that both Qedit and Robelle are
acknowledged in the product documentation. We also recommend that
anyone who is using Qeditaccess and is not a customer of Robelle
should inform us that Qeditaccess is being used. Robelle reserves
the right to change the format of Qedit workfiles and the code to
___
Qeditaccess at any time in the future.
Qeditaccess is declared in an SPL program as:
Procedure Qeditaccess ( Function, Workspace, Argument );
Integer Array Function;
Array Workspace, Argument;
Option External, Check 2;
All parameters are passed by reference so that Qeditaccess can be
called from COBOL programs. For details on how to call
Qeditaccess from SPL, Pascal and COBOL, refer to the examples
below.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 13
When using any of the read functions (2, 8 or 17), the Argument
parameter is a buffer where the data is going to be stored.
Qaccess returns up to 8,172 characters for text files. If the
file records are wider, Qaccess truncates the records. If the
buffer is too small for the requested text, the result is
unpredictable.
The limit is 1,000 characters for Qedit workfiles (jumbo). If you
are trying to access wide-jumbo workfiles, Qaccess returns an
error (-9).
________ _________
Function Parameter
Although Function is defined as an integer array, it is only used
as a single word integer, PIC S9(4) COMP in COBOL, except in
functions 9 to 16. The first word of Function tells Qeditaccess
what task to perform. The valid function values are 1 through 18,
plus 30 and 31.
_______ __ ________ ___ ________
Summary of Function and Argument
Function Use Argument
1 Open a file for read filename
2 Read the next record line read
3 Close file after reading unused
4 Rewind unused
5 Serial open for read filename
6 Find line number line number (in)
line read (out)
7 Already open for read file number
8 Read unnumbered line read
9 Open new Qedit file filename
10 Save/Close as permanent file unused
11 Save/Close as temporary file unused
12 Write line line to write
13 Open for write, erase filename
14 Already open for write, erase file number
15 Open for write, append filename
16 Already open for write, append file number
17 Read line line read
18 Explain error number message
30 open for read, any reclen filename
31 already open for read, any rec filenum
32 open for serial read, any rec filename
__ ____ _ _____ ___ ____ ____ ______
1. Open a file, OLD with READ access
Argument contains the file name, which may be a Qedit or Keep
file, permanent or temporary. See word 5 of the Workspace
(e.g., Workspace(4) in SPL) for the record length in bytes of
the file. Files with record lengths longer than 256 characters
_______ _ ___________ _________
14 Chapter 4 Qeditaccess Procedure
are rejected, since previous versions specified that as the
maximum size of the Argument parameter on read calls. Use
Functions 30 or 31 to access files or any record size.
__ ____ ___ ____ ______
2. Read the next record
The record is returned in Argument. If the file is a Qedit
file that we think of as numbered (e.g., COBOL, SPL, FORTRAN,
or Pascal), the line number will be formatted in ASCII just
like an EDIT/3000 Keep file. The length of the record read is
returned in word 10 of the Workspace. For Qedit files, the
line number is also returned as a 32-bit integer in Words 6 and
7 of the Workspace parameter.
____
If the file was opened with function 1, the next record is the
next logical record in the file (i.e., in line number
____
sequence). If the file was opened with function 5, the next
record is the next physical record in the file (i.e., MPE
record sequence).
__ _____ ____ _____ _______
3. Close file after reading
Use this function with read-access files (functions 1, 5, and
7). Argument is unused.
__ ______
4. Rewind
Rewind the file to the beginning in preparation for reading
again. Argument is unused.
__ ______ ____
5. Serial Open
Open the file for serial read access. This function is used
with the 'SERIAL' option of Qcopy described previously.
__ ____ ____ ______
6. Find Line Number
Find the line with a line number greater than or equal to the
line number specified in Argument. The target line is
specified as a 32-bit INTEGER or S9(9) COMP in COBOL. The line
itself is returned in the same Argument parameter, so be sure
to allow room. The line number of the line found is returned
in words 6 and 7 of the Workspace parameter. If the line
number target is higher than the last line in the file, -1 is
returned in the Status word of the Workspace. Remember that
line 1 is really line 1.000 or 1000 when stored as a 32-bit
INTEGER.
____ ________ ____ _____ ___ _____ _____
This function only works for Qedit files (word 3 of the
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 15
Workspace' must be 1, not 0 or 2) that are open for read
access.
__ _______ ____
7. Already Open
Argument contains the file number of a file that you have
already opened with FOPEN for read access. This function is
like function 1, except that you do the FOPEN yourself. With
this function, you can choose to call Qeditaccess only if the
filecode is 111 (instead of for every file).
__ ____ __________
8. Read Unnumbered
For Keep files, this function is just like function 2. For
Qedit files, the sequence number is not returned as part of the
line. Instead, Words 6 and 7 of the Workspace contains the
sequence number. Word 10 of the Workspace (e.g., Workspace(9)
in SPL) contains the length in bytes of the line just returned
(less trailing blanks). Argument always returns a fixed-size
record with trailing blanks. For COBOL Qedit files, the first
character returned is column 7.
If you want to read Keep files the same way as Qedit files, use
function 17.
__ ____ ___ _____ ____
9. Open New Qedit File
Function is an integer array that describes the new file. For
SPL calls, subtract 1 from offsets.
Function(1) = 9, Open New Qedit file
Function(2) Language 1=SPL, 2=Ftn, 3=COBOL, 4=RPG,
5=Job, 6=Text, 7=Pascal, 8=CobolX,
9=Data
Function(3) Recsize in bytes, needed if Language=6 (text)
Function(4) Number of Blocks, allow Lines/8 blocks
Function(5) Number of Extents (1-32)
Function(6) Initial Extents (1-number of extents)
Argument contains the name of the new file. Qeditaccess opens
the new file and prepares to write lines into it (see function
12). If the file is a duplicate, you will not find out until
you try to close it (see function 10 or 11).
_____________ __ _________ ____
10.Save/Close As Permanent File
Closes the current write-access file as Save-Permanent. Use
this function, not function 3, with functions 13 to 16 (old
files, write-access) and and with function 9 (new Qedit file).
For new Qedit files, function 10 will fail if the file already
_______ _ ___________ _________
16 Chapter 4 Qeditaccess Procedure
exists. Argument is unused.
_____________ __ _________ ____
11.Save/Close As Temporary File
Closes the new Qedit file (see function 9 above) as an old
temporary file. Will fail if the file already exists in the
job domain. Argument is unused.
________ ____
12.Write Line
Writes a new line to the end of a Qedit file that has been
opened for write access (functions 9, 13, 14, 15, 16).
Argument contains the variable-length data for the new line.
Function is an integer array that defines the byte length of
the new line and the line number. For SPL subtract 1 from
offsets.
Function(1) = 12, Write new line
Function(2) Recsize in bytes, positive
Function(3/4) Line number, 32-bit integer, line 5 is 5000
Pass zero (0) every time if you would like
Qeditaccess to assign line numbers itself
_______ ___ ______ _____
13.Open For Write, Erase
Argument contains the name of an existing Qedit or Keep file to
open. The existing contents of the file will be destroyed.
Function is an integer array that describes what type of data
you plan to write into the file. For SPL, subtract 1 from
offsets.
Function(1) = 13, Open for Write, Erase
Function(2) Language 1=SPL, 2=Ftn, 3=COBOL, 4=RPG,
5=Job, 6=Text, 7=Pascal, 8=CobolX,
9=Data
Function(3) Recsize in bytes, needed if Language=6 (text)
__________ ____ ___ ______ _____
14.Already Open For Write, Erase
This is just like function 13, except that the caller opens the
file. Argument contains the file number of an existing Qedit
or Keep file. Qedit files must be opened with Read/Write
access. The existing contents of the file will be destroyed.
Function is an integer array that describes what type of data
you plan to write into the file. For SPL, subtract 1 from
offsets.
Function(1) = 14, Already Open for Write, Erase
Function(2) Language 1=SPL, 2=Ftn, 3=COBOL, 4=RPG,
5=Job, 6=Text, 7=Pascal, 8=CobolX,
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 17
9=Data
Function(3) Recsize in bytes, needed if Language=6 (text)
_______ ___ ______ ______
15.Open For Write, Append
Argument contains the name of an existing Qedit or Keep file to
open for Append Access. The existing contents of the file will
be preserved. Function is an integer array that describes what
type of data you plan to write into the file. If the existing
___
file is a Qedit workfile and empty, Qeditaccess gives it the
Language and Length you specify. If the file contains lines or
is not a Qedit file, Qeditaccess ignores your requested
Language and Length. For SPL, subtract 1 from offsets.
Function(1) = 15, Open Existing File to Append
Function(2) Language 1=SPL, 2=Ftn, 3=COBOL, 4=RPG,
5=Job, 6=Text, 7=Pascal, 8=CobolX,
9=Data
Function(3) Recsize in bytes, needed if Language=6 (text)
__________ ____ ___ ______ ______
16.Already Open For Write, Append
Argument contains the file number of an existing Qedit or Keep
file that the caller has opened. Qeditaccess accepts it for
append access. To append to a Qedit file you must open the
file with Read/Write access. Function is an integer array that
describes what type of data you plan to write into the file.
___
If the existing file is a Qedit workfile and empty, Qeditaccess
gives it the Language and Length you specify. If the file
contains lines or is not a Qedit file, Qeditaccess ignores your
requested Language and Length. For SPL, subtract 1 from
offsets.
Function(1) = 16, Already Open for Write, Append
Function(2) Language 1=SPL, 2=Ftn, 3=COBOL, 4=RPG,
5=Job, 6=Text, 7=Pascal, 8=CobolX,
9=Data
Function(3) Recsize in bytes, needed if Language=6 (text)
_______ ____
17.Read Line
This function is like function 8, except that it works the same
for both Qedit and Keep files. Argument returns a fixed-size
record with trailing blanks. The sequence number is removed
from the line, and words 6 and 7 of the Workspace contain the
sequence number. If the file is unnumbered, the sequence
number returned starts at 1.000, then 2.000, etc. Word 10 of
the Workspace contains the byte length of the line read (less
trailing blanks).
_______ _ ___________ _________
18 Chapter 4 Qeditaccess Procedure
__________
18.Explain
Put a one-line explanation of the Workspace status into
Argument. Word 10 of the Workspace contains the length of the
explanation in bytes.
_______ _ ____ __ ___ _______ ____ ____ ______
30.Open a file of any Recsize with READ access
Function 30 is identical to function 1, except that a file
record length of more than 256 characters is allowed. Argument
contains the file name, which may be either a permanent or
temporary Qedit or Keep file. See word 5 of the Workspace
(e.g., Workspace(4) in SPL) for the record length in
characters. You must provide a buffer of at least this size in
any read calls that you make.
__________ ________ _______ ____
31.Anysize Records, Already Open
Function 31 is identical to function 7, except that a record
length of more than 256 characters is allowed. See word 5 of
the Workspace (e.g., Workspace(4) in SPL) for the record length
in characters. You must provide a buffer of at least this size
in any read calls that you make.
Argument contains the file number of a file that you have
already opened with FOPEN for read access. This function is
like function 1, except that you do the FOPEN yourself. With
this function, you can choose to call Qeditaccess only if the
filecode is 111 (rather than for every file).
______ ______ ____ _ ______ ____
32.Any Record Size - Serial Open
Open a file with any record size for serial read access. See
word 5 of the Workspace (e.g., Workspace(4) in SPL) for the
record length in characters. You must provide a buffer of at
least this size in any read calls that you make. This function
is used with the Serial option of Qcopy, which is described
elsewhere.
_________ _________
Workspace Parameter
The Workspace is a 270-word (540-byte) array that must be provided
for each file to be opened. This array is used to hold the MPE
file number and other information about the file. In addition, it
returns the status of the last operation. The words of the array
are defined as follows.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 19
_______ __ _________ __________
Summary of Workspace Parameters
Offset Contents Explanation
word 1 Status MPE error number of last operation,
or 0 if ok, or -1 for end of file
Qeditaccess errors are negative numbers
word 2 Filenum MPE filenumber returned by FOPEN
Can be used to call print'file'info
word 3 Type 0=Keep file, 1=a Qedit file,
2=other, 3=new Qedit file,
4=erase MPE file, 5=append MPE file,
6=erase Qedit file,
7=append Qedit file
word 4 Lang 0=unknown, 1=spl, 2=ftn, 3=cob, 4=rpg,
5=job, 6=text, 7=pascal, 8=cobolx, 9=data
word 5 Length The record length in bytes
For variable length files, the maximum
possible length of a record
word 6/7 Size or OPEN function, number of lines in file
Curkey FIND function, line number of this line
READ functions, line number of line
word 8 Block Current disc block
(Qedit regular files only)
word 9 Index Current index into block (Qedit only)
word 10 Readlen Length in bytes of last record read
word 11 Left 0=linenum at right end of record
1=linenum at left end of record
word 12 Keylen Length of the line number key in bytes
word 13/14 reserved for internal use
word 15-270 buffer space for Qedit file
__ ______
1. Status
This contains the MPE error number of last Qeditaccess
operation. You can use this value to call ferrmsg. A 0
indicates no error, and end of file is indicated by a -1. A
negative error number indicates an internal Qeditaccess error.
-1 End of file.
-2 File record length greater than 256.
_______ _ ___________ _________
20 Chapter 4 Qeditaccess Procedure
-3 File system error reading block one,
Fcheck unable to find error.
-4 Invalid function.
-5 File system error, Fcheck unable to find error.
-6 Invalid format for Jumbo Qedit file.
-7 Use Jumbo Open (func 30) if rec>256
-8 Write/Append to Jumbo not implemented yet.
72 This error commonly occurs when you try to use
a function not compatible with the way the file is
opened (e.g., writing to a file opened for read).
__ ____ ______
2. File number
This contains the MPE filenumber returned by FOPEN. You can be
used it to call print'file'info.
__ ____ ____
3. File type
This contains the type of the file detected by Qeditaccess
after you call one of the Open functions.
0 Keep file
1 Qedit file
2 Other/Binary
3 New Qedit file
4 Erase MPE file
5 Append MPE file
6 Erase Qedit file
7 Append Qedit file
__ ________
4. Language
This contains the language type of the file. For the Open or
Read functions, Qeditaccess tries to determine the language of
the file by looking at the first record. For the Open for
Write functions, this contains the language that you passed via
the Function parameter.
0 Unknown
1 SPL
2 Fortran
3 Cobol
4 RPG
5 Job
6 Text
7 Pascal
8 CobolX
9 Data
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 21
__ _______
5. Recsize
This contains the maximum length of a record in the file. For
Qedit files, this depends on the language of the file. For
Keep files, this is the length of each record. For variable
length files, this is the longest record that could be in the
file. If you just converted a file into variable length
format, then this value is likely going to be much larger than
the longest actual record.
________ ____ __ ____ ______
6,7.File Size or line number
This 32-bit integer could contain several values, depending on
which Qeditaccess function was called. After an OPEN function,
this contains the number of lines in file. After a FIND
function, this contains the line number of the found, which may
be different than the line you requested if you specified a
non-existent line. After a READ function, this contains the
line number of the line just read.
__ _____ _____
8. Qedit Block
This contains the block number of the current disc block. This
is only valid for Qedit files.
__ _____ _____
9. Qedit Index
This contains the current index into the current disc block.
This is only valid for Qedit files.
_______ ______
10.Read Length
This contains the length in bytes of the last record read. For
Qedit files, this is the length of the line without trailing
blanks. For Keep and variable length files, this depends on
which Read function was called. For Read functions 2 and 8,
this is the length of the actual record read. For Read
function 17, this is the length of line without line numbers
and without trailing blanks. You should use Read Length
instead of Recsize when you access the record.
_______ ____
11.Left Flag
This contains a flag indicating where the line number is in a
record. For most MPE files (except COBOL), the line number is
at the end of the record. COBOL files have line numbers at the
beginning of the record.
0 Linenum at right end of record
_______ _ ___________ _________
22 Chapter 4 Qeditaccess Procedure
1 Linenum at left end of record
______ ______
12.Key Length
This contains the length of the line number key in bytes. For
COBOL, the line number is 6 bytes long. For other languages,
the line number is 8 bytes long.
______ ________ ___ ________ ___
13,14. Reserved for internal use
_______ ______ _____ ___ _____ _____
15-270. Buffer space for Qedit files
________ _________
Argument Parameter
This is a general-purpose parameter. In functions 1, 5, 9, 13 and
15, it specifies the file name to be opened. In functions 2, 8,
and 17, it is the buffer for returning the record just read. In
function 12, it is the buffer containing the data to be written.
In function 6, it is a line number in DOUBLE-INTEGER format. In
functions 7, 14 and 16, it passes in the file number (single
integer). In function 18, it contains the error message that is
returned. For the other functions that doesn't use the Argument,
a dummy parameter still must be passed.
______ _______ ________ _____ _____
Pascal Example (Reading Qedit File)
{
This program demonstrates how to call Qeditaccess from
Pascal. It reads a Qedit file called QDATA and displays
the contents of the file on $stdlist.
}
$HP3000_16$ { compiler option for Pascal/XL only }
program TestQaccess( input,output );
const
MaxFnameLen = 40;
MaxLineLen = 256;
type
shortint = -32768..32767;
{
The type declaration for shortint is required in Pascal/V.
Comment this line out in Pascal/XL.
}
{
This is the general Argument parameter for Qeditaccess.
The different uses are indicated by the variant fields.
More variant fields can be added.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 23
All of the parameters must be passed as 16-bit word
addresses (e.g., the Argument parameter cannot simply be
declared as a packed array of char)
The case variant shortint MUST NOT be given a field name.
}
ArgRec = record
case shortint of
1: (fname: packed array[1..MaxFnameLen] of char);
2: (line: packed array[1..MaxLineLen] of char);
end;
WorkRec = record
status : shortint;
filenum : shortint;
filetype : shortint;
lang : shortint;
length : shortint;
size_key : integer;
block : shortint;
index : shortint;
readlen : shortint;
left : shortint;
keylen : shortint;
reserved : integer;
buf : packed array[1..256] of shortint;
end;
FuncRec = record
num : shortint;
lang : shortint;
recsize : shortint;
numblocks : shortint;
numextents : shortint;
initextent : shortint;
end;
var
Func : FuncRec;
WorkSpace : WorkRec;
Arg : ArgRec;
i : shortint;
done : boolean;
procedure QeditAccess( var func : FuncRec;
var workspace : WorkRec;
var arg : ArgRec );
external spl;
begin
arg.fname := 'QDATA ';
Func.num := 1;
QeditAccess( Func, WorkSpace, Arg );
_______ _ ___________ _________
24 Chapter 4 Qeditaccess Procedure
if WorkSpace.status<>0 then begin
writeln('could not open, error = ', WorkSpace.status );
end
else begin
done := false;
repeat
Func.num:=2;
QeditAccess( Func, WorkSpace, Arg );
if WorkSpace.status=0 then begin
for i:=1 to WorkSpace.length do
write( Arg.line[i]);
writeln;
end
else if WorkSpace.status=-1 then { end of file }
done := true
else begin
writeln('could not read, error = '
,WorkSpace.status);
done := true;
end;
until done;
Func.num := 3;
QeditAccess( Func, WorkSpace, Arg );
end;
end.
___ _______ ________ _____ _____
SPL Example (Reading Qedit File)
$control uslinit
begin << Qcopytst program: testing Qeditaccess routine.
Reads a Qedit file and prints it.
Prints attributes of file (recsize, cobol'ness).
Prints line 5.000 of file (or next line, if any).
:file input=xxxx
:run Qcopytst [;parm=1]
Use Parm=1 to ignore Sequence Numbers. >>
byte array fname(0:10):="INPUT ";
integer filenum, filecode, readtype, parm=q-4;
array linebuf(0:128);
byte array linebuf'(*)=linebuf;
double array linenumber (*)=linebuf;
integer opencode:=1, readcode:=2, closecode:=3,
findcode:=6, already'open:=7, unn'read:=8;
array workspace (0:269);
integer array qstatus (*) = workspace(0);
integer array recsize (*) = workspace(4);
integer array readlen (*) = workspace(9);
logical array cobol'flag (*) = workspace(10);
double array curkey (*) = workspace(5);
procedure Qeditaccess (function,workspace,argument);
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 25
integer function;
array workspace, argument;
option external, check 3;
intrinsic print,ascii,fopen,fgetinfo,
fclose, printfileinfo;
subroutine print'line'five;
begin
linenumber := 5000d; <<5.000>>
Qeditaccess(findcode,workspace,linenumber);
if qstatus=0 then
begin
print(linebuf,-readlen,0);
if curkey <> 5000d then
print(linebuf,-(move linebuf':="Line after 5 ^ ")
,0)
else
print(linebuf,-(move linebuf':="Line 5 ^ "),0);
end
else
print(linebuf,-(move linebuf':="No line 5!"),0);
end; <<print'line'five>>
subroutine print'attributes;
begin
move linebuf:="Recsize=";
print(linebuf,-(8+ascii(recsize,10,linebuf'(8))),0);
if cobol'flag then
print(linebuf,-(move linebuf':="COBOL file."),0);
end; << print'attributes >>
logical subroutine open'Qedit'file;
begin
filenum := fopen(fname,3);
if <> then
printfileinfo(filenum)
else
begin
fgetinfo(filenum,,,,,,,,filecode);
if <> or filecode<>111 then !Ignore Keep files
begin ! Even though Qeditaccess can read them too!
print(linebuf,-(move linebuf':=
"Not a Qedit File"),0);
fclose(filenum,0,0);
end
else
begin
Qeditaccess(already'open,workspace,filenum);
if qstatus=0 then
begin
open'Qedit'file:=true;
print'attributes;
end
else
_______ _ ___________ _________
26 Chapter 4 Qeditaccess Procedure
fclose(filenum,0,0);
end;
end;
end; <<open'Qedit'file>>
readtype := if parm=1 then unn'read else readcode;
if open'Qedit'file then
begin
while qstatus = 0 do
begin
Qeditaccess(readtype,workspace,linebuf);
if qstatus=0 then
print(linebuf,-readlen,0);
end;
print'line'five;
Qeditaccess(closecode,workspace,linebuf);
end;
end. <<Qcopytst>>
________
Caution. The WORKSPACE parameter is used by Qeditaccess to hold
important control variables for each file that is opened. A
separate workspace must be provided for each file and the
workspace must not be changed by the calling program. Even though
their lengths are the same, the workspace for Qeditaccess and the
___
workspace for the QOUT routines is not the same. The two internal
workspace definitions are completely different.
_____ _______ __ _______ _____ __ ___
COBOL Program to Convert Qedit to MPE
Here is a sample COBOL/85 program that calls QeditAccess to
convert a Qedit file to an MPE file. It has been tested on both
MPE V and MPE/iX (in CM and NM).
$control uslinit
id division.
program-id. qed2mpe.
* qed2mpe reads a qedit file and generates a mpe file.
* the mpe file is always 80 bytes fixed ascii.
* use a file command to define the file name and flimit
* e.g., :file out01=blabla;disc=25000
environment division.
input-output section.
file-control.
select mpe-file assign to "OUT01".
data division.
file section.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 27
fd mpe-file
data record is mpe-record.
01 mpe-record pic x(80).
working-storage section.
01 disp-s9-4 pic +9(4).
01 disp-s9-9 pic +9(9).
01 qedit-filename pic x(40).
01 qedit-file-flag pic x(1) value low-value.
88 qedit-file-is-open value "O".
88 end-of-qedit-file value "E".
01 qacc-function pic s9(4) comp.
01 qacc-workspace pic x(540).
01 filler redefines qacc-workspace.
05 qacc-status pic s9(4) comp.
05 qacc-filenum pic s9(4) comp.
05 qacc-type pic s9(4) comp.
05 qacc-lang pic s9(4) comp.
05 qacc-length pic s9(4) comp.
05 qacc-size pic s9(9) comp.
05 qacc-block pic s9(4) comp.
05 qacc-index pic s9(4) comp.
05 qacc-readlen pic s9(4) comp.
05 qacc-left pic s9(4) comp.
05 qacc-keylen pic s9(4) comp.
05 filler pic s9(4) comp.
05 filler pic s9(4) comp.
05 qacc-buffer pic x(512).
01 dummy pic s9(4) comp.
01 qedit-record pic x(256).
01 read-counter pic s9(9) comp.
01 write-counter pic s9(9) comp.
procedure division.
qed2mpe.
display "QED2MPE TEST PROGRAM"
display space
display "Enter Qedit file to read: " with no advancing
move spaces to qedit-filename
accept qedit-filename
if qedit-filename <> spaces then
open output mpe-file
perform open-qedit-file
if qedit-file-is-open then
move 0 to read-counter, write-counter
display "Info: Starting to read file"
perform read-qedit-file
until end-of-qedit-file
move read-counter to disp-s9-9
_______ _ ___________ _________
28 Chapter 4 Qeditaccess Procedure
display
"Info: read-counter = " disp-s9-9
move write-counter to disp-s9-9
display
"Info: write-counter = " disp-s9-9
perform close-qedit-file
end-if
close mpe-file
end-if
goback
.
open-qedit-file.
move 1 to qacc-function
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-filename
if qacc-status = 0 then
if qacc-type = 1 then
perform display-qedit-file-info
move "O" to qedit-file-flag
else
move qacc-type to disp-s9-4
display
"Error: Not a Qedit file. "
"qacc-type = " disp-s9-4
else
move qacc-status to disp-s9-4
display
"Error: Can't open file. "
"qacc-status = " disp-s9-4
.
display-qedit-file-info.
move qacc-filenum to disp-s9-4
display "Info: filenum = " disp-s9-4
move qacc-type to disp-s9-4
display "Info: type = " disp-s9-4
move qacc-lang to disp-s9-4
display "Info: lang = " disp-s9-4
move qacc-length to disp-s9-4
display "Info: length = " disp-s9-4
move qacc-size to disp-s9-9
display "Info: size = " disp-s9-9
move qacc-block to disp-s9-4
display "Info: block = " disp-s9-4
move qacc-index to disp-s9-4
display "Info: index = " disp-s9-4
move qacc-readlen to disp-s9-4
display "Info: readlen = " disp-s9-4
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 29
move qacc-left to disp-s9-4
display "Info: left = " disp-s9-4
move qacc-keylen to disp-s9-4
display "Info: keylen = " disp-s9-4
.
read-qedit-file.
move 2 to qacc-function
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-record
if qacc-status = 0 then
add 1 to read-counter
perform write-mpe-record
else
if qacc-status = -1 then
move "E" to qedit-file-flag
else
move qacc-status to disp-s9-4
display
"Error: Read returned unexpected status. "
"qacc-status = " disp-s9-4
.
write-mpe-record.
write mpe-record from qedit-record
add 1 to write-counter
.
close-qedit-file.
move 3 to qacc-function
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-record
if qacc-status = 0 then
move low-values to qedit-file-flag
else
move qacc-status to disp-s9-4
display
"Error: Can't close file. "
"qacc-status = " disp-s9-4
.
_______ _ ___________ _________
30 Chapter 4 Qeditaccess Procedure
_____ _______ __ _______ ___ __ _____
COBOL Program to Convert MPE to Qedit
Here is a sample COBOL/85 program that calls QeditAccess to
convert an MPE file to a Qedit file. It has been tested on both
MPE V and MPE/iX (in CM and NM).
$control uslinit
id division.
program-id. mpe2qed.
* mpe2qed reads a mpe file and generates a qedit file.
* The mpe file must be a 80B FA file. The qedit file
* will be created as a lang=job file with 400 blocks.
* Use a file command to define the input file name.
* E.g., :file in01=filename
environment division.
input-output section.
file-control.
select mpe-file assign to "IN01".
data division.
file section.
fd mpe-file
data record is mpe-record.
01 mpe-record pic x(80).
working-storage section.
01 disp-s9-4 pic +9(4).
01 disp-s9-9 pic +9(9).
01 qedit-filename pic x(40).
01 mpe-file-flag pic x(1) value low-value.
88 mpe-file-is-open value "O".
88 end-of-mpe-file value "E".
01 qedit-file-flag pic x(1) value low-value.
88 qedit-file-is-open value "O".
88 end-of-qedit-file value "E".
01 qacc-function.
05 qacc-func pic s9(4) comp
occurs 10 times.
01 qacc-workspace pic x(540).
01 filler redefines qacc-workspace.
05 qacc-status pic s9(4) comp.
05 qacc-filenum pic s9(4) comp.
05 qacc-type pic s9(4) comp.
05 qacc-lang pic s9(4) comp.
05 qacc-length pic s9(4) comp.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 31
05 qacc-size pic s9(9) comp.
05 qacc-block pic s9(4) comp.
05 qacc-index pic s9(4) comp.
05 qacc-readlen pic s9(4) comp.
05 qacc-left pic s9(4) comp.
05 qacc-keylen pic s9(4) comp.
05 filler pic s9(4) comp.
05 filler pic s9(4) comp.
05 qacc-buffer pic x(512).
01 dummy pic s9(4) comp.
01 qedit-record pic x(256).
01 write-counter pic s9(9) comp.
01 read-counter pic s9(9) comp.
procedure division.
mpe2qed.
display "MPE2QED TEST PROGRAM"
display space
display "Enter Qedit file to create: "
with no advancing
move spaces to qedit-filename
accept qedit-filename
if qedit-filename <> spaces then
open input mpe-file
perform open-qedit-file
if qedit-file-is-open then
move 0 to write-counter, read-counter
move 12 to qacc-func (1)
move 80 to qacc-func (2)
move 0 to qacc-func (3)
move 0 to qacc-func (4)
display "Info: Starting to write records"
perform read-mpe-record
until end-of-mpe-file
move read-counter to disp-s9-9
display
"Info: read-counter = " disp-s9-9
move write-counter to disp-s9-9
display
"Info: write-counter = " disp-s9-9
perform close-qedit-file
end-if
close mpe-file
end-if
goback
.
open-qedit-file.
move 9 to qacc-func (1)
_______ _ ___________ _________
32 Chapter 4 Qeditaccess Procedure
move 5 to qacc-func (2)
move 80 to qacc-func (3)
move 400 to qacc-func (4)
move 32 to qacc-func (5)
move 1 to qacc-func (6)
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-filename
if qacc-status = 0 then
move "O" to qedit-file-flag
else
move qacc-status to disp-s9-4
display
"Error: Can't open file. "
"qacc-status = " disp-s9-4
.
display-qedit-file-info.
move qacc-filenum to disp-s9-4
display "Info: filenum = " disp-s9-4
move qacc-type to disp-s9-4
display "Info: type = " disp-s9-4
move qacc-lang to disp-s9-4
display "Info: lang = " disp-s9-4
move qacc-length to disp-s9-4
display "Info: length = " disp-s9-4
move qacc-size to disp-s9-9
display "Info: size = " disp-s9-9
move qacc-block to disp-s9-4
display "Info: block = " disp-s9-4
move qacc-index to disp-s9-4
display "Info: index = " disp-s9-4
move qacc-readlen to disp-s9-4
display "Info: readlen = " disp-s9-4
move qacc-left to disp-s9-4
display "Info: left = " disp-s9-4
move qacc-keylen to disp-s9-4
display "Info: keylen = " disp-s9-4
.
read-mpe-record.
read mpe-file into qedit-record
at end move "E" to mpe-file-flag.
if not end-of-mpe-file then
add 1 to read-counter
perform write-qedit-record
.
write-qedit-record.
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure 33
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-record
if qacc-status = 0 then
add 1 to write-counter
else
move qacc-status to disp-s9-4
display
"Error: Can't write record. "
"qacc-status = " disp-s9-4
.
close-qedit-file.
move 10 to qacc-func (1)
call "QEDITACCESS" using qacc-function,
qacc-workspace,
qedit-record
if qacc-status = 0 then
move low-values to qedit-file-flag
else
move qacc-status to disp-s9-4
display
"Error: Can't close file. "
"qacc-status = " disp-s9-4
.
34
_______ _ ____________ __ _____
Chapter 5 Installation of Qcopy
_ ___________ ___________ __ __
* Integrating Qeditaccess in CM
_ ___________ ___________ __ __
* Integrating Qeditaccess in NM
Qcopy is distributed in the QLIB groups of the Robelle account.
To install Qcopy, you must first build the ROBELLE account, using
the robelle.pub.sys job file, then :RESTORE the files needed.
Here are the steps to follow:
:hello mgr.robelle
:file qtape;dev=tape
:restore *qtape;Qcopy@.qlib@,prose.qlib,&
:Qacc@.qlib,qaccess.qlibsrc;show
We include two copies of the Qcopy program: Qcopy.Qlib and
QcopyNM.Qlib, which is a native-mode version for MPE/iX systems.
To install the native-mode version of Qcopy as the production
version, use these commands:
:hello mgr.robelle,qlib
:rename qcopy,qcopycm
:rename qcopynm,qcopy
Here are the steps to print the user manual:
:file infile=qcopy.qlibdoc.robelle
______
:file output;dev=lp,,copies
:run prose.qlib.robelle
The source code for Qeditaccess will be found in qaccess.qlibsrc.
robelle. The file Qaccusl.qlib.robelle contains the object code
in MPE V (USL) format; the file Qaccobj.qlib.robelle contains the
MPE/iX object code.
___________ ___________ __ __
Integrating Qeditaccess in CM
Here are the steps to use the Segmenter to copy Qeditaccess into
one of your CM programs:
:hello user.account
:cobol myprog.source
:segmenter
-usl $oldpass
-auxusl qaccusl.qlib.robelle
-copy unit,Qeditaccess
-prep myprog.program;cap=...
-exit
:save myprog.program
_______ _ ____________ __ _____
Chapter 5 Installation of Qcopy 35
___________ ___________ __ __
Integrating Qeditaccess in NM
Use the Qaccobj file to copy the Qeditaccess object code into your
linked NM program file:
link from=objfile,qaccobj.qlib.robelle;to=progfile
If you have a large number of programs that call Qeditaccess, you
may prefer to put the object code in a single XL file, making
updates much easier:
:linkedit
-addxl from=qaccobj.qlib.robelle;to=myxl
-exit
36
_____
Index
_
A
already open write, function 14....16
already open write, function 16....17
already open, function 7...........15
anysize already open, function 31..18
anysize open serial, function 32...18
APPEND option......................7
argument parameter.................22
_
B
batch..............................3
_
C
close permanent, function 10.......15
close read, function 3.............14
close temporary, function 11.......16
CM installation....................34
command options....................6
control-y..........................5,6
convert a file on to itself........5,8
convert Keep to new Qedit..........9
convert Qedit to existing Keep.....8
convert Qedit to new Keep..........8
copying a group of files...........5
copying files......................5
creating Qedit files...............7
_
D
don't suspend on exit..............4
_
E
ERASE option.......................7
explain, function 18...............18
_
F
file number, workspace.............20
file size, workspace...............21
file type, workspace...............20
_____
37 Index
find line number, function 6.......14
From= command......................5
FTN option.........................8
function 1, open read..............13
function 10, close permanent.......15
function 11, close temporary.......16
function 12, write line............16
function 13, open write erase......16
function 14, already open write....16
function 15, open write append.....17
function 16, already open write....17
function 17, read line.............17
function 18, explain...............18
function 2, read next record.......14
function 3, close read.............14
function 30, open anysize read.....18
function 31, anysize already open..18
function 32, anysize serial open...18
function 4, rewind.................14
function 5, serial open............14
function 6, find line number.......14
function 7, already open...........15
function 8, read unnumbered........15
function 9, open new...............15
function parameter.................13
function summary...................13
_
G
group conversion of files..........5
_
H
help...............................3
Help command.......................3
HPDESK.............................3
_
I
INCLUDE files......................7
INCLUDE option.....................6,7
installation.......................34
introduction.......................1
_
K
key length, workspace..............22
_____
Index 38
_
L
language, workspace................20
left flag, workspace...............21
length of line number..............22
line number, workspace.............21
line numbers.......................5
_
M
MPE commands.......................2
_
N
native-mode........................3,34
New features of Qcopy..............1
NEW option.........................6
NM installation....................35
NMRL.Qlib.Robelle file.............35
_
O
open anysize read, function 30.....18
open new, function 9...............15
open read, function 1..............13
open serial, function 5............14
open write append, function 15.....17
open write erase, function 13......16
options in commands................6
overwriting workfile...............7
_
P
Parm=32............................4
PAS option.........................8
Pascal/Robelle callers.............12
position of line number............21
_
Q
QACCESS entry point................12
Qaccusl.Qlib.Robelle file..........34
Qcopy program......................3,34
Qcopynm............................3,34
qedit block, workspace.............21
qedit index, workspace.............21
QEDIT option.......................7
Qedit program......................1
Qeditaccess routine................1,12
_____
39 Index
_
R
read length, workspace.............21
read line, function 17.............17
read next record, function 2.......14
read unnumbered, function 8........15
read, no line numbers, function 17.17
reading Qedit files................12
recovering Qedit files.............10
recsize, workspace.................21
rewind, function 4.................14
_
S
save permanent file, function 10...15
save temporary file, function 11...16
serial open anysize, function 32...18
serial open, function 5............14
SERIAL option......................10
status, workspace..................19
suspending Qcopy...................4
_
U
UNN option.........................7
unnumbered.........................7
_
W
workspace of Qeditaccess...........18
workspace summary..................19
write line, function 12............16
writing to Qedit file..............16
_
X
XL.Qlib.Robelle file...............35
______ _______ _____
Reader Comment Sheet
_____ ___ ____ ______
QCOPY 4.7 User Manual
Your opinion of this manual is a valuable resource for helping us
improve the quality of our documentation. We invite you to rate
the manual in the areas shown below.
______ ______ ___ ______ ___ _____
Please circle one number for each:
____ _______ ____
Good Average Poor
* General organization 1 2 3
* Technical accuracy 1 2 3
* Writing clarity 1 2 3
* Convenience of size and format 1 2 3
* Ease of locating information 1 2 3
* Thoroughness of material 1 2 3
* Quality of examples 1 2 3
________ ___ ____________ _______ ___ ________ __ __________
Comments and suggestions: (please use reverse, or additional
______ __ _______
sheets as needed)
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
Thank you for your feedback. We appreciate your time and
interest. You may fax your comments to us at 1.888.robelle.
Name: Date:
Company: Position:
Address: Phone:
iii
_____ ____ ______
QCOPY User Manual
________
Contents
_______ _ _______ __ _____
Chapter 1 Welcome to Qcopy
New features of Qcopy.................1
New features of Qcopy.................1
New features of Qcopy.................2
Overview of Qcopy.....................2
How to run Qcopy......................3
Suspending Qcopy......................3
_______ _ _______ _____
Chapter 2 Copying Files
Copying groups of files...............5
Options...............................6
Examples..............................8
_______ _ ________ _____ ___ ______ ______
Chapter 3 Recovery Using the SERIAL Option
Introduction..........................10
Examples..............................10
_______ _ ___________ _________
Chapter 4 Qeditaccess Procedure
Introduction..........................12
Function parameter....................13
Workspace parameter...................18
Argument parameter....................22
Pascal example (reading Qedit file)...22
SPL example (reading Qedit file)......24
COBOL program to convert Qedit to MPE.26
COBOL program to convert MPE to Qedit.30
________
iv Contents
_______ _ ____________ __ _____
Chapter 5 Installation of Qcopy
Integrating Qeditaccess in CM.........34
Integrating Qeditaccess in NM.........35
_____
Index............................................36