QUERY

Read syntax diagramSkip visual syntax diagram Query operand

Purpose

Use the QUERY subcommand to display in the message area the current setting of various editing options. You can specify only one option in each QUERY subcommand.

Operands

operand
may be any one of the following keywords. A complete description of each operand follows. For additional information on some of the operands, refer to its corresponding SET subcommand (if applicable).
ACTion
displays ON or OFF to indicate whether any action other than displaying or scrolling has been taken on this file. This includes any file ID change, file characteristic change (LRECL, RECFM, PACK, SERIAL, SIDCODE, or ALT), and any other changes made to the file.
ALT
displays the number of alterations that have been made to the file since the last AUTOSAVE and SAVE, or as specified in the SET ALT subcommand.
APL
displays ON or OFF as defined in the SET APL subcommand.
ARBchar
displays ON or OFF and the arbitrary character specified in the SET ARBCHAR subcommand.
AUtosave
displays the current setting defined in the SET AUTOSAVE subcommand: the AUTOSAVE count, file ID, and number of alterations.
BASEft
displays the base file type specified in the LOAD subcommand or the XEDIT command (where the LOAD is implicit).
BFSLine
displays lrecl, NL, CRLF, CRNL, / string/, or /hexstring / as defined in the SET BFSLINE subcommand.
BRKkey
returns ON or OFF as defined by the terminal brkkey setting. If ON, then it also returns the PF or PA key currently set to be the BRKKEY.
CASE
displays the case setting U or M and R or I as defined in the SET CASE subcommand.
CMDline
displays ON, OFF, TOP, or BOTTOM as defined in the SET CMDLINE subcommand.
COLOR
Read syntax diagramSkip visual syntax diagram Query COLORfield*

displays the current setting defined in the SET COLOR subcommand for field, color, extended highlighting, HIGH or NOHIGH, and programmed symbol set for the field requested or for all fields (when * is specified). The fields that can be specified are: Arrow, Cmdline, CUrline, Filearea, Idline, Msgline, Pending, PRefix, Scale, SHadow, STatarea, Tabline, and TOfeof. Note that this operand may be specified as COLOR or COLOUR.

COLPtr
displays ON or OFF as defined in the SET COLPTR subcommand.
COLumn
displays the column number of the column pointer.
CTLchar
Read syntax diagramSkip visual syntax diagramQuery CTLchar char

If no character is specified (Q CTLCHAR), displays the escape character and all control characters defined in the SET CTLCHAR subcommand, in the form CTLCHAR ON ESCAPE char CTL c1 c2 c3 c4.... If no control characters have been defined, displays CTLCHAR OFF.

If a character is specified (Q CTLCHAR char), the attributes of that character are displayed in the form CTLCHAR char attribute1 (protected/unprotected field), attribute2 (color), attribute3 (extended highlighting), attribute4 (highlighting), and attribute5 (programmed symbol set). If no attributes were defined for the character, displays CTLCHAR char.

CURLine
displays the line number of the current line as specified in the SET CURLINE subcommand.
CURSor
displays the current position of the cursor on the screen (line number and column number) and the position of the cursor in the file (line number and column number). If the cursor is not in the file area, two negative numbers (–1) are displayed for the position of the cursor in the file. The top and bottom of the range are considered to be in the file.

The current position of the cursor is the location where the cursor would be placed if the screen were displayed at this time. The current position reflects relative changes due to additions/deletions of lines resulting from prefix execution. It does not necessarily reflect where the cursor will eventually be located when the screen is actually displayed. This is because cursor priority cannot be resolved until the screen is displayed.

DISPlay
displays the range of selection levels that are included in the display, as specified in the SET DISPLAY subcommand.
EDIRName
displays the name of the SFS directory containing the file at the time the file was first loaded.
EFMode
displays the two-character file mode of the file at the time the file was first loaded.
EFName
displays the eight-character file name of the file at the time the file was first loaded.
EFType
displays the eight-character file type of the file at the time the file was first loaded.
ENTer
displays BEFORE, AFTER, ONLY, or IGNORE and the ENTER key definition as set in the SET ENTER subcommand.
EOF
displays ON or OFF as the editor determines. EOF is ON when the line pointer reaches end of file (or end of range).
EOL
displays ON or OFF as the editor determines. EOL is ON when the column pointer reaches zone2+1.
EPName
displays the byte file system (BFS) path name at the time the file was loaded. Because a path name can have leading or trailing quotation marks, single quotation marks are used to surround the path name. A path name of '' is displayed if the file that was loaded was not a BFS file.

