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?
Answers were Sorted based on User's Feedback
Answer / ganesh
Scan function the best for locating the particular word
specified in a argument,scan function default length is
200bytes.
data k;
r='ganesh kumar';
u=scan(r,2);
proc print;
run;
result: kumar
Is This Answer Correct ? | 10 Yes | 7 No |
Answer / prr
Hi Friends,
actually I can't able to understand the question.
please repeat again in a understandable way.
scan: it returns Nth word from character observation.
index: it return starting position of the character from
character observation.
index C: it returns starting position of any character from
character observation.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / rinky
The questions is to locate and not to extract any
particular word from a string of 150 bytes. SO, according
to me INDEX is the best.
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / 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 |
Answer / yaga
I think Index is the best option to locate the word
beacause SCAN is SAS function to extract the particular
word positioned in nth place. for ex: 2 word from the string
Is This Answer Correct ? | 1 Yes | 1 No |
What's the difference between VAR A1 - A4 and VAR A1 - A4?
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
for whom is sas data integration studio designed? : Sas-di
You need to create an In List that it is to be later used in a Where Clause that includes all the Regions that begin with the letter A from the sashelp.shoes table. Using PROC SQL with an into clause create the following string from the sashelp.shoes table using the variable region “AFRICA”,”ASIA”,…..
how the sas basic syntax style described? : Sas-administrator
what is chi-square test? have you used that?
1 Answers Accenture, Quintiles,
What does PROC print, and PROC contents do?
What is the difference between an informat and a format? Name three informats or formats.
If you’re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?
Difference between SAS STATA & SPSS?
what is factor analysis? : Sas-administrator
what is fact table and factless table?