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 are the functions which are used for character handling functions?

1189


what techniques and/or procs do you use for tables? : Sas programming

1101


What is the difference between reading data from an external file and reading data from an existing data set?

1232


describe about physical data integration? : Sas-di

1096


Name any two sas spawners? : sas-grid-administration

1093


What is the difference between one to one merge and match merge? Give an example.

1119


how sas deals with business intelligence? : Sas-bi

1102


what is metadata? : Sas-bi

1074


Which are the statements whose placement in the data step is critical?

1308


What are types of transport files?

8085


what is transformation in sas data integration? : Sas-di

1082


For clinical entire study how many tables will create approx?

2020


What is the basic structure of a sas program?

1169


What is the difference between INPUT and INFILE ?

1374


What is Linear Regression?

1221