what is the difference between x=substr(name,1,2);
and substr(name,1,2)='x';
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / oanhntt
x=substr(name,1,2) means you assign x value equal to the
first 2 characters of variable "name" while
substr(name,1,2)='x' just compare these fist 2 characters to
value 'x', so this seem useless without condition syntax
(correct one should be: if substr(name,1,2)='x' then /*do
some thing*/;).
| Is This Answer Correct ? | 4 Yes | 16 No |
what are the methods that you would employ to fine tune your SQL extract process using SAS/Access or Proc SQL?
what is _error_?
2 Answers Axis Bank, Cognizant, JPMorgan Chase,
what are different analysis datasets you created and what are the new variables created
1.we can execute a macro with in a macro,by using call symput and symget can any one give me one example? 2.We can create the macro variables by using %let,%do,macro parameters,INTO clause in proc sql and call symput, can any one give me example to create macro variable with INTO clause and call symput? 3.
What versions of SAS have you used (on which platforms)?
Mention how to limit decimal places for the variable using proc means?
what are the categories that sas informats are used to the place the data? : Sas-administrator
Differentiate input and infile.
What do you understand by the term Normal Distribution?
What is proc sql pass through facility?
Mention common programming errors committed in sas ?
what is AE onset date and what is RDS?