Difference Between Scan and Substr

Answers were Sorted based on User's Feedback



Difference Between Scan and Substr..

Answer / yachna

There is only one difference between Scan & Substr..Just look at below example

eg. String = rajesh chauhan
   If we want first four letter of the string then we can use Substr function here not scan..Scan function can pick first word.
  SubName=Substr(String,1,4);
  ScanName=Scan(String,1,' ');

      Subname = raje
      ScanName=rajesh

Is This Answer Correct ?    18 Yes 1 No

Difference Between Scan and Substr..

Answer / sudhir kumar

Both are function scan function Extracts nth position word
from string separated key dlm if n is -ve then starts at
end. and substr function extracts char string from start
position and with length .

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More SAS Interview Questions

Explain the purpose of retain statement.

0 Answers  


What do you understand by the term Normal Distribution?

0 Answers  


If you were told to create many records from one record, show how you would do this using array and with proc transpose?

0 Answers  


how to extract data from SAP servers? Is like oracle servers or any other methods to extract please reply me.

1 Answers  


Hi I have list of products in a dataset, which are classified by other name for eg:- there is a product A> Malambo Shiraz Malbec 750ML(0388) which is a Red wine.Now i need to generate a report where it shows if this product appears then it should b displayed as red wine,similarly for other products and other classification. I dont wan use proc format.

4 Answers   Symphony,






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?

0 Answers  


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

0 Answers  


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”,…..

3 Answers  


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

0 Answers  


Give some examples where proc report’s defaults are same as proc print’s defaults?

0 Answers  


What do you feel about hardcoding?

4 Answers   Oracle,


How would you include common or reuse code to be processed along with your statements?

5 Answers   PSCI,


Categories