@Naveen1111 wrote:
indeed, so on that basis, results should be identical as in blank variable i used strip function, which removed the leading and trailing blanks. But when i used x variable (x=countc(blank," ");)with countc function, still showing spaces, not in y variable case(y=countc(strip(Agency)," ");)
The variable Blank, when created is the same length as agency. As such it will be padded at the end with blanks.
Example below shows the result of a "stripped" variable sandwiched between : characters. Countc counts them unless explicitly stripped at the time of counting.
data example;
x=' Some string with lead and trail blanks ';
blank=strip(x);
string= ':'||blank||':';
y=countc(string,"");
put string=;
run;
Look in the log to see value of string.