Depending upon the path name format used when the file was loaded, this can be a relative path name, an absolute path name, or a fully qualified path name. See Understanding Byte File System (BFS) Path Name Syntax for a description of the different forms of the BFS path name syntax.

ESCape
displays ON or OFF and the escape character defined in the SET ESCAPE subcommand.
ETARBCH
displays ON or OFF and the extended arbitrary character defined in the SET ETARBCH subcommand.
ETMODE
displays ON or OFF as defined in the SET ETMODE subcommand.
FILler
displays the filler character defined with the SET FILLER subcommand.
FMode
displays the two-character file mode.
FName
displays the eight-character file name.
FType
displays the eight-character file type.
FULLread
displays ON or OFF as defined in the SET FULLREAD subcommand.
GUI
displays ON or OFF to indicate whether GUI is active for the ring.
HEX
displays ON or OFF as specified in the SET HEX subcommand.
IMage
displays ON, OFF, or CANON as specified in the SET IMAGE subcommand.
IMPcmscp
displays ON or OFF as specified in the SET IMPCMSCP subcommand.
LASTLorc
displays the current contents of the last locate or change buffer, as SET LASTLORC or the editor specifies.
LASTmsg
displays the last message the editor issued. This message may or may not have been displayed, depending on the SET MSGMODE subcommand operands.
LENgth
displays the length of the current line from column one through the truncation column (excluding trailing blanks). The length is zero for Top of File and End of File lines.
LIBName
displays LIBNAME file name when MEMBER is ON. The file name is the library file name specified on the XEDIT or LOAD command. When MEMBER is OFF, the library file name is blank.
LIBType
displays LIBTYPE file type when MEMBER is ON. The file type is the library file type specified on the XEDIT or LOAD command. When MEMBER is OFF, the library file type is blank.
LIne
displays the current line number, relative to the beginning of the file.
LINENd
displays ON or OFF and the line-end character as defined in the SET LINEND subcommand.
LRecl
displays the logical record length of the file.
LScreen
displays six integers:
  • The number of lines and the number of columns in the logical screen
  • The line number and the column number defining the top left corner of the logical screen on the virtual screen
  • The number of lines and number of columns in the virtual screen.
MACRO
displays ON or OFF as specified in the SET MACRO subcommand.
MASK
displays the current mask line as defined in the SET MASK subcommand.
MEMber
displays MEMBER ON when editing a member of a CMS library or MEMBER OFF when not editing a library member.
MSGLine
displays ON or OFF, the location of the message line, the number of lines to which the message line can expand, and OVERLAY, if that has been specified, as defined in the SET MSGLINE subcommand.
MSGMode
displays ON and LONG or SHORT as defined in the SET MSGMODE subcommand; if SET MSGMODE OFF is in effect, nothing is displayed.
NAMetype
displays CMS or BFS as defined in the SET NAMETYPE subcommand.
NBFile
displays the number of files you are currently editing.
NONDisp
displays the character defined in the SET NONDISP subcommand.
NULls
displays ON or OFF as specified in the SET NULLS subcommand.
NUMber
displays ON or OFF as specified in the SET NUMBER subcommand.
PA
Read syntax diagramSkip visual syntax diagram Query PA *PAn

displays BEFORE, AFTER, ONLY, or IGNORE and if you specify:

  • A particular key (PAn), QUERY PA displays the setting of that key.
  • An asterisk or no argument at all, QUERY PA displays all PA key definitions.
PACK
displays ON or OFF as specified in the SET PACK subcommand.
PENDing
Read syntax diagramSkip visual syntax diagram Query PENDing BLOCK OLDNAME name*

displays the first entry in the pending list with name name or all the entries in the pending list (if * specified).

BLOCK
indicates that the pending list is to be checked for BLOCK entries only.
OLDNAME
indicates that the name specified is the original name of the prefix subcommand or macro.
name
indicates the name of the prefix subcommand or macro for which you are searching. If OLDNAME is also specified, name must be the original name of the prefix subcommand or macro, regardless of whether a synonym has been assigned to that name. Otherwise it is assumed to be a synonym (that is, a new name) or a name without a synonym.
*
indicates displaying all of the entries in the pending list. If BLOCK is also specified, * indicates displaying only the block entries.
The information is returned in the following form:
Line n : 'name', Oldname='name', OP1='x', OP2='y', OP3='z'
PF
Read syntax diagramSkip visual syntax diagram Query PF*PFn

