RC/Edit Command Reference

RC/Edit supports a full range of primary commands for controlling the display and performing edit related functions. These commands can be assigned to Function keys or entered on the command line.
carcudb2
2
2
RC/Edit supports a full range of primary commands for controlling the display and performing edit related functions. These commands can be assigned to Function keys or entered on the command line.
Some of the primary commands search for data within columns to perform their functions. Some examples include FIND, RFIND (F5), CHANGE, RCHANGE (F6), and SORT. The following sections describe how RC/Edit performs searches as a result of issuing these commands.
General
When RC/Edit searches for a string as a result of a FIND or CHANGE command, the search starts at the first column of the first visible row on the screen unless a column name is specified. If a FIND or CHANGE command is issued with a specified column name, the search starts at the top of the table. If the search is successful, the cursor moves to the column containing the search string. If the next search command is RFIND or RCHANGE (without a column name), the search starts after the current cursor position. If the next search command is RFIND or RCHANGE with a specified column name, the search starts at the top of the table.
RC/Edit searches all columns automatically unless a column name or column abbreviation is specified to limit the search. The column being searched does not have to appear on the screen. When there is a successful match that is not already on the screen, RC/Edit automatically displays that column on the left side of the screen (for Column Mode) or the top of the screen (for Form Mode).
Keywords for Searches
Following are keywords used to search data.
  • ALL
    After a FIND command, ALL searches for all occurrences of the search string and displays the count of occurrences instead of the actual occurrences.
    After a CHANGE command, ALL searches for all occurrences of the search string, changes each, and displays a count of the changes. If the change string is longer than the search string in a particular occurrence, there might not be room to make the substitution. In this case, a count of changes that were not allowed is generated, along with the count of actual changes.
  • X
    After a CHANGE command, the X keyword causes the search to look only for occurrences in rows or columns that have been excluded, with XCOL or the X line command.
  • NX
    After a CHANGE command, the NX keyword causes the search to look only for occurrences in rows or columns that have not been excluded with XCOL or the X line command.
  • Y or NULL
    After a CHANGE command, the keywords Y or NULL cause the search to look only for NULL values.
    Examples:
    FIND Y FIND NULL
  • N or ¬NULL
    After a CHANGE command, the keywords N or ¬NULL cause the search to look only for non-NULL values. If either of these keywords represent the replacement value in a CHANGE command, the value found is changed to 0 in a numeric column, or to a blank in a character column.
    Examples:
    CHANGE NULL ¬NULL CHANGE Y N
To search for characters that are keywords, they must be enclosed in single quotes (for example, FIND 'Y').
Asterisk as Search String Parameter
Use an asterisk (*) as a search string parameter instead of typing in the previous one again. When a search string is entered for a CHANGE command, that value is saved as the current search string. If FIND AJAX is entered, AJAX is saved as the current search string. CHANGE * ACME can then be entered, and searches for the next occurrence of AJAX and change it to ACME. The asterisk (*) can be also found as the search string by enclosing it in single quotes (for example, find '*').
Character Data
When searching for character data, the string needs to be included in quotes if it contains blanks or if the string is embedded in apostrophes.
To search for a null value in a nullable column, use ' ' as the find string.
If column length has been controlled with the SETWIDTH command, RC/Edit searches the whole column for character data, regardless of the display length. If only 10 characters are displayed in a 1000 character column, RC/Edit still searches all 1000 characters.
When character data is being changed (CHANGE family of commands), the data surrounding the change is expanded or contracted accordingly. If the expansion of data would cause loss of significant data, then the change is not processed.
Numeric Data
For numeric data, RC/Edit uses the whole number as the search value. It does NOT break a number into parts like character data. For example, if a search value of 1000 is entered, RC/Edit will not match 10000.
Notational Conventions for RC/Edit Commands
The following notational conventions are used for the command syntax.
Notation
Description
UPPERCASE characters
Must be entered as shown.
lowercase characters
User-specified variables.
<
column name
>
The full DB2 column name or the RC/Edit column abbreviation.
Note:
A name that contains embedded blanks must be enclosed in quotation marks.
( )
Must be entered where shown.
[ ]
Enclose optional parameters, choose 1.
{ }
Enclose required parameters.
|
Or, as in Y | N.
Underlined
Abbreviations.