When looking for data contained in a character string of 150
bytes, which function is the best to locate that data: scan,
index, or indexc?

Answer Posted / jothi sankar

INDEX is best one. Is for getting location of mentioned
data.

Eg:
str1 = 'Hi i am fine here. how are u there ? .....';
str2 = index(str1,'how'); --> str2 = 20



SCAN is to get a substring upto mentioned character

INDEXC to locate only for mentioned one or more single
character

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?

1945


what are informats in sas? : Sas-administrator

588


How many data types are there in SAS?

634


Give an example where SAS fails to convert character value to numeric value automatically?

608


How does proc sql work?

618






What are the five ways to do a table lookup in sas? : sas-grid-administration

598


If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro

595


What can you learn from the SAS log when debugging?

921


Differences between where and if statement?

584


what are all the reports you generated in your recent project?

1683


How will you use the WHO Drug Dictionary for Reporting Clinical Trials?

1884


What areas of SAS are you most interested in?

1063


what are sas bi dashboard components? : Sas-bi

663


where to use sas business intelligence? : Sas-bi

582


What do you code to create a macro? : sas-macro

582