TSO-ISPF JCL COBOL VSAM DB2 CICS Tools Articles Job Portal Forum Quiz Interview Q&A

Change ISPF/PDF Edit Macro Command


Change command is used to search for a string and change it to another string.

Example:

The following are examples of the CHANGE macro command:

Example 1:

ISREDIT CHANGE ME YOU

This example, the next occurrence of ME is changed to YOU. The letters ME can be upper, lower or mixed case letters, and may be located anywhere within a word, on any line.


Example 2:

ISREDIT (CURMEM) = MEMBER
ISREDIT CHANGE WORD &CURMEM "MEMBER:&CURMEM" 1 20 .ZFIRST
.LAB9

In this example, the current member name is put it into the variable named CURMEM, then an identifier is added to that name, when it appears in columns 1 through 20 in the lines from the beginning to the label of .LAB9.


Return Code:

Possible return codes are:

  • 0: The command or statement ended successfully.

  • 4: The specified string 'str1' was not found.

  • 8: The string 'str1' could not be changed to 'str2' because 'str2' is longer than 'str1' and there was no substitution on at least one change.

  • 12: The string 'str1' does not fit between the specified columns.

  • 20: A critical error has occurred.


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal