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

Briefly explain input and put function?

1079


What are the special input delimiters used in SAS?

1175


Explain why double trailing @@ is used in input statement?

1055


why is sas considered self-documenting? : Sas programming

1144


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2794


How do you connect the desktop application to metadata server? : sas-grid-administration

1088


What are SAS/ACCESS and SAS/CONNECT?

1139


What is SAS?

1048


Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?

2243


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

1062


How do you delete duplicate observations in sas?

1067


how to remove duplicates using proc sql?

1146


I have a dataset concat having variable a b & c. How to rename a b to e & f?

1014


Mention how to limit decimal places for the variable using proc means?

1107


what are the categories that sas informats are used to the place the data? : Sas-administrator

1040