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 is the basic structure sas administrator? : Sas-administrator
what is metadata? : Sas-bi
What is the difference between %put and symbolgen? : sas-macro
Hi Jeevan/Akshara I have tried to contact SASI Vats for latest Advanced SAS Programming Certification Dumps (A00-212) but have not got any response. I would highly and gratefully appreciate your assistance in this regard. If you guys have access to this, would you be kind enough to forward it to me ? I would abide by all the terms you have for this. Please, note my email id: upretigopi@yahoo.com Preti Sharma
What is program data vector (pdv)?
what is business intelligence? : Sas-bi
How we can create SAS USER DEFINED CODE?
What are the default statistics that proc means produce?
how to change the execute of macro
What are the features of SAS?
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
What is the use of %include statement?
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
what is sas metadata repository? : Sas-bi
Explain how merging helps to combine data sets.