Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between x=substr(name,1,2);
and substr(name,1,2)='x';

Answer Posted / sattwik panda

x=substr(name,1,2) will return first two character of a string whereas substr(name,1,2)='x' will replace first two character by 'x'.
Please try using the code below to get an idea.
data test;
name="Sattwik";
x=substr(name,1,2);
substr(name,1,2)='x';
run;

x will have the first two characters of name:'Sa'.
substr(name,1,2)='x' will replace first two characters of "Sattwik". So, now the name will contain "xttwik".

Is This Answer Correct ?    46 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pdv and what are its functions?

1040


What are the difference between the sas data step and sas procs?

1098


How can I remove header from output data set?

2570


do you prefer proc report or proc tabulate? Why? : Sas programming

930


what do the sas log messages "numeric values have been converted to character" mean? : Sas programming

965


how the sas basic syntax style described? : Sas-administrator

964


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

1024


Are you involved in writing the inferential analysis plan? Tables specifications?

3896


What are the features of base sas system?

1013


what is business intelligence? : Sas-bi

1012


explain about various caches available in data integrator? : Sas-di

990


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

956


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

1001


Can you explain the process of calendar?

1050


how do you pull data from equifax?tell me the process?

1739