displays BEFORE, AFTER, ONLY, or IGNORE and if you specify:

  • A particular key (PFn), QUERY PF displays the setting of that key.
  • An asterisk or no argument at all, QUERY PF displays all PF key definitions.
Note: If you are editing a file in line mode (SET TERMINAL TYPEWRITER), XEDIT does not recognize which key caused an attention interrupt. The definition that is executed is the CP definition of that key. To QUERY keys in line mode, use the CP QUERY PFnn command.
PName
displays the current active byte file system (BFS) path name. Because a path name can have leading or trailing quotation marks, single quotation marks are used to surround the path name. The total path name can be up to 1023 characters in length (not including surrounding quotation marks). A path name of '' is displayed if the file that was loaded was not a BFS file and SET PNAME has not been entered.

Depending upon the path name format used on SET PNAME or when the file was loaded, this can be a relative path name, an absolute path name, or a fully qualified path name. See Understanding Byte File System (BFS) Path Name Syntax for a description of the different forms of the BFS path name syntax.

Point
Read syntax diagramSkip visual syntax diagram Query Point *

QUERY POINT displays the symbolic name(s) associated with the current line, or displays a blank string if no names are specified for this line. QUERY POINT * displays all symbolic names that have been defined, starting at the top of the file, including the line number to which each name applies.

PREfix
Read syntax diagramSkip visual syntax diagram Query PREfix Synonymname*
QUERY PREFIX
displays:
  • ON, OFF, or NULLS
  • RIGHT or LEFT
as specified in the SET PREFIX subcommand.
QUERY PREFIX SYNONYM *
displays both the old and the new names of the synonyms defined for the prefix subcommand(s) or macro(s).
QUERY PREFIX SYNONYM name
displays the synonym for the specified prefix subcommand or macro and its associated old name.
RANge
displays the line numbers of the top and bottom of the range defined in the SET RANGE subcommand.
RECFm
displays the record format F, V, FP, or VP, defined in the SET RECFM subcommand.
REMOte
displays ON or OFF depending upon whether a remote terminal is being used or upon the setting specified in the SET REMOTE subcommand.
RESERved
displays (on one line) the line numbers of the screen lines currently reserved. The line numbers are displayed in the order in which they were reserved.
RING
displays the number of files you are editing and the file identification line for each file.
The editor displays the following message:
530I nn file(s) in storage
The following information is displayed for each file:
fn ft fm recfm lrecl Trunc=truncno Size=sizeno
Line=lineno Col=colno Alt=altcount
where:
fn
is the file name of the file.
ft
is the file type of the file.
fm
is the file mode of the file.

recfm
is the record format. F is fixed-length records. V is variable-length records. FP is fixed-length packed. VP is variable length packed.
lrecl
the logical record length of the largest record permitted in the file.
truncno
is the truncation column.
sizeno
is the number of records currently in the file.
lineno
is the position in the file of the current line.
colno
is the column number in which the column pointer is located.
altcount
is the number of alterations since the last autosave or the number set with SET ALT.
SCALe
displays ON or OFF and the position of the SCALE as specified in the SET SCALE subcommand (or SCALE prefix subcommand).
SCOPE
displays DISPLAY or ALL as specified in the SET SCOPE subcommand.
SCReen
displays the attributes of the screens that have been defined with the SET SCREEN subcommand, preceded by SIZE, WIDTH, or DEFINE.
SELect
displays the selection level of the current line and the maximum selection level for the file as specified in the SET SELECT subcommand.
Seq8
displays OFF if the XEDIT command or LOAD subcommand was issued with the NOSEQ8 operand; if not, displays ON.
SERial
displays the serial identification, the increment value, and the serial number starting value as defined in the SET SERIAL subcommand.
SHADow
displays ON or OFF as specified in the SET SHADOW subcommand.
SIDcode
displays the eight-character string specified in the SIDCODE option of the XEDIT command, the LOAD subcommand, or the SET SIDCODE subcommand.
SIZe
displays the number of records in the file being edited.
SPAN
displays ON or OFF, B or N, and n as defined in the SET SPAN subcommand.
SPILL
displays ON, OFF, or WORD as defined in the SET SPILL subcommand.
STAY
displays ON or OFF as specified in the SET STAY subcommand.
STReam
displays ON or OFF as specified in the SET STREAM subcommand.
SYNonym
Read syntax diagramSkip visual syntax diagram Query SYNonymname*
QUERY SYNONYM
displays ON or OFF as specified in the SET SYNONYM subcommand.
QUERY SYNONYM *
displays for each defined synonym its name, its minimum abbreviation, and the associated synonym definition, which includes the LINEND char, if specified, and everything that was specified in the SET SYNONYM subcommand after the size of the minimum abbreviation.
QUERY SYNONYM name
displays the synonym, its minimum abbreviation, and the associated synonym definition, which includes the LINEND char, if specified, and everything that was specified in the SET SYNONYM subcommand after the size of the minimum abbreviation.
(If no synonym has been defined, only the name is displayed.) For example:
set synonym up 1 down
query syn u
displays the following: SYNONYM UP U down
TABLine
displays ON or OFF and the position of the TABLINE as defined in the SET TABLINE subcommand (or TABL prefix subcommand).
TABS
displays the tab column numbers defined in the SET TABS subcommand.
TARGet
displays the following information about the character string that matches the last target located with a LOCATE or CLOCATE subcommand: line and column number of the first character in the string; line and column number of the last character in the string. If the last target located was specified with &, then only information about the last string found is displayed.

