Help using Base SAS procedures

Index function help

Reply
N/A
Posts: 0

Index function help

Hi,

I have a column
Data set 1
Book type Author
fiction raddy
fiction bosco
science srins
science srins


data set 2


I have many columns in data set 2. However one of the column say
description has entries about the author


description


raddy 99 version 1.0 vol 1
bosco 78 version 5.0 vol 8
srins99 version 2.0 vol1
srins_78 version7.0 vol1


I did a full join and have both the columns in data set 3. Now I need a way to find out whether the string in column author is there in column description.

The code should result as
author description flag
raddy raddy y
bosco bosco y


For example raddy is there in the description and author so a flag
colum would be set to Y.


Please help
Super Contributor
Posts: 273

Re: Index function help

Posted in reply to deleted_user
You have an answer on another list
Super User
Posts: 5,424

Re: Index function help

Posted in reply to deleted_user
Just use it as documented...;-)

SQL style:
case when index(description,author) then "y" else "n" end as flag

/Linus
Data never sleeps
Ask a Question
Discussion stats
  • 2 replies
  • 105 views
  • 0 likes
  • 3 in conversation