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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / naresh

Use compress function and remove characters and special characters then you will get digits.. Now find the length of the string...

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

What is the difference between input and infile statement?

0 Answers  


what is the difference between proc means and proc tabulate?

3 Answers   Cognizant, CTS,


What system options would you use to help debug a macro? : sas-macro

0 Answers  


What are the prime responsibilities of data integration administrator? : Sas-di

0 Answers  


what is chi-square test? have you used that?

1 Answers   Accenture, Quintiles,






Name statements that function at both compile and execution time.

7 Answers   Accenture,


If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable?

3 Answers  


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

0 Answers  


what are the different ways of merging two datasets.name atleast 4.

2 Answers  


What is SAS? is it a software just for use or we can creat something over there?

5 Answers   Cognizant,


how does sas handle missing values in functions? : Sas programming

0 Answers  


what are the advantages of using SAS in clinical data mangement? why should not we use other software products in managing clinical data?

2 Answers   Wockhardt,


Categories