Sunday 10 March 2013

Finding Strings in a File using FIND command.


Finding String characters:


Following is the syntax for using FIND command

FIND string [NEXT] [CHARS]   [column­1 [column­2]]
   [PREV] [PREFIX]
   [FIRST] [SUFIX]
   [LAST ] [ WORD]
   [ALL]


We specify the columns to indicate which columns to search in.

Examples:  
FIND abc 5 --> Searches for the string abc starting at column 5

FIND abc 5 10 --> Searches for the string abc between column 5 and 10

FIND abc LAST --> Searches for the last occurrence of string abc

FIND abc FIRST --> Searches for the last occurrence of string abc

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.09             CHARS 'DSN' found
Command ===> find DSN LAST 1 15                               Scroll ===> CSR 
****** ***************************** Top of Data ******************************

FIND CMN ALL --> Searches for all occurrences of string CMN.

FIND abc SUFFIX --> Searches for abc Suffix.


No comments:

Post a Comment