If the target of the LOCATE or CLOCATE has been specified as an absolute line number, a relative displacement from the current line, or a line name, then QUERY TARGET displays the line number and current column position (twice).

Information that QUERY TARGET returns may be incorrect unless the QUERY is done immediately following the LOCATE or CLOCATE of the target. Any XEDIT subcommand issued between the LOCATE or CLOCATE of the target and the QUERY has the potential to invalidate the TARGET information.

TERMinal
displays DISPLAY or TYPEWRITER as defined in the SET TERMINAL subcommand.
TEXT
displays ON or OFF as specified in the SET TEXT subcommand.
TOF
displays ON or OFF as the editor determines. TOF is ON when the line pointer reaches top of file (or top of range).
TOFEOF
displays ON or OFF as specified in the SET TOFEOF subcommand.
TOL
displays ON or OFF as the editor determines. TOL is ON when the column pointer reaches zone1–1.
TRANSLat
displays ON or OFF, depending on whether the user has defined pairs of uppercase translate characters using the SET TRANSLAT subcommand.
TRunc
displays the truncation column number as defined in the SET TRUNC subcommand.
UNIQueid
displays a unique identifier associated with the file. The identifier has the form rrrnnnnn where rrr is the number XEDIT associates with the ring and nnnnn is the current autosave number. Note that when the ring number, rrr, is less than 100, leading zeros are dropped. The uniqueid is also used as the file name for the AUTOSAVE file.
UNTil
displays the file type up through which updates were applied as specified on the XEDIT command or LOAD subcommand.
UPDate
displays ON or OFF as the editor determines. Update is ON when the XEDIT command or LOAD subcommand has been issued and the UPDATE option was specified or implied.
VARblank
displays ON or OFF as specified in the SET VARBLANK subcommand.
Verify
displays H (if SET VERIFY with the HEX option was previously issued), the verification columns and ON or OFF as specified in the SET VERIFY subcommand.
VERShift
displays n or –n, which is the relative position of the screen over the file, as a result of any LEFT or RIGHT subcommands.
Width
displays the WIDTH value specified in the XEDIT command or LOAD subcommand.
WRap
displays ON or OFF as specified in the SET WRAP subcommand.
Zone
displays the left and right zone column numbers specified in the SET ZONE subcommand.
=
displays the string in the equal (=) buffer. The = buffer contains the last executed subcommand or macro or CP/CMS command, or whatever has been specified in the SET = subcommand.

Usage Notes

  1. The following options are not valid when queried from a typewriter terminal:
    CMDLINE                      LSCREEN
    CURSOR                       SCREEN
    If you query any of these operands from a typewriter terminal, the following message is displayed:
    520E Invalid operand: operand

Messages and Return Codes

520E
Invalid operand: operand [RC=5]
525E
Invalid {PFkey|PFkey/PAkey} number [RC=5]
538E
No name defined [RC=3]
545E
Missing operand(s) [RC=5]
554E
Not enough virtual storage available [RC=104]
586E
Not found [RC=2]

where return codes are:

0
Normal
2
'QUERY PENDing' was issued, but no pending name or list is defined
3
'QUERY POINT *' was issued, but no symbolic names are defined.
5
Invalid or missing operand(s) or number
6
Subcommand rejected in the profile due to LOAD error, or QUIT subcommand has been issued in a macro called from the last file in the ring
104
Insufficient storage