Saturday, March 5, 2011

Search for a string using Sort Card

There are many scenarios where in we want to search for a particular string in a record but we are not sure at what position that string is. The sort card below solves the problem :)

SORT FIELDS=COPY
INCLUDE COND= (1, 80, SS, EQ, C'FIND STRING')

1 - Starting position to search the string

80 - Length of the record/till the position where search has to take place

SS - Search string

FIND STRING - This is the string to be searched in every record of the file

1 comment: