Previous Topic: CHANGE CommandNext Topic: CHECKPOINT Command


Operand Definitions

Operand

Description

ALL
n

Number of occurrences of the string to change. ALL is the default.

FORWARD

Default. The search for string‑a begins with the first line of the component or the specified start line and processes through subsequent lines.

BACKWARD

The search for string‑a begins with the last line of the component or the specified end line and processes backward.

/

Character that delimits the strings in the command. You must use the same character consistently in a command. You can use any special character except the currently defined command delimiter (installed default is a semicolon (;)) or comment character (installed default is a colon (:)), an asterisk (*), an at sign (@), a pound sign (#), or dollar sign ($).

stringa

Character or string of characters to change to string‑b.

Stringa must be entirely in the column range and the string cannot include the string delimiter character or the current command delimiter.

string‑b

Character or string of characters that replaces the character or string of characters in string‑a. You can specify an empty stringb by placing two delimiters right next to each other, with no intervening spaces, for example, CHANGE /stringa//. This deletes stringa.

The string cannot include the string delimiter character or the current command delimiter.

start‑line

Line where the search for stringa begins. You can specify it as:

num The sequence number of the start line.

TOP Indicates the first line of the entity. If a start line is not specified, TOP is the default.

CURSOR Indicates the position where the cursor is located.

offset A position relative to the top line displayed:

* The top line displayed.

*+n The line n number of lines below the top line displayed.

*- n The line n number of lines before the top line displayed.

Note: You can omit the keyword LINE when you specify TOP, BOTTOM, or an offset.

end‑line

Line where the search for string‑a ends. You can specify it as:

BOTTOM Default. Last line of the entity.

num Sequence number.

CURSOR Indicates the position where the cursor is located.

offset

Position relative to the top line displayed:

* Top line displayed.

*+ n Line n number of lines below the top line displayed.

*n The line n number of lines before the top line displayed.

start‑column

Column where the search for string‑a begins.

MAX

Default. The farthest right‑hand column.

end‑column

Column where the search for string‑a ends.

Before

After (Truncation On)

After (Truncation Off)

ABCbDEF

ABCbDEF

AB123EF

BCbbDEF

B123DEF

B123DEF

 

Column Edited

Column Boundaries

Member

Data area

1 ‑ 72

Report

 

 

Detail

Field name

1‑25

Heading

Field name

1‑56

Column

Field name

1‑25

Program

 

 

Procedure

Data area

1‑72

Parameter

Field name

1‑19

Working Data

Field name

1‑19

Dataview

 

 

Field

Field name

1‑19

Key (VSAM)

Field name

1‑32

Plan

 

 

DBRM

DBRM

1‑8

Resource

Program name

1‑8

Example

The following example illustrates the use of the CHANGE command to change all occurrences of W#EMPLOYEE to W#EMPDATA. The COLUMNS operand restricts the change to column 40 through the farthest right‑hand column.

=> CHANGE /EMPLOYEE/EMPDATA/ COLUMNS 40 ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM EMPLST (001) TEST SYS: DEM FILL-IN Command....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. 000001 FOR EACH EMPLOYEE 000002 WHERE where_condition 000003 MOVE EMPLOYEE.FLD1 TO W#EMPLOYEE.FLD1 000004 MOVE EMPLOYEE.FLD2 TO W#EMPLOYEE.FLD2 000005 MOVE EMPLOYEE.FLD3 TO W#EMPLOYEE.FLD3 000006 MOVE EMPLOYEE.FLD4 TO W#EMPLOYEE.FLD4 000007 MOVE EMPLOYEE.FLD5 TO W#EMPLOYEE.FLD5 000008 MOVE EMPLOYEE.FLD6 TO W#EMPLOYEE.FLD6 000009 MOVE EMPLOYEE.FLD7 TO W#EMPLOYEE.FLD7 000010 MOVE EMPLOYEE.FLD8 TO W#EMPLOYEE.FLD8 000011 MOVE EMPLOYEE.FLD9 TO W#EMPLOYEE.FLD9 000012 MOVE EMPLOYEE.FLD10 TO W#EMPLOYEE.FLD10 000013 WHEN NONE 000014 statements 000015 ENDFOR

The results of the CHANGE command follow.

=> Changed 10 field(s) in 10 record(s) ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.... IDEAL: PROCEDURE DEFINITION PGM EMPLST (001) TEST SYS: DEM FILL-IN Command....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. 000001 FOR EACH EMPLOYEE 000002 WHERE where_condition 000003 MOVE EMPLOYEE.FLD1 TO W#EMPDATA.FLD1 000004 MOVE EMPLOYEE.FLD2 TO W#EMPDATA.FLD2 000005 MOVE EMPLOYEE.FLD3 TO W#EMPDATA.FLD3 000006 MOVE EMPLOYEE.FLD4 TO W#EMPDATA.FLD4 000007 MOVE EMPLOYEE.FLD5 TO W#EMPDATA.FLD5 000008 MOVE EMPLOYEE.FLD6 TO W#EMPDATA.FLD6 000009 MOVE EMPLOYEE.FLD7 TO W#EMPDATA.FLD7 000010 MOVE EMPLOYEE.FLD8 TO W#EMPDATA.FLD8 000011 MOVE EMPLOYEE.FLD9 TO W#EMPDATA.FLD9 000012 MOVE EMPLOYEE.FLD10 TO W#EMPDATA.FLD10 000013 WHEN NONE 000014 statements 000015 ENDFOR

The following example illustrates the use of the FIND and CHANGE commands to find all occurrences of ASK and change all occurrences of RLSASK to RLSDIS.

=> FIND ALL /ASK/ ------------------------------------------------------------------------------- IDEAL: PROCEDURE DEFINITION PGM CRTEST (001) TEST SYS: DEM FILL-IN Command....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. 000001 <<ASK>> PROCEDURE 000002 IF EXIST 000003 MOVE $SPACES TO RLSASK.MSG 000004 LOOP 000005 TRANSMIT RLSASK CLEAR 000006 WHILE $PANEL-ERROR 000007 ENDLOOP 000008 ELSE 000009 TRANSMIT RLSASK 000010 IF RLSASK.NUMBER = 99999 000011 QUIT RUN 000012 ENDIF 000013 SET EXIST EQ TRUE 000014 ENDIF 000015 DO DIS-ASK

Using the display of lines containing ASK, the CHANGE is applied to the lines specified.

=> CHANGE /ASK/DIS/ LINES 3 10 ------------------------------------------------------------------------------- IDEAL: PROCEDURE DEFINITION PGM CRTEST (001) TEST SYS: DEM FILL-IN INCL /ASK/ Command....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. 000001 <<ASK>> PROCEDURE 000003 MOVE $SPACES TO RLSASK.MSG 000005 TRANSMIT RLSASK CLEAR 000009 TRANSMIT RLSASK 000010 IF RLSASK.NUMBER = 99999 000015 DO DIS-ASK

The results of the CHANGE follows:

1 - Changed 4 field(s) in 4 record(s) ------------------------------------------------------------------------------ IDEAL: PROCEDURE DEFINITION PGM CRTEST (001) TEST SYS: DEM FILL-IN Command....+....1....+....2....+....3....+....4....+....5....+....6....+....7.. ====== ================================ T O P ================================= 000001 <<DIS>> PROCEDURE 000002 IF EXIST 000003 MOVE $SPACES TO RLSDIS.MSG 000004 LOOP 000005 TRANSMIT RLSDIS CLEAR 000006 WHILE $PANEL-ERROR 000007 ENDLOOP 000008 ELSE 000009 TRANSMIT RLSDIS 000010 IF RLSDIS.NUMBER = 99999 000011 QUIT RUN 000012 ENDIF 000013 SET EXIST EQ TRUE 000014 ENDIF 000015 DO DIS-ASK