Write a SAS macro to calculate number of numbers in an
email address

Answer Posted / dey

%macro logic(email=);
data _null_;
length EMAIL $50;
Email=&email;
retain count 0;
do i = 1 to length(EMAIL);
if missing(substr(EMAIL,i,1)*1)=0 then
COUNT= COUNT +1;
end;
call symput('count',count);
RUN;
%put &count;
%mend logic;

%logic(email='dey_anurup123444@yahoo.12co.in')

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give an example where SAS fails to convert character value to numeric value automatically?

837


Mention what is the difference between nodupkey and nodup options?

787


What are the different versions of sas that you have used until now? : sas-grid-administration

1037


how do you test for missing values? : Sas programming

782


how to read the variables in sas? : Sas-administrator

777


What do the SAS log messages "numeric values have been converted to character" mean?

1107


What is factor analysis?

851


What do you understand by the term Normal Distribution?

757


How do you delete duplicate observations in sas?

804


how does sas handle missing values in assignment statements? : Sas programming

786


If you use a symput in a data step, when and where can you use the macro variable? : sas-macro

817


How would you determine the number of missing or nonmissing values in computations?

840


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

828


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1672


what is the one statement to set the criteria of data that can be coded in any step? : Sas programming

895