Difference Between Scan and Substr

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Of all your work, where have you been the most successful?

4198


Difference between nodup and nodupkey options?

630


What is the maximum length of the macro variable?

674


What are the parameters of scan function?

620


What is a macro routine?

2101






what is SAS OPTIMIZATION?

1813


Describe crosslist option in tables statement?

711


Explain how you can debug and test your SAS program?

564


what has been your most common programming mistake? : Sas programming

563


How to create an external dataset with sas code?

584


Explain translate function?

630


Explain the difference between informat and format with an example.

680


What is a pdv and what are its functions?

598


What are the difference between sas functions and procedures?

636


what is hash files in sas and why we are using this one in sas?

1726