Previous Topic: D (Delete)Next Topic: I (Insert)


GC (Mass Change)

Summary

The following table summarizes the GC command.

Command

Parameters

Instructions

GC

/string1/string2/

Enter GC in the line number column. Enter the string you want to change as string1 in the text area, followed by the replacement string as string2.

Description

The GC command locates all occurrences of a string and changes them to another string.

Action

Enter the GC command in the first position of the line number column and tab over to the query entry area. Type your search string and replacement string over the existing text. The text you type over is not deleted. The string size limit is 32 characters. You can use any special character to delimit the strings. Any special character in position 1 of a query text line where GC appears in the line number column is interpreted as the string delimiter. Examples of special characters are:

? @ # % /

CA Dataquery changes all occurrences of the string. This includes the current line.

Example—Changing All Occurrences

=> ------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ----------------------------------------------------------------------------- NAME: SAMPLE-QUERY TYPE: QUERY STATUS: PRIVATE DESCRIPTION: SHOW EDITOR LINE COMMAND FUNCTIONS ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. GC /ORD-ID/EMP-ID/ CAI-RCPTS-REC 04 SET NET-COST (8.2) = CAI-SLSHST-REC SHIP-QTY * UNIT-PRICE 05 SET DISCOUNT (5.2) = NET-COST * DISC-PCT 06 SET DISCOUNT-COST (8.2) = NET-COST - DISCOUNT 07 SORT CAI-RCPTS-REC BY (ITM-ID) 08 CAI-SLSHST-REC BY (ITM-ID) 09 PRINT FROM CAI-RCPTS-REC ITM-ID 'ORD-ID' 10 FROM CAI-SLSHST-REC ITM-ID 11 SHIP-QTY 12 UNIT-PRICE 13 (NET-COST) 14 DISCOUNT ----------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> EXECUTE <PF4> SAVE <PF5> DIALOG DEF <PF6> DELETE <PF7> BACKWARD <PF8> FORWARD <PF9> UPDATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> CREATE MODE

Result

=> ------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ----------------------------------------------------------------------------- NAME: SAMPLE-QUERY TYPE: QUERY STATUS: PRIVATE DESCRIPTION: SHOW EDITOR LINE COMMAND FUNCTIONS ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. 07 SORT CAI-RCPTS-REC BY (EMP-ID) 08 CAI-SLSHST-REC BY (ITM-ID) 09 PRINT FROM CAI-RCPTS-REC ITM-ID 'EMP-ID' 10 FROM CAI-SLSHST-REC ITM-ID 11 SHIP-QTY 12 UNIT-PRICE 13 (NET-COST) 14 DISCOUNT ----------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> EXECUTE <PF4> SAVE <PF5> DIALOG DEF <PF6> DELETE <PF7> BACKWARD <PF8> FORWARD <PF9> UPDATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> CREATE MODE