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
What are the functions which are used for character handling functions?
what techniques and/or procs do you use for tables? : Sas programming
What is the difference between reading data from an external file and reading data from an existing data set?
describe about physical data integration? : Sas-di
Name any two sas spawners? : sas-grid-administration
What is the difference between one to one merge and match merge? Give an example.
how sas deals with business intelligence? : Sas-bi
what is metadata? : Sas-bi
Which are the statements whose placement in the data step is critical?
What are types of transport files?
what is transformation in sas data integration? : Sas-di
For clinical entire study how many tables will create approx?
What is the basic structure of a sas program?
What is the difference between INPUT and INFILE ?
What is Linear Regression?