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

FIND ISPF/PDF Edit Macro Command


FIND command is used to find a search string in any or selected display lines.

ISREDIT FIND str {col1 {col2 } }
                 {label1 label2}
                              {NEXT } {ALL } {FIRST} {LAST } {PREV}
                              {CHARS } {PREFIX} {SUFFIX} {WORD }
                              {X} {NX}

  • 'str' is the string that will be searched for.

  • 'col1' and 'col2' are optional range of column numbers that may be used to limit the search done by the FIND command.

  • 'label1 label2' parameter identifies two labels that specify a range of lines that will searched by the FIND macro command. The defaults are the labels .ZFIRST and .ZLAST.

  • The default 'NEXT' parameter indicates the search will begin at the next position after the cursor and will scan forward to the next occurrence.

  • The 'ALL' parameter indicates the search will begin at the top of the data and will scan ahead to find all occurrences of the string.

  • The 'FIRST' parameter indicates the search will begin at the top of the data, but it will stop at the first occurrence of the string.

  • The 'LAST' parameter indicates the search will begin at the bottom of the data and scan backwards to locate the last occurrence of the string.

  • The 'PREV' parameter indicates the search will begin at the current cursor location and scan backward to locate the previous occurrence of the string.

  • The 'PREFIX' parameter indicates the string must be found as a prefix of a word.

  • The 'SUFFIX' parameter indicates the string must be found as a suffix of a word.

  • The default 'CHARS' parameter indicates the string may be found anywhere the characters match.

  • The parameter 'WORD' indicates the string will be found when it is surrounded by blanks, or other alphanumeric characters, on both sides.

  • The 'X' parameter indicates only excluded lines are searched. The 'NX' parameter indicates only non-excluded lines are searched.


String to be searched is any one of the following Simple string - Not case sensitive

Hex string - eg. X'c27B'

Character string - Case sensitive (start with 'c') eg. C'Don' Picture string - starts with 'p' eg. 'P'


Example:

The following are examples of the FIND macro command.

Example 1:

Find lines that contain the letters THEN,

ISREDIT FIND C'THEN'

Example 2:

Find first line between .A and .C with prefix of THEN:

ISREDIT FIND THEN .A .C FIRST PREFIX

Example 3:

Find last excluded line from .A to .B with suffix of THEN:

ISREDIT FIND THEN .A .B LAST SUFFIX X

Example 4:

Find the first preceding non-excluded line within labels

.A and .C with a word equal to THEN in columns 1 through 5.

ISREDIT FIND THEN .A .C PREV WORD 1 5 NX

Example 5:

Find all the 4 digit numerals in 8 th column

"ISREDIT F P'####' 8 ALL"

Example 6:

Find all strings matching the pattern '-anteil-' followed by 2 digit number.

"ISREDIT F P'-anteil-##' ALL"

Return Code:

Possible return codes are:

  • 0: The command or statement ended successfully.

  • 4: The search string was not found.

  • 12: An error was detected with the syntax.

  • 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