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
Differentiate between format and informat? : sas-grid-administration
which date functions advances a date time or date/time value by a given interval? : Sas programming
How to limit decimal places for variable using proc means?
Explain data_null_?
how to read the variables in sas? : Sas-administrator
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?
How can I remove header from output data set?
Explain input and put function?
Difference between sum function and using “+” operator?
What is the function of output statement in a SAS Program?
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
What are the features of base sas system?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
Can you explain the process of calendar?