This version differs substantially from the B.07.00 QUERY3K version that is available on HP-UX. The original source code is now fully converted to C and was enhanced/fixed to be portable across different platforms. Also some minor bugs were fixed.
Please refer to the section titled "Known problems/limitations" below for any known issues and platform-specific notes.
Please send any feedback or problem reports to the Eloquence support at support@marxmeier.com.
This document describes the differences from the original QUERY version.
The documentation for QUERY/iX is available from the HP web site at the location below:
Contents:
The Eloquence QUERY3K executable is called query3k and located in the bin subdirectory of your Eloquence installation. The Eloquence installation should have added this directory to your PATH.
With QUERY3K as with the original QUERY commmands are passed through stdin, either interactively or by redirecting stdin from a file. As with QUERY input files must in ASCII format and may have line numbers. Any information past column 72 is ignored.
On MPE QUERY may be used interactively or with a script file as below:
:RUN QUERY.PUB.SYS;STDIN=file
The QUERY3K equivalent is one of the options below:
$ query3k < file
$ QSIN=file query3k
$ query3k xeq file
In any case the input is read from the specified file.
For interactive usage simply run the query3k executable:
$ query3k B.07.10 Eloquence QUERY3K WED, MAR 16, 2005, 5:23 PM Copyright 2004-2005 Marxmeier Software AG Copyright 2004 Hewlett-Packard Development Company, L.P. >
The QUERY3K output may be redirected by using the QSLIST or LP environment variables. If both are specified the QSLIST environment variable takes precedence.
The QSLIST environment variable by default specifies the name of an output file. The LP environment variable by default specifies a process to send the output to (such as the spooler). If neither is defined, any O=LP output is sent to the default printer queue (equivalent to LP=lp or LP=qlp on Windows).
This is a rough equivalent to file equations on MPE. Any of the environment variables may be set as below:
QSLIST=">outfile"This causes the output (in case of O=LP) to be redirected to the file outfile. In case the file exists it is replaced.
QSLIST=">>outfile"This causes the output (in case of O=LP) to be appended to the file outfile. In case the file does not exist it is created.
QSLIST="|lp"This causes the output (in case of O=LP) to be sent to the specified command (using a pipe). On the Windows platform the qlp command may be used as a replacement for lp.
A typical definition for the LP environment variable on HP-UX or Linux would be something like below:
LP="lp -onb -s -dprinter 2>/dev/null"On the Windows platform the equivalent is:
LP="qlp -s -dprinter"This sends the output to the printer queue "printer", suppresses the printing of banner pages, does not output the print job id on the screen and discards any spooler error messages.
Please note that environment variables need to be set before executing query3k (possibly marked as "exported" by the command shell) and cannot be defined in the QUERY script.
Using file equations (file name aliases)
Aliases to file and database names in QUERY3K may be established in two ways:
For example:
$ export REPORT=report.q $ query3k > XEQ REPORTThis accesses the file "report.q"
$ export DB=sample $ query3k > b=DB PASSWORD = >> MODE = >>5This accesses the database "sample"
For example:
$ query3k > :FILE REPORT=report.q > XEQ REPORTThis accesses the file "report.q"
$ query3k > :FILE DB=sample > b=DB PASSWORD = >> MODE = >>5This accesses the database "sample"
For additional information on the :FILE command please refer to the section on file equations below.
File equations in QUERY3K (:FILE, :LISTEQ, :RESET commands)
QUERY3K performs a partial evaluation of the :FILE command and supports a limited equivalant of the MPE "file equation". This might be used to specify the QUERY3K output (QSLIST) or file access from QUERY3K (eg. through XEQ). The :RESET and :LISTEQ commands are also supported in addition to :FILE.
The following syntax is recognized:
:FILE <designator>=<file reference>[;DEV={DISC|LP}]Where <designator> specifies a logical file name and <file reference> specifies the path/name of a file (with an optional open mode). It may also specify an operating system command that any output is sent to. Additional parameters may be present and are ignored.
Unless specified with a DEV=LP clause, any file equation will default to specify a file (DEV=DISC is implied).
The following examples specify different targets for the QSLIST file that is used by QUERY3K to specify the printer output.
:FILE QSLIST=report.txtSend the output to the file report.txt
:FILE QSLIST=report.txt;DEV=DISCSame as above
:FILE QSLIST=">>report.txt"Append the output to the file report.txt
:FILE QSLIST="|pr -2 -h 'QUERY3K output'|lp -s 2>/dev/null"Send the output to the specified command. This example causes output to be formatted in two columns and then printed.
:FILE QSLIST=lp;DEV=LPSend the output to the printer (as specified with the LP environment variable).
A similar result may be achieved by specifying environment variables _before_ starting QUERY3K.
For example:
export QSLIST=">> report.txt" export QSLIST="|pr -2 -h "QUERY3K output"|lp -s 2>/dev/null" export LP="|lp -onb -s 2>/dev/null"Note that any environment variables must be set (and possibly exported by the shell) before starting QUERY3K. It is not possible to define an environment variable from QUERY3K.
Original script:
:PURGE SNPEDCR :FILE QSLIST=SNPEDCR;DEV=DISC;DISC=20000;NOCCTL XEQ EDCOPEN.QEDDB FO SETS FO PATHS O=TERM EXIT
Equivalent QUERY3K script using the POSIX rm instead of the MPE PURGE command (note: the initial rm is not strictly necessary as QUERY3K by default overwrites existing files):
:rm -f SNPEDCR :FILE QSLIST=SNPEDCR;DEV=DISC XEQ EDCOPEN.QEDDB FO SETS FO PATHS O=TERM EXIT $ query3k < SNPEDC
Please note that EDCOPEN.QEDDB is a file in the local directory. Specifying a group in the file name has no special meaning.
Converted to a shell script:
# execute with the POSIX shell QSLIST=SNPEDCR query3k <<!! XEQ EDCOPEN.QEDDB FO SETS FO PATHS O=TERM EXIT !!
The following problems/limitations are currently known:
For example:
:PURGE SAREPORT :PAUSE 5would become
:rm SAREPORT :sleep 5
The following won't work:
:FILE REPORT=report.txt;DEV=DISC :rm REPORTIn this example, the rm command will attempt to remove the file REPORT.
However environment variables defined before starting QUERY3K are accessible to operating system commands and may be used in QUERY3K as well. For example:
$ export REPORT=report.txt $ query3k XEQ REPORT :rm $REPORT
Using environment variables or file equations may be used as a workaround.
>O=LP >O=TERM lp: standard input is empty lp: request not acceptedIn this case the lp command complains about that it did not receive any data and returns an error.
http://docs.hp.com/en/32650-90889/apfs01.html
We may consider to add this functionality to QUERY3K in a future version. Please send us some feedback if you depend on this function.
http://docs.hp.com/en/32650-90889/apd.html
We may consider to add this functionality to QUERY3K in a future version. Please send us some feedback if you depend on this function.
Switch to CP1252 encoding:
> mode con: cp select=1252Restore console to use CP850 or CP437 encoding:
> mode con: cp select=850 > mode con: cp select=437
The following changes were incorporated in the B.07.10 QUERY3K release:
The following changes were incorporated in QUERY3K-B0710-B4:
The following changes were incorporated in QUERY3K-B0710-B3:
PAC failure, call 5, status 1 ARITHMETIC OVERFLOW ON R0This problem was caused by a bug in the HPPACADD intrinsic replacement that could lead to an arithmetic overflow with certain values.
The following changes were incorporated in QUERY3K-B0710-B2:
The following changes were incorporated in QUERY3K-B0710-B1: