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 some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
Name and describe few sas character functions that are used for data cleaning in brief.
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
How do you add a number to a macro variable? : sas-macro
Explain input and put function?
how to debug and test the sas program? : Sas-administrator
What are the features of base sas system?
Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager
How sas treats the dsd delimiters?
Explain proc sort?
What are the prime responsibilities of data integration administrator? : Sas-di
What does PROC print, and PROC contents do?
This entry was posted in General. Bookmark the permalink. Post a comment or leave
which date function advances a date, time or datetime value by a given interval? : Sas programming
What is run-group processing?