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 scrubbing procedures in sas?
What are SAS/ACCESS and SAS/CONNECT?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
What do the put and input function do?
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?
What Proc glm does?
what is intially documentation in sas?
Mention what is the difference between nodupkey and nodup options?
what is the function of catx syntax? : Sas-administrator
name several ways to achieve efficiency in your program? : Sas programming
what do you mean by data staging area? : Sas-di
What is the basic structure of the SAS base program?
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro