CA Dataquery Editor Commands

Use the dqd Editor and your knowledge of DQL or SQL to build queries, dialogs and terms ranging from the simple to the complex. To aid you in your task, the Editor has line commands you use to insert, copy, move, delete, repeat and split lines, and commands which allow you to shift the position of data within a line, locate or change character strings, and scroll text forward and backward.
datacom
Use the
Dataquery
Editor and your knowledge of DQL or SQL to build queries, dialogs and terms ranging from the simple to the complex. To aid you in your task, the Editor has line commands you use to insert, copy, move, delete, repeat and split lines, and commands which allow you to shift the position of data within a line, locate or change character strings, and scroll text forward and backward.
The following topics are discussed on this page:
Special Aids
PF keys are available when you are building your query to display database information, and a template from which you can select statements to insert into query text on the Editor panel. Other PF keys allow you to scroll forward and backward if your query is more than one panel long or left and right if your terminal is an 80-character width display. Another special PF key, available in both modes, lets you validate your query, that is, check for errors in syntax and names of database tables, columns and keys.
Editor Modes
The Editor panel provides you with a Create mode where you build your query and a Process mode where you can perform such functions as executing, saving and deleting queries. A special PF key allows you to switch back and forth between these two modes.
Create Mode
Selecting CREATE from the Main Menu or typing
CREATE
in the command line on any panel displays the Editor panel in Create mode. Using this panel, you can:
  • Insert keyword formats selected from the template or type in statements in the space provided on the panel.
  • Insert any comments that you want to exclude from the query by preceding them with the characters used at your site. If your site does not use the default */ to begin a comment and /* to end a comment, see your
    Dataquery
    Administrator for the characters used.
  • Display database information using PF keys, and insert table, column and key names at the appropriate location in query statements.
  • Use the
    Dataquery
    Editor commands to insert, copy, move, repeat, delete and split lines; scroll the display to a specific line; shift data left or right within a line; locate and change strings within the query.
  • Validate the query, that is, check for errors in table, column and key names and syntax.
  • Access the Editor panel in Process mode.
Process Mode
Selecting the EDIT option (<PF4> EDIT) on any Directory panel where this option is available or typing
EDIT query-name
in the command line on any panel displays the Editor panel in Process mode. The
query-name
entry must be the name of an existing query or dialog. Using this panel, you can:
  • Save the query you have just created.
  • Execute the query you have just created or updated.
  • Delete the query displayed on this panel.
  • Update a saved query of your own which is displayed on this panel.
  • Validate the query you have just created, saved or updated.
  • Select the dialog definition option to create a dialog.
  • Access the Editor panel in Create mode.
  • Use the
    Dataquery
    Editor commands to insert, copy, move, repeat, delete and split lines; scroll the display to a specific line; shift data left or right within a line; locate and change strings within the query.
Commands Summary
The following summarizes the commands that are discussed in detail in this section.
  • A
    After
     -- Destination for a move or copy after line with A.
  • B
    Before
     -- Destination for a move or copy before line with B.
  • CH /string1/string2/
    Changes the first string to the second string.
  • C
    Copies a single line to the specified destination.
  • Cn
    Copies the indicated number of lines starting with the line on which you entered the command to the specified destination.
  • CB
    Copies all lines following the command through the end of the panel to the specified destination.
  • CC
    Copies the block you define to the specified destination.
  • CT
    Copies from the first line through the line with the command.
  • D
    Deletes a single line.
  • DB
    Deletes from line with the command through the last line.
  • DD
    Deletes block of lines specified by a pair of line commands 
    DD
    .
  • Dn
    Deletes a specified number of lines including the one on which you enter the command.
  • DT
    Deletes from first line through line with the command.
  • GC /string1/string2/
    Changes every occurrence of first string to second string, and leaves display positioned at last string changed.
  • I
    Inserts a blank line after the line with the I command.
  • I
    n
    Inserts the specified number of lines after the line with the I
    n
    .
  • NE /string/
    Searches forward for the specified text string.
  • PR /string/
    Searches backward for the specified text string.
  • M
    Moves a single line to the specified destination.
  • MB
    Moves a block of text starting with the line on which you enter the command through the end of the panel.
  • MM
    Defines and moves a block of text to the specified destination.
  • Mn
    Moves the specified number of lines to the specified destination.
  • MT
    Moves a block of text starting with line 01 and continuing through the line on which you enter the command.
  • R
    Repeats the line on which you enter the R command.
  • Rn
    Repeats the line with the R command n times.
  • *
    Scrolls the line on which you enter the * to the top of the display.
  • T
    Scrolls to the top of the panel.
  • <n
    Shifts the display the specified number of columns to the left.
  • >n
    Shifts the display the specified number of columns to the right.
  • SP
    Splits the line into two lines at the point you place your cursor.
  • X
    On any line, cancels pending COPY, MOVE, BEFORE, or AFTER.